chore(MonoRepo): Switch to correct cd definition of Backend or Context dir.

This commit is contained in:
Marcel Feix 2022-07-01 09:54:51 +02:00
parent cd43f9c160
commit aad5b97f50
No known key found for this signature in database
GPG Key ID: 04D016E104A25F03
13 changed files with 71 additions and 8 deletions

View File

@ -48,7 +48,6 @@
- docker-compose $COMPOSE_EXTRA_ARGS pull
- docker-compose $COMPOSE_EXTRA_ARGS up -d --remove-orphans $COMPOSE_UP_EXTRA_ARGS
#todo add docker compose renovate updater
.docker-compose-validate:
image: docker:20.10.16-alpine3.15
stage: verify

View File

@ -11,7 +11,10 @@
extends: .container-build-common
image: $MAVEN_IMAGE
script:
- "cd $CONTEXT_LOCATION"
- >
if [ "$CONTEXT_LOCATION" != "" ]; then
cd $CONTEXT_LOCATION
fi
- mvn $MAVEN_CLI_OPTS jib:buildTar -DskipTests -Djib.outputPaths.tar=$CI_PROJECT_DIR/image.tar $EXTRA_ARGS
.container-build-jib-gradle:
@ -20,7 +23,10 @@
variables:
EXTRA_ARGS: $GRADLE_EXTRA_ARGS
script:
- "cd $CONTEXT_LOCATION"
- >
if [ "$CONTEXT_LOCATION" != "" ]; then
cd $CONTEXT_LOCATION
fi
- ./gradlew $GRADLE_CLI_OPTS jibBuildTar -DskipTests -Djib.outputPaths.tar=$CI_PROJECT_DIR/image.tar $EXTRA_ARGS
.container-build-kaniko:

View File

@ -2,6 +2,10 @@
stage: build
image: $GRADLE_IMAGE
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
# Replace version in Gradle file with $CI_COMMIT_TAG
- >
if [ ! -z "$CI_COMMIT_TAG" ] && [ ! -z "$PATH_TO_VERSION_FILE" ]; then

View File

@ -8,6 +8,11 @@ include:
variables:
GRADLE_EXTRA_OPTS: ""
PATH_TO_DIFF: "build/db-diff.xml"
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- ./gradlew liquibase:update liquibase:diff $GRADLE_CLI_OPTS

View File

@ -1,6 +1,11 @@
.gradle-licence-bom:
image: $GRADLE_IMAGE
stage: build
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- "cd $BACKEND_DIR"
- "./gradlew --build-cache cyclonedxBom $GRADLE_CLI_OPTS"

View File

@ -1,6 +1,11 @@
.gradle-verify:
image: $GRADLE_IMAGE
stage: verify
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- "./gradlew --build-cache test $GRADLE_CLI_OPTS"
artifacts:

View File

@ -2,7 +2,10 @@
stage: build
image: $MAVEN_IMAGE
before_script:
- "cd $BACKEND_DIR"
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
- >
if [ ! -z "$CI_COMMIT_TAG" ]; then
mvn $MVN_EXTRA_ARGS $MAVEN_CLI_OPTS versions:set -DnewVersion=$CI_COMMIT_TAG -DgenerateBackupPoms=false

View File

@ -8,8 +8,12 @@ include:
variables:
MAVEN_EXTRA_OPTS: ""
PATH_TO_DIFF: "target/db-diff.xml"
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- "cd $BACKEND_DIR"
- mvn compile liquibase:update liquibase:diff $MAVEN_EXTRA_OPTS
artifacts:
when: on_failure

View File

@ -1,6 +1,10 @@
.maven-dependencies:
stage: dependencies
image: $MAVEN_IMAGE
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- "cd $BACKEND_DIR"
- "mvn $MAVEN_CLI_OPTS dependency:resolve"

View File

@ -1,8 +1,12 @@
.maven-licence-bom:
image: $MAVEN_IMAGE
stage: build
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- "cd $BACKEND_DIR"
- mvn cyclonedx:makeBom
artifacts:
when: always

View File

@ -1,8 +1,12 @@
.maven-verify:
image: $MAVEN_IMAGE
stage: verify
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- "cd $BACKEND_DIR"
- mvn $MAVEN_CLI_OPTS verify
artifacts:
expire_in: 2 weeks

View File

@ -12,6 +12,11 @@
.sonar-maven:
extends: .sonar-template-common
image: $MAVEN_IMAGE
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- mvn $MAVEN_CLI_OPTS test sonar:sonar
"-Dsonar.host.url=$SONAR_HOST_URL"
@ -26,6 +31,11 @@
.sonar-gradle:
extends: .sonar-template-common
image: $GRADLE_IMAGE
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- ./gradlew $GRADLE_OPTS $GRADLE_CLI_OPTS sonarqube
"-Dsonar.host.url=$SONAR_HOST_URL"

View File

@ -11,6 +11,11 @@
.sonar-maven:
extends: .sonar-template-common
image: $MAVEN_IMAGE
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- mvn $MAVEN_CLI_OPTS test sonar:sonar
"-Dsonar.host.url=$SONAR_HOST_URL"
@ -24,6 +29,11 @@
.sonar-gradle:
extends: .sonar-template-common
image: $GRADLE_IMAGE
before_script:
- >
if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR
fi
script:
- ./gradlew $GRADLE_OPTS sonarqube $GRADLE_CLI_OPTS
"-Dsonar.host.url=$SONAR_HOST_URL"