chore(*): Move cd $Backend into script to free up before_script for user

This commit is contained in:
Marcel Feix 2022-07-06 09:07:00 +02:00
parent ffab9bc5ee
commit ba75e97d06
No known key found for this signature in database
GPG Key ID: 04D016E104A25F03
9 changed files with 12 additions and 23 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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