From ee09a87460096c1f9ba68a1615bc8859df86101a Mon Sep 17 00:00:00 2001 From: Indhu Kumar Date: Mon, 12 Oct 2020 23:51:27 -0700 Subject: [PATCH] Allow Nessie reruns by reusing images --- .github/workflows/nessie.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nessie.yaml b/.github/workflows/nessie.yaml index c72139f5548..284c729be59 100644 --- a/.github/workflows/nessie.yaml +++ b/.github/workflows/nessie.yaml @@ -64,8 +64,15 @@ jobs: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY_LAKEFS: lakefs run: | - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY_LAKEFS:${{ steps.version.outputs.tag }} --build-arg VERSION=${{ steps.version.outputs.tag }} . - docker push $ECR_REGISTRY/$ECR_REPOSITORY_LAKEFS:${{ steps.version.outputs.tag }} + set +e + describe_image="$( aws ecr describe-images --repository-name $ECR_REPOSITORY_LAKEFS --image-ids imageTag=${{ steps.version.outputs.tag }})" + if [ $? -eq 0 ]; then + echo "Image exists" + else + echo "Image doesn't exist" + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY_LAKEFS:${{ steps.version.outputs.tag }} --build-arg VERSION=${{ steps.version.outputs.tag }} . + docker push $ECR_REGISTRY/$ECR_REPOSITORY_LAKEFS:${{ steps.version.outputs.tag }} + fi run-system: name: Run latest lakeFS app