Unverified Commit efab47ea authored by Anand Mohan's avatar Anand Mohan Committed by GitHub
Browse files

Merge pull request #197 from EGA-archive/feature/EE-1785

Add docker push stage in gitlab ci
parents 0bbe626f df088cd2
Pipeline #126604 passed with stages
in 23 minutes and 24 seconds
......@@ -32,9 +32,8 @@ variables:
## 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
script:
- mvn test
integrationTest:
stage: integrationTest
......@@ -59,8 +58,7 @@ integrationTest:
imageBuild:
stage: imageBuild
script:
- mvn clean install "-DdockerRegistry=$CI_REGISTRY_IMAGE" "-Dimage.version=$CI_COMMIT_TAG" -P production -DskipTests
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
- tags
\ No newline at end of file
# Repository for the EGA DATA project
[![Build Status](https://travis-ci.org/EGA-archive/ega-data-api.svg?branch=master)](https://travis-ci.org/EGA-archive/ega-data-api)
The EGA Data API is a REST API providing secure and controlled access to the archive. Access is secured by OAuth2 Bearer tokens issued from the the EGA OpenID Connect AAI. The EGA Data API implements the GA4GH Streaming/htsget API as it is specified here http://samtools.github.io/hts-specs/htsget.html. The API supports BAM, CRAM, VCF, BCF files.
......
#!/usr/bin/env bash
OSS_MODULES=( ega-data-api-netflix/ega-data-api-config
ega-data-api-netflix/ega-data-api-eureka )
EGA_API_MODULES=( ega-data-api-dataedge
ega-data-api-filedatabase
ega-data-api-htsget
ega-data-api-key
ega-data-api-res )
push_images () {
tag=$1
if [ "$2" == "oss" ]; then
maven_push "$tag" "${OSS_MODULES[@]}"
elif [ "$2" == "api" ]; then
maven_push "$tag" "${EGA_API_MODULES[@]}"
else
printf 'Option not recognized.'
exit 1
fi
}
maven_push () {
tag=$1
shift
modules=( "$@" )
for module in "${modules[@]}"; do
printf 'Pushing EGA-DATA-API image for module: %s\n' "$module with tag $tag"
mvn package -DskipTests docker:build -pl "$module" -DdockerRegistry="${DOCKER_REGISTRY}" -DpushImageTag -DdockerImageTags="$tag"
done
}
printf '%s\n' "$DOCKER_PASSWORD" |
docker login -u "$DOCKER_USER" --password-stdin
## Travis run on master branch and not a PR (this is after a PR has been approved)
if [ "$TRAVIS_BRANCH" = "master" ] &&
[ "$TRAVIS_PULL_REQUEST" = "false" ]
then
push_images latest api
push_images "1.0" api
push_images latest oss
push_images "1.0" oss
fi
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