gitlab-notification/.gitlab-ci.yml
2022-01-26 11:21:27 +03:00

36 lines
821 B
YAML

image: maven:3.8.4-openjdk-17
variables:
MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository"
stages:
- build
- deploy
build:
stage: build
only:
- /^v.*$/
except:
- branches
script:
- 'mvn -U clean package'
artifacts:
paths:
- gitlab-app/target/gitlab-notification.jar
docker-build-master:
image: docker: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:
- cd gitlab-app
- docker build --no-cache -f Dockerfile-linux -t "$CI_REGISTRY_IMAGE:latest" . -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker push "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"