Attempt to speed up build time by pulling the old image

This commit is contained in:
Abel Luck 2022-11-30 15:57:52 +00:00
parent 93bdb5888e
commit 5ecb68f2e7

View file

@ -26,6 +26,8 @@ build-test:
stage: build stage: build
script: script:
- echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
# speed up build time by pulling the old image
- docker pull registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:main
- docker build -t $UNIQUE_IMAGE . - docker build -t $UNIQUE_IMAGE .
- docker push $UNIQUE_IMAGE - docker push $UNIQUE_IMAGE
- docker run --entrypoint /test $UNIQUE_IMAGE - docker run --entrypoint /test $UNIQUE_IMAGE
@ -38,6 +40,8 @@ build:
stage: build stage: build
script: script:
- echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com - echo $CI_BUILD_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
# speed up build time by pulling the old image
- docker pull registry.gitlab.com/$CI_PROJECT_NAMESPACE/${CI_PROJECT_NAME}:main
- docker build --no-cache -t $UNIQUE_IMAGE . - docker build --no-cache -t $UNIQUE_IMAGE .
- docker push $UNIQUE_IMAGE - docker push $UNIQUE_IMAGE
- docker tag $UNIQUE_IMAGE $REF_IMAGE - docker tag $UNIQUE_IMAGE $REF_IMAGE