diff options
author | 2018-11-16 12:28:59 +0000 | |
---|---|---|
committer | 2018-11-16 12:28:59 +0000 | |
commit | 433871f52e5af50234b65ba35d198f907ef5565f (patch) | |
tree | 28abdf83ddef247a661089794fcb6d988cbbc7fa | |
parent | Azure: I hate bash. (diff) |
Azure: Finish deployment; skip if PR
GitLab: Remove deployment step
-rw-r--r-- | .gitlab-ci.yml | 10 | ||||
-rw-r--r-- | azure-pipelines.yml | 4 | ||||
-rw-r--r-- | scripts/deploy-azure.sh | 10 |
3 files changed, 8 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f7aee8165..44126ded9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,13 +26,3 @@ test: - python -m flake8 - ls /root/.cache/ -build: - tags: - - docker - - services: - - docker:dind - - stage: build - script: - - sh scripts/deploy.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bce6dbce4..534742f4f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,7 +9,7 @@ variables: jobs: - job: test - displayName: 'Lint and test' + displayName: 'Lint & Test' pool: vmImage: 'Ubuntu 16.04' @@ -38,7 +38,7 @@ jobs: displayName: 'Run linter' - job: build - displayName: 'Build containers' + displayName: 'Build Containers' dependsOn: 'test' steps: diff --git a/scripts/deploy-azure.sh b/scripts/deploy-azure.sh index 4df5cb0fc..659a297bf 100644 --- a/scripts/deploy-azure.sh +++ b/scripts/deploy-azure.sh @@ -1,7 +1,9 @@ #!/bin/bash -# Build and deploy on master branch -if [[ $BUILD_SOURCEBRANCHNAME == 'master' ]]; then +if [[ ]] + +# Build and deploy on master branch, only if not a pull request +if [[ $BUILD_SOURCEBRANCHNAME == 'master' ]] && [[ -z "${SYSTEM_PULLREQUEST_PULLREQUESTID}" ]]; then changed_lines=$(git diff HEAD~1 HEAD docker/base.Dockerfile | wc -l) if [ $changed_lines != '0' ]; then @@ -22,8 +24,8 @@ if [[ $BUILD_SOURCEBRANCHNAME == 'master' ]]; then 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 |