Commit 635547f9 authored by Alicja Reniewicz's avatar Alicja Reniewicz
Browse files

add gitlab-ci configuration

parent bb2da612
Pipeline #8575 failed with stages
in 26 minutes and 18 seconds
# Gitlab CI/CD script for the Melodic Integration project
variables:
DOCKER_PUSH: "true"
DOCKER_REPO: "gitlab.ow2.org:4567"
MAVEN_IMAGE: "maven:3.5.2-jdk-8"
DOCKER_DIND_IMAGE: "docker:19.03.1"
DOCKER_DIND_SERVICE: "$DOCKER_DIND_IMAGE-dind"
LOCAL_REPO: "127.0.0.1:5000"
DOCKER_CLI: "docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v $CI_PROJECT_DIR/maven_repo:/root/.m2 -w /usr/src/mymaven -v $CI_PROJECT_DIR:/usr/src/mymaven $MAVEN_IMAGE"
RAML_TO_JAXRS_CLI: "mvn -DskipTests --batch-mode -f raml-to-jaxrs-7bulls/pom.xml"
INTERFACES_CLI: "mvn -DskipTests --batch-mode -f interfaces/pom.xml"
MULE_ESB_CLI: "mvn -DskipTests --batch-mode -f mule_esb/pom.xml"
PROCESS_CLI: "mvn -DskipTests --batch-mode -f process/pom.xml"
DOCKER_DRIVER: overlay
DOCKER_TLS_CERTDIR: "/certs"
cache:
paths:
- maven_repo/
before_script:
- echo '=========================================================================='
- echo $MULE_ESB_CLI
- echo '=========================================================================='
- mkdir -p $HOME/.m2
- echo '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>'$CI_PROJECT_DIR'/maven_repo</localRepository>
</settings>' > $HOME/.m2/settings.xml
after_script:
- echo '=========================================================================='
- docker image ls
- echo '=========================================================================='
build:raml_to_jaxrs:
stage: build
image: $MAVEN_IMAGE
script:
- $RAML_TO_JAXRS_CLI clean install
build:interfaces:
stage: build
image: $MAVEN_IMAGE
script:
- $INTERFACES_CLI clean install
deploy:raml_to_jaxrs:
stage: deploy
image: $MAVEN_IMAGE
script:
- $RAML_TO_JAXRS_CLI deploy
deploy:interfaces:
stage: deploy
image: $MAVEN_IMAGE
script:
- $INTERFACES_CLI deploy
deploy:mule_esb:
stage: deploy
image: $DOCKER_DIND_IMAGE
services:
- $DOCKER_DIND_SERVICE
script:
- $DOCKER_CLI $MULE_ESB_CLI -Ddocker.imagePrefix=melodic/ clean install
- echo "$K8S_SECRET_DOCKER_PASSWORD" | docker login $DOCKER_REPO -u $K8S_SECRET_DOCKER_USER --password-stdin
- docker tag $LOCAL_REPO/melodic/mule $DOCKER_REPO/melodic/melodic-integration/mule:$CI_COMMIT_BRANCH
- docker push $DOCKER_REPO/melodic/melodic-integration/mule:$CI_COMMIT_BRANCH
deploy:process:
stage: deploy
image: $DOCKER_DIND_IMAGE
services:
- $DOCKER_DIND_SERVICE
script:
- $DOCKER_CLI $PROCESS_CLI -Ddocker.imagePrefix=melodic/ clean install
- echo "$K8S_SECRET_DOCKER_PASSWORD" | docker login $DOCKER_REPO -u $K8S_SECRET_DOCKER_USER --password-stdin
- docker tag $LOCAL_REPO/melodic/process $DOCKER_REPO/melodic/melodic-integration/process:$CI_COMMIT_BRANCH
- docker push $DOCKER_REPO/melodic/melodic-integration/process:$CI_COMMIT_BRANCH
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