Commit 3c0681e1 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Updated CI

parent 73d3182b
Pipeline #1835 passed with stages
in 1 minute and 46 seconds
...@@ -3,10 +3,18 @@ stages: ...@@ -3,10 +3,18 @@ stages:
- test - test
- deploy - deploy
build_gms_client: .gms_client:
stage: build
tags: tags:
- docker - docker
rules:
- if: '$CI_COMMIT_BRANCH != "master"'
when: never
- changes:
- gms-client/gms-client/*
build_gms_client:
extends: .gms_client
stage: build
script: script:
- cd gms-client/gms-client - cd gms-client/gms-client
- mvn clean package -DskipTests -DfinalName=gms-client - mvn clean package -DskipTests -DfinalName=gms-client
...@@ -15,28 +23,66 @@ build_gms_client: ...@@ -15,28 +23,66 @@ build_gms_client:
- gms-client/gms-client/target/gms-client.jar - gms-client/gms-client/target/gms-client.jar
- gms-client/gms-client/pom.xml - gms-client/gms-client/pom.xml
expire_in: 7 days expire_in: 7 days
only:
- master
test_gms_client: test_gms_client:
extends: .gms_client
stage: test
script:
- cd gms-client/gms-client
- mvn clean test
test_gms:
stage: test stage: test
tags: tags:
- docker - docker
image: git.ia2.inaf.it:5050/ia2/ia2-devops/maven-otj-pg-embedded
script: script:
- cd gms-client/gms-client - cd gms
- mvn clean test - mvn clean test
only: - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print "coverage=" 100*covered/instructions }' target/site/jacoco/jacoco.csv
- master coverage: '/coverage=\d+\.\d+/'
rules:
- if: '$CI_COMMIT_BRANCH != "master"'
when: never
- changes:
- gms/*
deploy_gms_client: deploy_gms_client:
extends: .gms_client
stage: deploy stage: deploy
tags:
- docker
script: script:
- mvn deploy:deploy-file - mvn deploy:deploy-file
-Dfile=gms-client/gms-client/target/gms-client.jar -Dfile=gms-client/gms-client/target/gms-client.jar
-DrepositoryId=ia2.snapshots -DrepositoryId=ia2.snapshots
-DpomFile=gms-client/gms-client/pom.xml -DpomFile=gms-client/gms-client/pom.xml
-Durl=${IA2_MVN_REPO_SNAPSHOTS} -Durl=${IA2_MVN_REPO_SNAPSHOTS}
only:
- master dockerize_db:
stage: deploy
tags:
- shell
script:
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- docker build -t "${CI_REGISTRY_IMAGE}/database" -f database/Dockerfile .
- docker push "${CI_REGISTRY_IMAGE}/database"
rules:
- if: '$CI_COMMIT_BRANCH != "master"'
when: never
- changes:
- database/*
- gms/src/main/resources/sql/*
dockerize_gms:
stage: deploy
tags:
- shell
script:
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- docker build -t "${CI_REGISTRY_IMAGE}" -f gms/Dockerfile .
- docker push "${CI_REGISTRY_IMAGE}"
rules:
- if: '$CI_COMMIT_BRANCH != "master"'
when: never
- changes:
- gms/*
- gms-ui/*
Supports Markdown
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