-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdocker-trigger.sh
More file actions
executable file
·17 lines (15 loc) · 1.02 KB
/
docker-trigger.sh
File metadata and controls
executable file
·17 lines (15 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
VERSION=$(git log --pretty=format:'%h' -n 1)
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)" > /dev/null
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)" > /dev/null
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)" > /dev/null
fi
else
echo "Skipping trigger for PR"
fi