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: variables:
GRADLE_EXTRA_OPTS: "" GRADLE_EXTRA_OPTS: ""
PATH_TO_DIFF: "build/db-diff.xml" PATH_TO_DIFF: "build/db-diff.xml"
before_script: script:
- > - >
if [ "$BACKEND_DIR" != "" ]; then if [ "$BACKEND_DIR" != "" ]; then
cd $BACKEND_DIR cd $BACKEND_DIR
fi fi
script:
- ./gradlew liquibase:update liquibase:diff $GRADLE_CLI_OPTS $GRADLE_EXTRA_OPTS - ./gradlew liquibase:update liquibase:diff $GRADLE_CLI_OPTS $GRADLE_EXTRA_OPTS

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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