Try to trigger my-apps pipeline
This commit is contained in:
parent
75e6939d82
commit
767dbf35e9
@ -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
|
||||
- |
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user