use promotion event to chain pipelines
This commit is contained in:
parent
2d45d5b368
commit
698596a32f
@ -31,12 +31,12 @@ steps:
|
||||
- echo $REGISTRY_PWD | docker login -u drone --password-stdin registry.jfmonty2.com
|
||||
- docker pull registry.jfmonty2.com/drone-server:latest
|
||||
- IMAGE_COMMIT_HASH=$(docker image inspect -f '{{ .Config.Labels.drone_commit_hash }}' registry.jfmonty2.com/drone-server:latest)
|
||||
# compare
|
||||
# compare and trigger CI if necessary
|
||||
- |
|
||||
if [[ $COMMIT_HASH != $IMAGE_COMMIT_HASH ]]; then
|
||||
echo 'Updates available, triggering build pipeline.'
|
||||
curl -X POST -H "Authorization: Bearer $DRONE_API_TOKEN" \
|
||||
https://drone.jfmonty2.com/api/repos/jfmonty2/drone/builds
|
||||
https://drone.jfmonty2.com/api/repos/jfmonty2/drone/builds/$DRONE_BUILD_NUMBER/promote?target=server-build
|
||||
else
|
||||
echo 'Image is already up to date.'
|
||||
fi
|
||||
@ -54,7 +54,9 @@ name: main
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- custom
|
||||
- promote
|
||||
target:
|
||||
server-build
|
||||
|
||||
steps:
|
||||
- name: prepare
|
||||
|
Loading…
x
Reference in New Issue
Block a user