From c4c79e69f29c09df35b3a28827d2cd7e4e7ac07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Suzanne=20Dup=C3=A9ron?= Date: Thu, 20 Feb 2020 16:52:07 +0100 Subject: [PATCH] Run dev pipeline for *-run-dev branches: fix "docker push" to the next-attempt tag --- .gitlab-ci.yml | 4 ++-- scripts/build_docker_image.sh | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c003fd77..b3deaa2d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -121,7 +121,7 @@ build-current-docker-image: - build-and-package-debian-10 <<: *docker script: - - sh scripts/build_docker_image.sh + - sh scripts/build_docker_image.sh next - sh scripts/test_cli.sh only: - merge_requests @@ -134,7 +134,7 @@ build-and-publish-latest-docker-image: dependencies: - build-and-package-debian-10 script: - - sh scripts/build_docker_image.sh + - sh scripts/build_docker_image.sh $(if test "$CI_COMMIT_REF_NAME" = "dev"; then echo next; else echo next-attempt; fi) - sh scripts/test_cli.sh - echo ${LIGO_REGISTRY_PASSWORD} | docker login -u ${LIGO_REGISTRY_USER} --password-stdin - docker push ${LIGO_REGISTRY_IMAGE_BUILD:-ligolang/ligo}:$(if test "$CI_COMMIT_REF_NAME" = "dev"; then echo next; else echo next-attempt; fi) diff --git a/scripts/build_docker_image.sh b/scripts/build_docker_image.sh index 260a530c7..3934417a9 100755 --- a/scripts/build_docker_image.sh +++ b/scripts/build_docker_image.sh @@ -1,3 +1,9 @@ #!/bin/sh set -e -docker build -t "${LIGO_REGISTRY_IMAGE_BUILD:-ligolang/ligo}:next" -f ./docker/distribution/debian/distribute.Dockerfile . \ No newline at end of file + +if test $# -ne 1 || test "x$1" = "-h" -o "x$1" = "x--help"; then + echo "Usage: build_docker_image.sh TAG_NAME" + exit 1 +fi + +docker build -t "${LIGO_REGISTRY_IMAGE_BUILD:-ligolang/ligo}:$1" -f ./docker/distribution/debian/distribute.Dockerfile .