From 1d27e4841e7ddca0d7402063bb266eea8a9b8753 Mon Sep 17 00:00:00 2001 From: dvirlabs Date: Sun, 13 Jul 2025 05:20:15 +0300 Subject: [PATCH] Build backend and frontend and update the pipeline --- .woodpecker.yaml | 23 ++++++++++++++++++++--- backend/Dockerfile | 2 +- frontend/Dockerfile | 3 +-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 8df1d8b..2a80bcb 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -14,7 +14,7 @@ steps: context: frontend tags: - latest - - ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7} + - ${CI_COMMIT_TAG:-${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}} username: from_secret: DOCKER_USERNAME password: @@ -35,7 +35,7 @@ steps: context: backend tags: - latest - - ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7} + - ${CI_COMMIT_TAG:-${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}} username: from_secret: DOCKER_USERNAME password: @@ -85,7 +85,6 @@ 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" - cd my-apps - | TAG="${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}" @@ -94,3 +93,21 @@ steps: git add manifests/${CI_REPO_NAME}/values.yaml git commit -m "backend: update tag to $TAG" || echo "No changes" git push origin HEAD + + trigger-gitops-via-push: + name: Trigger apps-gitops via Git push + image: alpine/git + environment: + GIT_USERNAME: + from_secret: GIT_USERNAME + GIT_TOKEN: + from_secret: GIT_TOKEN + commands: | + 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/apps-gitops.git" + cd apps-gitops + echo "# trigger at $(date) by $${CI_REPO_NAME}" >> .trigger + git add .trigger + git commit -m "ci: trigger apps-gitops build" || echo "no changes" + git push origin HEAD diff --git a/backend/Dockerfile b/backend/Dockerfile index 8236346..dd90f49 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -9,4 +9,4 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] -EXPOSE 8000 +EXPOSE 8000 \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 62c649d..8fd2ac7 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -26,5 +26,4 @@ COPY 10-generate-env.sh /docker-entrypoint.d/10-generate-env.sh RUN dos2unix /docker-entrypoint.d/10-generate-env.sh && chmod +x /docker-entrypoint.d/10-generate-env.sh EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] - +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file