Skip to content

Commit

Permalink
Fix :GitLab :release :CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jaguililla committed Aug 29, 2024
1 parent 4e90916 commit f73079b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
export REGISTRY_PASSWORD="${GITHUB_TOKEN}"
export POM_VERSION="$(mvn help:evaluate -D expression=project.version -q -D forceStdout)"
git config user.name "${GIT_USERNAME}"
git config --global user.name "${GIT_USERNAME}"
./mvnw -D image.registry=ghcr.io/jaguililla/hexagonal_spring -D spring-boot.build-image.publish=true -B deploy
git tag -m "Release ${POM_VERSION}" "${POM_VERSION}"
git push --tags
Expand Down
13 changes: 11 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ build:
- sdk env install
- ./mvnw

release:
publish:
stage: release
image: maven:3
rules:
Expand All @@ -51,10 +51,19 @@ release:
- 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

release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
dependencies:
- publish
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}

0 comments on commit f73079b

Please sign in to comment.