aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2019-01-13 11:35:24 +0100
committerGravatar Johannes Christ <[email protected]>2019-01-13 11:35:24 +0100
commite9efae44711be6377c6678c2d2522265fe7fcb7d (patch)
tree500d02acdfeec808c2ce6c887cc8f5ae83b92a75
parentDrop `--update` flag since `--no-cache` implies it. (diff)
Build and push Django branch image on Azure.
-rw-r--r--azure-pipelines.yml2
-rw-r--r--scripts/deploy-azure.sh29
2 files changed, 5 insertions, 26 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 0f968e618..a6a633918 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -54,7 +54,5 @@ jobs:
- task: ShellScript@2
displayName: 'Build and deploy containers'
-
inputs:
scriptPath: scripts/deploy-azure.sh
- args: '$(AUTODEPLOY_TOKEN) $(AUTODEPLOY_WEBHOOK)'
diff --git a/scripts/deploy-azure.sh b/scripts/deploy-azure.sh
index 6b3dea508..af69ab46b 100644
--- a/scripts/deploy-azure.sh
+++ b/scripts/deploy-azure.sh
@@ -2,30 +2,11 @@
cd ..
-# Build and deploy on master branch, only if not a pull request
-if [[ ($BUILD_SOURCEBRANCHNAME == 'master') && ($SYSTEM_PULLREQUEST_PULLREQUESTID == '') ]]; then
- changed_lines=$(git diff HEAD~1 HEAD docker/base.Dockerfile | wc -l)
-
- 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 "Pushing image to Docker Hub"
- docker push pythondiscord/bot-base:latest
- else
- echo "base.Dockerfile was not changed, not building"
- fi
-
+# Build and deploy on django branch, only if not a pull request
+if [[ ($BUILD_SOURCEBRANCHNAME == 'django') && ($SYSTEM_PULLREQUEST_PULLREQUESTID == '') ]]; then
echo "Building image"
- docker build -t pythondiscord/bot:latest -f docker/bot.Dockerfile .
+ docker build -t pythondiscord/bot:django .
echo "Pushing image"
- docker push pythondiscord/bot:latest
-
- echo "Deploying container"
- curl -H "token: $1" $2
-else
- echo "Skipping deploy"
-fi \ No newline at end of file
+ docker push pythondiscord/bot:django
+fi