2021-10-02 02:24:33 +01:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: deploy
|
|
|
|
|
|
|
|
steps:
|
2021-10-02 02:34:56 +01:00
|
|
|
# GO api
|
2021-10-02 02:24:33 +01:00
|
|
|
- name: build_api
|
|
|
|
image: golang
|
|
|
|
environment:
|
2021-10-02 02:44:55 +01:00
|
|
|
GIN_MODE: release
|
2021-10-02 02:24:33 +01:00
|
|
|
commands:
|
|
|
|
- cd Api
|
|
|
|
- go build
|
2021-10-02 02:34:56 +01:00
|
|
|
# Platformio esp firmware
|
2021-10-02 03:01:01 +01:00
|
|
|
- name: build_esp
|
|
|
|
image: python:slim
|
|
|
|
commands:
|
|
|
|
- pip install -U platformio
|
|
|
|
- cd ESP-Temp-Humidity
|
|
|
|
- pio run
|
2021-10-02 02:34:56 +01:00
|
|
|
# C# frontend
|
|
|
|
# upload docker
|
2021-10-02 02:24:33 +01:00
|
|
|
- name: upload_frontend
|
2021-10-02 02:34:56 +01:00
|
|
|
image: plugins/docker
|
2021-10-02 02:24:33 +01:00
|
|
|
when:
|
|
|
|
branch:
|
2021-10-02 02:34:56 +01:00
|
|
|
- master
|
2021-10-02 02:49:44 +01:00
|
|
|
settings:
|
2021-10-02 02:52:48 +01:00
|
|
|
context: ManagementPage
|
2021-10-02 02:24:33 +01:00
|
|
|
dockerfile: ManagementPage/ManagementPage/Dockerfile
|
2021-10-02 02:48:19 +01:00
|
|
|
repo: registry.jacknet.io/51m0n/environment-api
|
2021-10-02 02:24:33 +01:00
|
|
|
username: simon
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
|
|
|
registry: registry.jacknet.io
|
|
|
|
auto_tag: true
|
2021-10-02 02:34:56 +01:00
|
|
|
# upload docker
|
2021-10-02 02:24:33 +01:00
|
|
|
- name: upload_api
|
|
|
|
depends_on:
|
|
|
|
- build_api
|
|
|
|
image: plugins/docker
|
|
|
|
when:
|
|
|
|
branch:
|
2021-10-02 02:34:56 +01:00
|
|
|
- master
|
2021-10-02 02:24:33 +01:00
|
|
|
settings:
|
|
|
|
context: Api
|
|
|
|
dockerfile: Api/Dockerfile
|
2021-10-02 02:48:19 +01:00
|
|
|
repo: registry.jacknet.io/51m0n/environment-api
|
2021-10-02 02:24:33 +01:00
|
|
|
username: simon
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
|
|
|
registry: registry.jacknet.io
|
|
|
|
auto_tag: true
|
|
|
|
# upload firmware blob
|
2021-10-02 03:01:01 +01:00
|
|
|
- name: upload_esp
|
|
|
|
image: plugins/gitea-release
|
|
|
|
depends_on:
|
2021-10-02 03:02:16 +01:00
|
|
|
- build_esp
|
2021-10-02 03:01:01 +01:00
|
|
|
# This step is only run when a branch is tagged in Gitea.
|
|
|
|
when:
|
2021-10-02 03:20:25 +01:00
|
|
|
event:
|
|
|
|
- tag
|
2021-10-02 03:01:01 +01:00
|
|
|
settings:
|
|
|
|
base_url: https://git.jacknet.io
|
|
|
|
api_key:
|
|
|
|
from_secret: gitea_token
|
|
|
|
files:
|
|
|
|
- ESP-Temp-Humidity\.pio\build\esp07\firmware.bin
|
|
|
|
checksum:
|
|
|
|
- sha1
|