Commit 4ef73e16 authored by Administrator's avatar Administrator

Update .gitlab-ci.yml

parent ae8ff43d
Pipeline #395 failed
...@@ -4,40 +4,35 @@ variables: ...@@ -4,40 +4,35 @@ variables:
CI_REGISTRY: "pg-registry.altimetrik.com" CI_REGISTRY: "pg-registry.altimetrik.com"
CI_REGISTRY_IMAGE: "pg-registry.altimetrik.com/playground" CI_REGISTRY_IMAGE: "pg-registry.altimetrik.com/playground"
stages:
- pipeline
image: docker:latest - Test
- ImagePrune
services: - Buildimage
- docker:dind - Dockerizing
- Deploy
cache: ImagePrune:
paths: stage: ImagePrune
- .m2/ script:
- docker rm -f $CI_PROJECT_NAME
before_script: pipeline:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY stage: pipeline
build:
stage: build
script: script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" . - 'mvn clean install'
- docker tag docker:latest "$CI_REGISTRY_IMAGE/$CI_PROJECT_NAME:latest" - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push "$CI_REGISTRY_IMAGE/$CI_PROJECT_NAME:latest" - 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: sonar:
# stage: test stage: Test
# script: script:
# - mvn --batch-mode verify sonar:sonar -Dsonar.exclusions="pom.xml" -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN - 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: 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