Commit 4ef73e16 authored by Administrator's avatar Administrator

Update .gitlab-ci.yml

parent ae8ff43d
Pipeline #395 failed
......@@ -4,40 +4,35 @@ variables:
CI_REGISTRY: "pg-registry.altimetrik.com"
CI_REGISTRY_IMAGE: "pg-registry.altimetrik.com/playground"
image: docker:latest
services:
- docker:dind
cache:
paths:
- .m2/
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build:
stage: build
stages:
- pipeline
- Test
- ImagePrune
- Buildimage
- Dockerizing
- Deploy
ImagePrune:
stage: ImagePrune
script:
- docker rm -f $CI_PROJECT_NAME
pipeline:
stage: pipeline
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker tag docker:latest "$CI_REGISTRY_IMAGE/$CI_PROJECT_NAME:latest"
- docker push "$CI_REGISTRY_IMAGE/$CI_PROJECT_NAME:latest"
- 'mvn clean install'
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE .
- docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE/$CI_PROJECT_NAME
- docker push $CI_REGISTRY_IMAGE/$CI_PROJECT_NAME
- docker run --name $CI_PROJECT_NAME -d -p 8043:8043 $CI_REGISTRY_IMAGE/$CI_PROJECT_NAME .
#sonar:
# stage: test
# script:
# - mvn --batch-mode verify sonar:sonar -Dsonar.exclusions="pom.xml" -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN
sonar:
stage: Test
script:
- mvn test
deploy:
stage: deploy
script:
- docker pull "$CI_REGISTRY_IMAGE/$CI_PROJECT_NAME:latest"
- docker run -d "$CI_REGISTRY_IMAGE/$CI_PROJECT_NAME:latest"
only:
- master
- master
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment