gitlab-notification/.gitlab-ci.yml

36 lines
837 B
YAML
Raw Normal View History

2022-01-26 10:59:40 +03:00
image: maven:3.8.4-openjdk-17
2022-01-26 10:56:18 +03:00
variables:
MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository"
stages:
- build
- deploy
build:
stage: build
only:
- /^\d+\.\d\.\d$/
except:
- branches
script:
- 'mvn -U clean package'
artifacts:
paths:
- gitlab-app/target/gitlab-notification.jar
docker-build-master:
image: docker:latest
stage: deploy
only:
2022-01-26 11:01:50 +03:00
- /^\d+\.\d\.\d$/
2022-01-26 10:56:18 +03:00
except:
2022-01-26 11:01:50 +03:00
- branches
2022-01-26 10:56:18 +03:00
services:
- docker:dind
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin
script:
2022-01-26 10:59:40 +03:00
- cd gitlab-app
2022-01-26 11:05:58 +03:00
- docker build --no-cache -f Dockerfile-linux -t "$CI_REGISTRY_IMAGE:latest" . -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
2022-01-26 10:56:18 +03:00
- docker push "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"