Made "dev-" tag to be automatically pushed instead of the version for testing, which will now be manual
This commit is contained in:
@@ -5,14 +5,12 @@ stages:
|
|||||||
- Build Variants
|
- Build Variants
|
||||||
- Push Images
|
- Push Images
|
||||||
|
|
||||||
build-base:
|
0-build-base:
|
||||||
stage: Build Base
|
stage: Build Base
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- ./images/
|
- ./images/
|
||||||
except:
|
|
||||||
- pushes
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
before_script:
|
before_script:
|
||||||
@@ -21,7 +19,7 @@ build-base:
|
|||||||
- docker build --pull --build-arg "GRAV_VERSION=$GRAV_VERSION" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
|
- docker build --pull --build-arg "GRAV_VERSION=$GRAV_VERSION" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
|
||||||
- docker save --output "./images/$CI_COMMIT_SHORT_SHA.tar" "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
|
- docker save --output "./images/$CI_COMMIT_SHORT_SHA.tar" "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
|
||||||
|
|
||||||
build-git:
|
0-build-git:
|
||||||
stage: Build Variants
|
stage: Build Variants
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
@@ -29,8 +27,6 @@ build-git:
|
|||||||
- ./images/
|
- ./images/
|
||||||
dependencies:
|
dependencies:
|
||||||
- build-base
|
- build-base
|
||||||
except:
|
|
||||||
- pushes
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
before_script:
|
before_script:
|
||||||
@@ -39,15 +35,31 @@ build-git:
|
|||||||
- docker build --build-arg "CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA" -f ./variants/Dockerfile-git -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-git" .
|
- docker build --build-arg "CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA" -f ./variants/Dockerfile-git -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-git" .
|
||||||
- docker save --output "./images/$CI_COMMIT_SHORT_SHA-git.tar" "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-git"
|
- docker save --output "./images/$CI_COMMIT_SHORT_SHA-git.tar" "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-git"
|
||||||
|
|
||||||
push-version:
|
0-push-dev:
|
||||||
stage: Push Images
|
stage: Push Images
|
||||||
dependencies:
|
dependencies:
|
||||||
- build-base
|
- build-base
|
||||||
- build-git
|
- build-git
|
||||||
except:
|
|
||||||
- pushes
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
before_script:
|
||||||
|
- docker load --input "./images/$CI_COMMIT_SHORT_SHA.tar"
|
||||||
|
- docker load --input "./images/$CI_COMMIT_SHORT_SHA-git.tar"
|
||||||
|
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin
|
||||||
|
script:
|
||||||
|
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" "$CI_REGISTRY_IMAGE:dev-$GRAV_VERSION"
|
||||||
|
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-git" "$CI_REGISTRY_IMAGE:dev-$GRAV_VERSION-git"
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:dev-$GRAV_VERSION"
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:dev-$GRAV_VERSION-git"
|
||||||
|
|
||||||
|
1-push-version:
|
||||||
|
stage: Push Images
|
||||||
|
dependencies:
|
||||||
|
- build-base
|
||||||
|
- build-git
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
when: manual
|
||||||
before_script:
|
before_script:
|
||||||
- docker load --input "./images/$CI_COMMIT_SHORT_SHA.tar"
|
- docker load --input "./images/$CI_COMMIT_SHORT_SHA.tar"
|
||||||
- docker load --input "./images/$CI_COMMIT_SHORT_SHA-git.tar"
|
- docker load --input "./images/$CI_COMMIT_SHORT_SHA-git.tar"
|
||||||
@@ -58,13 +70,11 @@ push-version:
|
|||||||
- docker push "$CI_REGISTRY_IMAGE:$GRAV_VERSION"
|
- docker push "$CI_REGISTRY_IMAGE:$GRAV_VERSION"
|
||||||
- docker push "$CI_REGISTRY_IMAGE:$GRAV_VERSION-git"
|
- docker push "$CI_REGISTRY_IMAGE:$GRAV_VERSION-git"
|
||||||
|
|
||||||
push-latest:
|
2-push-latest:
|
||||||
stage: Push Images
|
stage: Push Images
|
||||||
dependencies:
|
dependencies:
|
||||||
- build-base
|
- build-base
|
||||||
- build-git
|
- build-git
|
||||||
except:
|
|
||||||
- pushes
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
when: manual
|
when: manual
|
||||||
|
|||||||
Reference in New Issue
Block a user