Fix ci & push image to Docker

This commit is contained in:
Mirco 2024-07-22 09:02:03 +02:00
parent c5d11bf760
commit 0caa0aabca

View file

@ -1,6 +1,6 @@
stages:
# - test
- buildjar
# - buildjar
- buildimage
# - publish
@ -29,22 +29,26 @@ variables:
# script:
# - ./gradlew test
buildjar:
<<: *img
stage: buildjar
script:
- ./gradlew clean build -Pvaadin.productionMode
artifacts:
name: "ModeratorElection"
paths:
- build/libs/ModeratorElection.jar
expire_in: 1 week
#buildjar:
# <<: *img
# stage: buildjar
# cache:
# - key: ${CI_COMMIT_REF_SLUG}
# script:
# - ./gradlew clean build -Pvaadin.productionMode
# artifacts:
# name: "ModeratorElection"
# paths:
# - build/libs/
# expire_in: 1 week
buildimage:
stage: buildimage
image: docker:latest
services:
- docker:dind
cache:
- key: ${CI_COMMIT_REF_SLUG}
dependencies:
- buildjar
before_script:
@ -52,12 +56,9 @@ buildimage:
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin
script:
- export DOCKER_BUILDKIT=1
- docker build --tag=moderator-election-vaadin_fullstack --target=ci-image-stage --build-arg BUILDKIT_INLINE_CACHE=1 .
artifacts:
name: "moderator-election-vaadin_fullstack"
paths:
- image/
expire_in: 1 week
- docker build --tag=latest --target=ci-image-stage --build-arg BUILDKIT_INLINE_CACHE=1 .
- docker push $CI_REGISTRY_USER/moderator-election-vaadin_fullstack
# stage: image
# script: