aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/deploy-azure.sh
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-11-16 11:36:02 +0000
committerGravatar Gareth Coles <[email protected]>2018-11-16 11:36:02 +0000
commit3ece07a0f25ee4f11d2422a0ab8241212026e778 (patch)
tree47199c2ceb782551fecc5759d5a8ac5c4a82b951 /scripts/deploy-azure.sh
parentAzure: Build and push container (diff)
Azure: Move branch trigger to Docker build script
Diffstat (limited to 'scripts/deploy-azure.sh')
-rw-r--r--scripts/deploy-azure.sh37
1 files changed, 21 insertions, 16 deletions
diff --git a/scripts/deploy-azure.sh b/scripts/deploy-azure.sh
index f18407c8b..4df5cb0fc 100644
--- a/scripts/deploy-azure.sh
+++ b/scripts/deploy-azure.sh
@@ -1,24 +1,29 @@
#!/bin/bash
-changed_lines=$(git diff HEAD~1 HEAD docker/base.Dockerfile | wc -l)
+# Build and deploy on master branch
+if [[ $BUILD_SOURCEBRANCHNAME == 'master' ]]; then
+ changed_lines=$(git diff HEAD~1 HEAD docker/base.Dockerfile | wc -l)
-if [ $changed_lines != '0' ]; then
- echo "base.Dockerfile was changed"
+ if [ $changed_lines != '0' ]; then
+ echo "base.Dockerfile was changed"
- echo "Building bot base"
- docker build -t pythondiscord/bot-base:latest -f docker/base.Dockerfile .
+ echo "Building bot base"
+ docker build -t pythondiscord/bot-base:latest -f docker/base.Dockerfile .
- echo "Pushing image to Docker Hub"
- docker push pythondiscord/bot-base:latest
-else
- echo "base.Dockerfile was not changed, not building"
-fi
+ echo "Pushing image to Docker Hub"
+ docker push pythondiscord/bot-base:latest
+ else
+ echo "base.Dockerfile was not changed, not building"
+ fi
-echo "Building image"
-docker build -t pythondiscord/bot:latest -f docker/bot.Dockerfile .
+ echo "Building image"
+ docker build -t pythondiscord/bot:latest -f docker/bot.Dockerfile .
-echo "Pushing image"
-docker push pythondiscord/bot:latest
+ echo "Pushing image"
+ docker push pythondiscord/bot:latest
-#echo "Deploying container"
-#curl -H "token: $AUTODEPLOY_TOKEN" $AUTODEPLOY_WEBHOOK
+ # echo "Deploying container"
+ # curl -H "token: $AUTODEPLOY_TOKEN" $AUTODEPLOY_WEBHOOK
+else
+ echo "Skipping deploy"
+fi \ No newline at end of file