chore(MonoRepo): Switch to correct cd definition of Backend or Context dir.
This commit is contained in:
parent
cd43f9c160
commit
aad5b97f50
@ -48,7 +48,6 @@
|
|||||||
- docker-compose $COMPOSE_EXTRA_ARGS pull
|
- docker-compose $COMPOSE_EXTRA_ARGS pull
|
||||||
- docker-compose $COMPOSE_EXTRA_ARGS up -d --remove-orphans $COMPOSE_UP_EXTRA_ARGS
|
- docker-compose $COMPOSE_EXTRA_ARGS up -d --remove-orphans $COMPOSE_UP_EXTRA_ARGS
|
||||||
|
|
||||||
#todo add docker compose renovate updater
|
|
||||||
.docker-compose-validate:
|
.docker-compose-validate:
|
||||||
image: docker:20.10.16-alpine3.15
|
image: docker:20.10.16-alpine3.15
|
||||||
stage: verify
|
stage: verify
|
||||||
|
|||||||
@ -11,7 +11,10 @@
|
|||||||
extends: .container-build-common
|
extends: .container-build-common
|
||||||
image: $MAVEN_IMAGE
|
image: $MAVEN_IMAGE
|
||||||
script:
|
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
|
- mvn $MAVEN_CLI_OPTS jib:buildTar -DskipTests -Djib.outputPaths.tar=$CI_PROJECT_DIR/image.tar $EXTRA_ARGS
|
||||||
|
|
||||||
.container-build-jib-gradle:
|
.container-build-jib-gradle:
|
||||||
@ -20,7 +23,10 @@
|
|||||||
variables:
|
variables:
|
||||||
EXTRA_ARGS: $GRADLE_EXTRA_ARGS
|
EXTRA_ARGS: $GRADLE_EXTRA_ARGS
|
||||||
script:
|
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
|
- ./gradlew $GRADLE_CLI_OPTS jibBuildTar -DskipTests -Djib.outputPaths.tar=$CI_PROJECT_DIR/image.tar $EXTRA_ARGS
|
||||||
|
|
||||||
.container-build-kaniko:
|
.container-build-kaniko:
|
||||||
|
|||||||
@ -2,6 +2,10 @@
|
|||||||
stage: build
|
stage: build
|
||||||
image: $GRADLE_IMAGE
|
image: $GRADLE_IMAGE
|
||||||
before_script:
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
# Replace version in Gradle file with $CI_COMMIT_TAG
|
# Replace version in Gradle file with $CI_COMMIT_TAG
|
||||||
- >
|
- >
|
||||||
if [ ! -z "$CI_COMMIT_TAG" ] && [ ! -z "$PATH_TO_VERSION_FILE" ]; then
|
if [ ! -z "$CI_COMMIT_TAG" ] && [ ! -z "$PATH_TO_VERSION_FILE" ]; then
|
||||||
|
|||||||
@ -8,6 +8,11 @@ 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:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- ./gradlew liquibase:update liquibase:diff $GRADLE_CLI_OPTS
|
- ./gradlew liquibase:update liquibase:diff $GRADLE_CLI_OPTS
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
.gradle-licence-bom:
|
.gradle-licence-bom:
|
||||||
image: $GRADLE_IMAGE
|
image: $GRADLE_IMAGE
|
||||||
stage: build
|
stage: build
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- "cd $BACKEND_DIR"
|
- "cd $BACKEND_DIR"
|
||||||
- "./gradlew --build-cache cyclonedxBom $GRADLE_CLI_OPTS"
|
- "./gradlew --build-cache cyclonedxBom $GRADLE_CLI_OPTS"
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
.gradle-verify:
|
.gradle-verify:
|
||||||
image: $GRADLE_IMAGE
|
image: $GRADLE_IMAGE
|
||||||
stage: verify
|
stage: verify
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- "./gradlew --build-cache test $GRADLE_CLI_OPTS"
|
- "./gradlew --build-cache test $GRADLE_CLI_OPTS"
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|||||||
@ -2,7 +2,10 @@
|
|||||||
stage: build
|
stage: build
|
||||||
image: $MAVEN_IMAGE
|
image: $MAVEN_IMAGE
|
||||||
before_script:
|
before_script:
|
||||||
- "cd $BACKEND_DIR"
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
- >
|
- >
|
||||||
if [ ! -z "$CI_COMMIT_TAG" ]; then
|
if [ ! -z "$CI_COMMIT_TAG" ]; then
|
||||||
mvn $MVN_EXTRA_ARGS $MAVEN_CLI_OPTS versions:set -DnewVersion=$CI_COMMIT_TAG -DgenerateBackupPoms=false
|
mvn $MVN_EXTRA_ARGS $MAVEN_CLI_OPTS versions:set -DnewVersion=$CI_COMMIT_TAG -DgenerateBackupPoms=false
|
||||||
|
|||||||
@ -8,8 +8,12 @@ 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:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- "cd $BACKEND_DIR"
|
|
||||||
- mvn compile liquibase:update liquibase:diff $MAVEN_EXTRA_OPTS
|
- mvn compile liquibase:update liquibase:diff $MAVEN_EXTRA_OPTS
|
||||||
artifacts:
|
artifacts:
|
||||||
when: on_failure
|
when: on_failure
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
.maven-dependencies:
|
.maven-dependencies:
|
||||||
stage: dependencies
|
stage: dependencies
|
||||||
image: $MAVEN_IMAGE
|
image: $MAVEN_IMAGE
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- "cd $BACKEND_DIR"
|
|
||||||
- "mvn $MAVEN_CLI_OPTS dependency:resolve"
|
- "mvn $MAVEN_CLI_OPTS dependency:resolve"
|
||||||
@ -1,8 +1,12 @@
|
|||||||
.maven-licence-bom:
|
.maven-licence-bom:
|
||||||
image: $MAVEN_IMAGE
|
image: $MAVEN_IMAGE
|
||||||
stage: build
|
stage: build
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- "cd $BACKEND_DIR"
|
|
||||||
- mvn cyclonedx:makeBom
|
- mvn cyclonedx:makeBom
|
||||||
artifacts:
|
artifacts:
|
||||||
when: always
|
when: always
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
.maven-verify:
|
.maven-verify:
|
||||||
image: $MAVEN_IMAGE
|
image: $MAVEN_IMAGE
|
||||||
stage: verify
|
stage: verify
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- "cd $BACKEND_DIR"
|
|
||||||
- mvn $MAVEN_CLI_OPTS verify
|
- mvn $MAVEN_CLI_OPTS verify
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 2 weeks
|
expire_in: 2 weeks
|
||||||
|
|||||||
@ -12,6 +12,11 @@
|
|||||||
.sonar-maven:
|
.sonar-maven:
|
||||||
extends: .sonar-template-common
|
extends: .sonar-template-common
|
||||||
image: $MAVEN_IMAGE
|
image: $MAVEN_IMAGE
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS test sonar:sonar
|
- mvn $MAVEN_CLI_OPTS test sonar:sonar
|
||||||
"-Dsonar.host.url=$SONAR_HOST_URL"
|
"-Dsonar.host.url=$SONAR_HOST_URL"
|
||||||
@ -26,6 +31,11 @@
|
|||||||
.sonar-gradle:
|
.sonar-gradle:
|
||||||
extends: .sonar-template-common
|
extends: .sonar-template-common
|
||||||
image: $GRADLE_IMAGE
|
image: $GRADLE_IMAGE
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- ./gradlew $GRADLE_OPTS $GRADLE_CLI_OPTS sonarqube
|
- ./gradlew $GRADLE_OPTS $GRADLE_CLI_OPTS sonarqube
|
||||||
"-Dsonar.host.url=$SONAR_HOST_URL"
|
"-Dsonar.host.url=$SONAR_HOST_URL"
|
||||||
|
|||||||
@ -11,6 +11,11 @@
|
|||||||
.sonar-maven:
|
.sonar-maven:
|
||||||
extends: .sonar-template-common
|
extends: .sonar-template-common
|
||||||
image: $MAVEN_IMAGE
|
image: $MAVEN_IMAGE
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- mvn $MAVEN_CLI_OPTS test sonar:sonar
|
- mvn $MAVEN_CLI_OPTS test sonar:sonar
|
||||||
"-Dsonar.host.url=$SONAR_HOST_URL"
|
"-Dsonar.host.url=$SONAR_HOST_URL"
|
||||||
@ -24,6 +29,11 @@
|
|||||||
.sonar-gradle:
|
.sonar-gradle:
|
||||||
extends: .sonar-template-common
|
extends: .sonar-template-common
|
||||||
image: $GRADLE_IMAGE
|
image: $GRADLE_IMAGE
|
||||||
|
before_script:
|
||||||
|
- >
|
||||||
|
if [ "$BACKEND_DIR" != "" ]; then
|
||||||
|
cd $BACKEND_DIR
|
||||||
|
fi
|
||||||
script:
|
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"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user