Commit 930567e4 authored by Thomas Beermann's avatar Thomas Beermann
Browse files

switch to gitlab docker repository

parent fe72ce6d
Pipeline #84449 passed with stages
in 8 minutes and 12 seconds
......@@ -7,6 +7,8 @@ stages:
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
DOCKER_REGISTRY: registry.hzdr.de
DOCKER_IMAGE_BASE: registry.hzdr.de/hifis-technical-platform/helmholtz-cerebrum
DOCKER_IMAGE_TAGGED: helmholtzcloud/cerebrum:$CI_COMMIT_TAG
DOCKER_IMAGE_LATEST: helmholtzcloudserviceuser/cerebrum:latest
......
......@@ -25,6 +25,8 @@ test:
package:
only:
- master
- tags
- merge_requests
stage: package
image: maven:3-jdk-11
script: mvn -DskipTests clean install
......@@ -39,6 +41,7 @@ docker_build_push:
only:
- master
- tags
- merge_requests
stage: docker
image: docker:19.03.11
services:
......@@ -47,14 +50,14 @@ docker_build_push:
before_script:
- docker info
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker login -u $GITLAB_DOCKER_USERNAME -p $GITLAB_DOCKER_PASSWORD $DOCKER_REGISTRY
- |-
if [[ -z "$CI_COMMIT_TAG" ]]; then
docker build -t $DOCKER_IMAGE_LATEST .
docker push $DOCKER_IMAGE_LATEST
if [[ "$CI_COMMIT_BRANCH" == "master" ]]; then
docker build -t $DOCKER_IMAGE_BASE:latest .
docker push $DOCKER_IMAGE_BASE:latest
else
docker build -t $DOCKER_IMAGE_TAGGED .
docker push $DOCKER_IMAGE_TAGGED
docker build -t $DOCKER_IMAGE_BASE:$CI_COMMIT_REF_NAME .
docker push $DOCKER_IMAGE_BASE:$CI_COMMIT_REF_NAME
fi
dependencies:
- package
......
FROM adoptopenjdk:11-jre-hotspot
ENV NEO4J_ADDRESS localhost
COPY target/helmholtz-cerebrum-*.jar cerebrum.jar
EXPOSE 8090
CMD java -Dspring.profiles.active=dev -jar cerebrum.jar --org.neo4j.driver.uri="bolt://${NEO4J_ADDRESS}:7687"
CMD java -Dspring.profiles.active=dev -Dspring.data.mongodb.authentication-database=${MONGODB_AUTH_DB} -Dspring.data.mongodb.database=${MONGODB_AUTH_DB} -Dspring.data.mongodb.host=${MONGODB_HOST} -Dspring.data.mongodb.port=${MONGODB_PORT} -Dspring.data.mongodb.username=${MONGODB_USERNAME} -Dspring.data.mongodb.password=${MONGODB_PASSWORD} -Dsecurity.oauth2.client.pre-established-redirect-uri=${OAUTH2_REGISTERED_URI} -Dsecurity.oauth2.client.registered-redirect-uri=${OAUTH2_REGISTERED_URI} -Dsecurity.oauth2.client.use-current-uri=${OAUTH2_USE_CURRENT_URI} -jar cerebrum.jar
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