Le Pipeline CI supprime automatiquement l'image Docker du runner pour éviter de polluer son registre d'images.
This commit is contained in:
parent
63c7c35a73
commit
0efef85949
|
@ -11,10 +11,10 @@ stages:
|
|||
- test
|
||||
- package
|
||||
- deploy
|
||||
|
||||
|
||||
.only-master:
|
||||
only:
|
||||
- master
|
||||
- master
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -48,12 +48,12 @@ package:
|
|||
script:
|
||||
- docker run --name $PACKAGE_CONTAINER_NAME $CI_REGISTRY_IMAGE_GRADLE gradle bootJar
|
||||
- docker cp $PACKAGE_CONTAINER_NAME:/usr/src/cre/build/libs/ColorRecipesExplorer.jar $ARTIFACT_NAME.jar
|
||||
- docker rm $PACKAGE_CONTAINER_NAME
|
||||
- docker build -t $CI_REGISTRY_IMAGE_BACKEND --build-arg JDK_VERSION=$JDK_VERSION --build-arg PORT=$PORT --build-arg ARTIFACT_NAME=$ARTIFACT_NAME .
|
||||
- docker push $CI_REGISTRY_IMAGE_BACKEND
|
||||
after_script:
|
||||
- docker stop $PACKAGE_CONTAINER_NAME || true
|
||||
- docker rm $PACKAGE_CONTAINER_NAME || true
|
||||
- docker image remove $CI_REGISTRY_IMAGE_GRADLE || true # Remove the gradle image from the runner so it doesn't pollute the runner's image registry
|
||||
artifacts:
|
||||
paths:
|
||||
- $ARTIFACT_NAME.jar
|
||||
|
|
Loading…
Reference in New Issue