forked from Lumeer/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-trigger.sh
executable file
·19 lines (16 loc) · 1.01 KB
/
docker-trigger.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
VERSION=$(git log --pretty=format:'%h' -n 1)
echo $CONTENT_TYPE $VERSION
if [ "x$TRAVIS_PULL_REQUEST" = "xfalse" -o -z "$TRAVIS_PULL_REQUEST" ]; then
if [ "x$TRAVIS_BRANCH" = "xdevel" ]; then
echo Trigger devel rebuild
curl -X POST -is -u "${BB_AUTH_STRING}" -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/lumeer/app-devel-v2/pipelines/ -d "$(sed 's/\$VERSION/'"$VERSION"'/' < docker-pipeline-request.txt)"
fi
if [ "x$TRAVIS_BRANCH" = "xmaster" ]; then
echo Trigger master rebuild
curl -X POST -is -u "${BB_AUTH_STRING}" -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/lumeer/app-prod-v2/pipelines/ -d "$(sed 's/\$VERSION/'"$VERSION"'/' < docker-pipeline-request.txt)"
curl -X POST -is -u "${BB_AUTH_STRING}" -H "Content-Type: application/json" https://api.bitbucket.org/2.0/repositories/lumeer/app-pub-v2/pipelines/ -d "$(sed 's/\$VERSION/'"$VERSION"'/' < docker-pipeline-request.txt)"
fi
else
echo "Skipping trigger for PR"
fi