Skip to content
Snippets Groups Projects
Commit de704ad5 authored by Matthew K Defenderfer's avatar Matthew K Defenderfer
Browse files

update build tagging

parent 1c794346
No related branches found
No related tags found
No related merge requests found
Pipeline #11962 failed with stages
in 6 minutes and 43 seconds
default: default:
before_script: before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
interruptible: true interruptible: true
stages: stages:
...@@ -28,7 +28,22 @@ get-cookie: ...@@ -28,7 +28,22 @@ get-cookie:
- cookies.txt - cookies.txt
expire_in: 5 minutes expire_in: 5 minutes
docker-build: build-latest:
stage: build
image: docker:latest
services:
- docker:dind
dependencies:
- get-cookie
script:
- echo "Building and tagging as latest"
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:latest .
- docker push $CONTAINER_IMAGE:latest
only:
- main
build-version:
stage: build stage: build
image: docker:latest image: docker:latest
services: services:
...@@ -36,7 +51,10 @@ docker-build: ...@@ -36,7 +51,10 @@ docker-build:
dependencies: dependencies:
- get-cookie - get-cookie
script: script:
- echo "Building and tagging as $CI_COMMIT_REF_NAME"
- docker pull $CI_REGISTRY_IMAGE:latest || true - docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest . - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME#v} .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - docker push $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME#v}
- docker push $CI_REGISTRY_IMAGE:latest only:
- tags
- /^v\d+\.\d+$/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment