From 767dbf35e9a823d1456ab637930380196165f8ab Mon Sep 17 00:00:00 2001 From: dvirlabs <114520947+dvirlabs@users.noreply.github.com> Date: Sun, 15 Jun 2025 19:55:00 +0300 Subject: [PATCH] Try to trigger my-apps pipeline --- .woodpecker.yaml | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 0598b44..b4066cd 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -3,9 +3,9 @@ steps: name: Build & Push Frontend image: woodpeckerci/plugin-kaniko when: - event: [ push, pull_request, tag, manual ] # 👈 allow manual run + event: [ push, pull_request, tag ] path: - include: [ frontend/** ] # 👈 filter for auto-trigger + include: [ frontend/** ] settings: registry: harbor.dvirlabs.com repo: my-apps/labmap-frontend @@ -23,7 +23,7 @@ steps: name: Build & Push Backend image: woodpeckerci/plugin-kaniko when: - event: [ push, pull_request, tag, manual ] + event: [ push, pull_request, tag ] path: include: [ backend/** ] settings: @@ -39,27 +39,23 @@ steps: password: from_secret: DOCKER_PASSWORD - update-values: - name: Update my-apps image tag - image: alpine + trigger-my-apps: + name: Trigger my-apps pipeline + image: curlimages/curl when: - branch: master - event: push - environment: - GIT_SSH_COMMAND: 'ssh -i /root/.ssh/id_rsa -o StrictHostKeyChecking=no' - GIT_DEPLOY_KEY: - from_secret: GIT_DEPLOY_KEY + event: [ push ] commands: - - apk add --no-cache git openssh yq - - mkdir -p ~/.ssh - - echo "$GIT_DEPLOY_KEY" > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - - git config --global user.name "Woodpecker Bot" - - git config --global user.email "ci@dvirlabs.com" - - git clone git@192.168.10.242:dvirlabs/my-apps.git - - cd my-apps/manifests/labmap - - yq e '.image.frontend.tag = "${CI_COMMIT_SHA:0:7}"' -i values.yaml - - yq e '.image.backend.tag = "${CI_COMMIT_SHA:0:7}"' -i values.yaml - - git add values.yaml - - git commit -m "Update labmap image tags to ${CI_COMMIT_SHA:0:7}" || echo "No changes to commit" - - git push origin master \ No newline at end of file + - | + curl -X POST https://woodpecker.dvirlabs.com/api/repos/dvirlabs/my-apps/builds \ + -H "Authorization: Bearer ${WOODPECKER_TOKEN}" \ + -H "Content-Type: application/json" \ + -d '{ + "branch": "master", + "envs": { + "APP_NAME": "labmap", + "IMAGE_TAG": "'${CI_COMMIT_SHA:0:7}'" + } + }' + secrets: + from_secret: + - WOODPECKER_TOKEN