ModeratorElection/.gitlab-ci.yml

71 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2024-07-05 06:35:48 +00:00
stages:
2024-07-12 11:28:46 +00:00
# - test
2024-07-22 07:02:03 +00:00
# - buildjar
2024-07-12 11:22:55 +00:00
- buildimage
2024-07-11 19:54:15 +00:00
# - publish
2024-07-09 08:40:04 +00:00
2024-07-18 09:15:59 +00:00
variables:
CACHE_FALLBACK_KEY: fallback-key
.img: &img
2024-07-09 11:31:16 +00:00
image: openjdk:22-jdk-slim
2024-07-09 12:38:56 +00:00
cache:
- key: ${CI_COMMIT_REF_SLUG}
2024-07-18 09:15:59 +00:00
fallback_keys:
- cache-$CI_DEFAULT_BRANCH
- cache-default
2024-07-09 12:38:56 +00:00
- paths:
2024-07-11 19:54:15 +00:00
- /var/cache/apt
2024-07-09 12:38:56 +00:00
- .gradle/wrapper
- .gradle/caches
2024-07-11 19:54:15 +00:00
before_script:
- echo "___________________START_before_script________________________"
- echo ${CI_COMMIT_REF_SLUG}
- apt-get update && apt-get -qqy upgrade
2024-07-09 12:38:56 +00:00
2024-07-12 11:28:46 +00:00
#test:
# <<: *img
# stage: test
# script:
# - ./gradlew test
2024-07-22 07:02:03 +00:00
#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
2024-07-05 06:35:48 +00:00
2024-07-12 11:22:55 +00:00
buildimage:
2024-07-12 11:28:46 +00:00
stage: buildimage
2024-07-12 11:22:55 +00:00
image: docker:latest
services:
- docker:dind
2024-07-22 07:02:03 +00:00
cache:
- key: ${CI_COMMIT_REF_SLUG}
2024-07-22 07:03:14 +00:00
# dependencies:
# - buildjar
2024-07-12 11:22:55 +00:00
before_script:
- echo "---------- BEFORE -------------"
2024-07-26 08:40:40 +00:00
# - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin
- docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASSWORD
2024-07-12 11:22:55 +00:00
script:
- export DOCKER_BUILDKIT=1
2024-07-25 14:12:18 +00:00
- docker build --tag=$DOCKERHUB_USER/moderator-election-vaadin_fullstack:latest --target=ci-image-stage --build-arg BUILDKIT_INLINE_CACHE=1 .
2024-07-25 13:38:31 +00:00
- docker push $DOCKERHUB_USER/moderator-election-vaadin_fullstack
2024-07-22 07:02:03 +00:00
2024-07-11 19:56:35 +00:00
# stage: image
# script:
2024-07-11 19:54:15 +00:00
2024-07-11 19:56:35 +00:00
#publish:
# stage: publish
2024-07-12 11:28:46 +00:00
#- export IMAGE_DOCKERHUB_USER=$DOCKERHUB_USER
#- export IMAGE_DOCKERHUB_PASSWORD=$DOCKERHUB_PASSWORD