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