Set the update values stage to set the tag branchname-commithash

This commit is contained in:
dvirlabs 2025-06-18 04:19:00 +03:00
parent deb1fa13d3
commit 767b753f70
3 changed files with 7 additions and 19 deletions

View File

@ -14,13 +14,11 @@ steps:
context: frontend
tags:
- latest
- ${CI_COMMIT_SHA:0:7}
- ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
build-backend:
name: Build & Push Backend
@ -37,7 +35,6 @@ steps:
context: backend
tags:
- latest
- ${CI_COMMIT_SHA:0:7}
- ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
username:
from_secret: DOCKER_USERNAME
@ -61,19 +58,15 @@ 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
- |
if [ "$CI_COMMIT_BRANCH" = "develop" ]; then
TAG="develop-${CI_BUILD_NUMBER}"
else
TAG="${CI_COMMIT_SHA:0:7}"
fi
TAG="${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}"
echo "💡 Setting frontend tag to: $TAG"
yq -i ".frontend.tag = \"$TAG\"" manifests/labmap/values.yaml
git add manifests/labmap/values.yaml
git commit -m "frontend: update tag to $TAG" || echo "No changes"
git push origin master
git push origin HEAD
update-values-backend:
name: Update backend tag in values.yaml
@ -92,16 +85,12 @@ 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
- |
if [ "$CI_COMMIT_BRANCH" = "develop" ]; then
TAG="develop-${CI_BUILD_NUMBER}"
else
TAG="${CI_COMMIT_SHA:0:7}"
fi
TAG="${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}"
echo "💡 Setting backend tag to: $TAG"
yq -i ".backend.tag = \"$TAG\"" manifests/labmap/values.yaml
git add manifests/labmap/values.yaml
git commit -m "backend: update tag to $TAG" || echo "No changes"
git push origin master
git push origin HEAD

View File

@ -81,6 +81,5 @@ def list_icons():
return categories
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)

View File

@ -4,4 +4,4 @@ function App() {
return <Diagram />;
}
export default App;
export default App;