Unverified Commit 99df448f authored by Jorge Izquierdo Ciges's avatar Jorge Izquierdo Ciges Committed by GitHub
Browse files

Merge pull request #190 from EGA-archive/EE-1731

new gitlab pipeline for data API
parents d35cd2f2 43ab4295
Pipeline #123053 canceled with stages
in 16 minutes and 6 seconds
# Keep this file in sync with docker-compose.yml.
# Build JAVA applications using Apache Maven (http://maven.apache.org)
# For docker image tags see https://hub.docker.com/_/maven/
#
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
image: dockerhub.ebi.ac.uk/ega/ega-data-api-build-container:latest
# Add the service of docker in docker to allow us to compile the docker images
# https://docs.gitlab.com/runner/executors/kubernetes.html#using-dockerdind
services:
- name: docker:dind
alias: dataedge
## List of jobs:
stages:
- unitTest
- integrationTest
- imageBuild
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_NAME"'
cache:
paths:
- .m2/repository
variables:
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
TRAVIS_BUILD_DIR: $CI_PROJECT_DIR
## Diffent stages for the CICD of Data API
unitTest:
stage: unitTest
before_script:
- mvn install -DskipTests=true -P production -Dmaven.javadoc.skip=true -B -V -DskipDockerPush
script: mvn test
integrationTest:
stage: integrationTest
before_script:
- mvn install -DskipTests=true -P production -Dmaven.javadoc.skip=true -B -V -DskipDockerPush
# - sudo service postgresql stop
- mkdir -p /usr/local/share/ca-certificates/
- cp extras/certificate/rootCA.pem /usr/local/share/ca-certificates/CA.crt
- chmod 644 /usr/local/share/ca-certificates/CA.crt
- update-ca-certificates
- docker build -t ega-data-api/ega-dataedge --file Dockerfile.dataedge .
- docker build -t ega-data-api/ega-res --file Dockerfile.res .
- docker build -t ega-data-api/ega-keyserver --file Dockerfile.keyserver .
- docker build -t ega-data-api/ega-filedatabase --file Dockerfile.filedatabase .
- docker build -t ega-data-api/ega-postgres --file extras/postgresdb/Dockerfile .
- cd extras && source ./variables.sh
- docker-compose up -d
- sleep 90
- cd ../ega-data-api-it
script:
- mvn test "-Dkey.url=https://dataedge" "-Dfile.url=https://dataedge" "-Dres.url=https://dataedge" "-Ddataedge.url=https://dataedge"
imageBuild:
stage: imageBuild
only:
- master
before_script:
- mvn dependency:purge-local-repository install -DskipTests=true -P production -Dmaven.javadoc.skip=true -B -V -DskipDockerPush
script: ./extras/travis_push_docker_hub.sh
language: java
services: docker
jdk: oraclejdk8
dist: trusty
install:
# installing dependencies and skipping docker push
- mvn dependency:purge-local-repository install -DskipTests=true -P production -Dmaven.javadoc.skip=true -B -V -DskipDockerPush
cache:
directories:
- $HOME/.m2
stages:
- name: unit test
if: type IN (push, pull_request)
- name: integ test
if: type IN (push, pull_request)
- name: image build
if: type = push AND branch = master
jobs:
include:
- stage: unit test
script: mvn test
- stage: integ test
before_script:
- sudo service postgresql stop
- sudo mkdir -p /usr/local/share/ca-certificates/ca/
- sudo cp extras/certificate/rootCA.pem /usr/local/share/ca-certificates/ca/CA.crt
- sudo chmod 644 /usr/local/share/ca-certificates/ca/CA.crt
- sudo update-ca-certificates
- docker build -t ega-data-api/ega-dataedge --file Dockerfile.dataedge .
- docker build -t ega-data-api/ega-res --file Dockerfile.res .
- docker build -t ega-data-api/ega-keyserver --file Dockerfile.keyserver .
- docker build -t ega-data-api/ega-filedatabase --file Dockerfile.filedatabase .
- docker build -t ega-data-api/ega-postgres --file extras/postgresdb/Dockerfile .
- cd extras && source ./variables.sh
- docker-compose up -d
- sleep 90
- cd ../ega-data-api-it
script:
- mvn test
- stage: image build
script: ./extras/travis_push_docker_hub.sh
notifications:
email: false
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