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 .