Commit f9985688073cf5dd0d69eec01de0797f6987359a

Patrick Steinhardt 2020-02-18T15:17:45

azure: docker: detect errors when building images The build step for our Docker images currently succeeds even if building the Docker image fails due to missing && chains in the build script. Fix this by adding them in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/azure-pipelines/docker.yml b/azure-pipelines/docker.yml
index 0e1988c..0f08857 100644
--- a/azure-pipelines/docker.yml
+++ b/azure-pipelines/docker.yml
@@ -13,9 +13,9 @@ steps:
     if [ -f /tmp/dockercache/${{parameters.docker.image}}.tar ]; then docker load < /tmp/dockercache/${{parameters.docker.image}}.tar; fi
   displayName: 'Load Docker cache'
 - script: |
-    cd $(Build.SourcesDirectory)/azure-pipelines/docker
-    docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} .
-    if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi
+    cd $(Build.SourcesDirectory)/azure-pipelines/docker &&
+    docker build -t libgit2/${{parameters.docker.image}} --build-arg BASE=${{parameters.docker.base}} -f ${{parameters.docker.image}} . &&
+    if [ ! -d /tmp/dockercache ]; then mkdir /tmp/dockercache; fi &&
     docker save libgit2/${{parameters.docker.image}} $(docker history -q libgit2/${{parameters.docker.image}} | grep -v '<missing>') > /tmp/dockercache/${{parameters.docker.image}}.tar
   displayName: 'Build Docker image'
 - task: docker@0