aboutsummaryrefslogtreecommitdiffstats
path: root/ci/push.yml
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2020-02-27 20:53:13 -0800
committerGravatar GitHub <[email protected]>2020-02-27 20:53:13 -0800
commit184da24f7dd94b90a5251ca8a54ee87c069f940c (patch)
treecac8d7d53e3e32e3f20125662ceef4604ab0303c /ci/push.yml
parentMerge pull request #62 from python-discord/bug/ci/61/python-symlink-not-resol... (diff)
parentCI: fix can_pull causing script to exit with code 1 (diff)
Merge pull request #54 from python-discord/ci-improvements
CI Improvements
Diffstat (limited to 'ci/push.yml')
-rw-r--r--ci/push.yml39
1 files changed, 39 insertions, 0 deletions
diff --git a/ci/push.yml b/ci/push.yml
new file mode 100644
index 0000000..9449df0
--- /dev/null
+++ b/ci/push.yml
@@ -0,0 +1,39 @@
+steps:
+ # Always build this image unless it's for a pull request.
+ - script: |
+ docker build \
+ -f docker/Dockerfile \
+ -t pythondiscord/snekbox:latest \
+ .
+ displayName: 'Build Final Image'
+ condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
+
+ # Push images only after they've all successfully been built.
+ - script: docker push pythondiscord/snekbox-base:latest
+ displayName: 'Push Base Image'
+ condition: >
+ and(
+ succeeded(),
+ ne(variables['Build.Reason'], 'PullRequest'),
+ ne(variables.BASE_PULL, 'True'),
+ or(
+ eq(variables.BASE_CHANGED, 'True'),
+ eq(variables.VENV_CHANGED, 'True')
+ )
+ )
+
+ - script: docker push pythondiscord/snekbox-venv:latest
+ displayName: 'Push Virtual Environment Image'
+ condition: >
+ and(
+ succeeded(),
+ ne(variables['Build.Reason'], 'PullRequest'),
+ or(
+ eq(variables.BASE_CHANGED, 'True'),
+ eq(variables.VENV_CHANGED, 'True')
+ )
+ )
+
+ - script: docker push pythondiscord/snekbox:latest
+ displayName: 'Push Final Image'
+ condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))