Try to build the frontend and the backend and see if its update

This commit is contained in:
dvirlabs 2025-06-16 23:36:38 +03:00
parent 9a4d812970
commit 6258127fb0
3 changed files with 33 additions and 7 deletions

View File

@ -39,11 +39,13 @@ steps:
password:
from_secret: DOCKER_PASSWORD
update-values:
name: Update my-apps image tag
update-values-frontend:
name: Update frontend tag in values.yaml
image: alpine:3.19
when:
event: [ push ]
path:
include: [ frontend/** ]
environment:
GIT_USERNAME:
from_secret: GIT_USERNAME
@ -53,9 +55,33 @@ steps:
- apk add --no-cache git yq
- git config --global user.name "woodpecker-bot"
- git config --global user.email "ci@dvirlabs.com"
- git clone https://$${GIT_USERNAME}:$${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/my-apps.git
- git clone "https://${GIT_USERNAME}:${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/my-apps.git"
- cd my-apps
- yq -i '.image.tag = "${CI_COMMIT_SHA:0:7}"' manifests/labmap/values.yaml
- yq -i '.frontend.tag = "${CI_COMMIT_SHA:0:7}"' manifests/labmap/values.yaml
- git add manifests/labmap/values.yaml
- "git commit -m 'labmap: update image tag to ${CI_COMMIT_SHA:0:7}' || echo 'No changes'"
- "git commit -m 'frontend: update tag to ${CI_COMMIT_SHA:0:7}' || echo 'No changes'"
- git push origin master
update-values-backend:
name: Update backend tag in values.yaml
image: alpine:3.19
when:
event: [ push ]
path:
include: [ backend/** ]
environment:
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_TOKEN:
from_secret: GIT_TOKEN
commands:
- apk add --no-cache git yq
- git config --global user.name "woodpecker-bot"
- git config --global user.email "ci@dvirlabs.com"
- git clone "https://${GIT_USERNAME}:${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/my-apps.git"
- cd my-apps
- yq -i '.backend.tag = "${CI_COMMIT_SHA:0:7}"' manifests/labmap/values.yaml
- git add manifests/labmap/values.yaml
- "git commit -m 'backend: update tag to ${CI_COMMIT_SHA:0:7}' || echo 'No changes'"
- git push origin master

View File

@ -24,7 +24,7 @@ DATA_FILE = "diagram.json"
@app.get("/")
def root():
return {"message": "Check if the server is running"}
return {"message": "Check if the backend is running"}
@app.get("/diagram/fetch")
def fetch_diagram():