Commit 5b48f1e5 authored by anandmohan777's avatar anandmohan777
Browse files

Add docker push stage in gitlab ci

parent 0bbe626f
Pipeline #125764 passed with stages
in 22 minutes and 8 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
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
script:
- mvn clean install "-DdockerRegistry=$CI_REGISTRY_IMAGE" "-Dimage.version=$CI_COMMIT_TAG" -P production -DskipTests
rules:
- if: $CI_COMMIT_TAG
\ 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