From 5b6e3c43e7e38a4f07aa2a82f1ca24a3920a4944 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Thu, 29 Aug 2024 18:44:30 +0200 Subject: [PATCH 1/2] Fix :GitLab :release :CI --- .gitlab-ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c2c833..39cd208 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,19 +51,24 @@ publish: - export REPOSITORY="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven" - export ALT_REPOSITORY="altDeploymentRepository=gitlab::default::${REPOSITORY}" - export IMG_REGISTRY="${CI_REGISTRY}/jaguililla/hexagonal_spring" + - export POM_VERSION="$(mvn help:evaluate -D expression=project.version -q -D forceStdout)" - ./mvnw -s ci_settings.xml -D ${ALT_REPOSITORY} -D image.registry=${IMG_REGISTRY} -D spring-boot.build-image.publish=true -B deploy - rm -rf "${CLIENT_PATH}/src/main/java/${CONTROLLERS_PATH}" - mvn -s ci_settings.xml -f "${CLIENT_PATH}/pom.xml" -B -D ${ALT_REPOSITORY} clean deploy + - echo "POM_VERSION=${POM_VERSION}" >> variables.env + artifacts: + reports: + dotenv: variables.env release: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest - dependencies: - - publish + needs: + - job: publish + artifacts: true rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - script: - - export POM_VERSION="$(mvn help:evaluate -D expression=project.version -q -D forceStdout)" release: tag_name: ${POM_VERSION} description: Release ${POM_VERSION} + ref: ${POM_VERSION} From 199be5fb4338c163c58e2f77ff539c0437261d34 Mon Sep 17 00:00:00 2001 From: jaguililla Date: Thu, 29 Aug 2024 18:47:24 +0200 Subject: [PATCH 2/2] Fix GitLab CI --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39cd208..9f0182b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,6 +68,8 @@ release: artifacts: true rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + script: + - echo "Release version ${POM_VERSION}" release: tag_name: ${POM_VERSION} description: Release ${POM_VERSION}