gitlab-notification/.gitlab-ci.yml

63 lines
1.5 KiB
YAML

stages:
- build
- deploy
build-develop:
image: maven:3.8.6-eclipse-temurin-17
stage: build
variables:
MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository"
only:
- develop
except:
- tags
script:
- 'mvn -U clean package'
artifacts:
paths:
- gitlab-app/target/gitlab-notification.jar
docker-build-develop:
image: upagge/docker-buildx:latest
stage: deploy
only:
- develop
except:
- tags
services:
- docker:dind
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin
script:
- docker buildx create --use
- docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$CI_REGISTRY_IMAGE:develop" .
build-release:
image: maven:3.8.6-eclipse-temurin-17
stage: build
variables:
MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository"
only:
- /^v.*$/
except:
- branches
script:
- 'mvn -U clean package'
artifacts:
paths:
- gitlab-app/target/gitlab-notification.jar
docker-build-release:
image: upagge/docker-buildx:latest
stage: deploy
only:
- /^v.*$/
except:
- branches
services:
- docker:dind
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin
script:
- docker buildx create --use
- docker buildx build --push --platform linux/amd64,linux/arm64/v8 -t "$CI_REGISTRY_IMAGE:latest" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" .