From 76b60de58d90b576a997f5901c9a096696d12fbf Mon Sep 17 00:00:00 2001 From: lewa <lene.wasskog@nibio.no> Date: Wed, 10 Jan 2024 13:45:21 +0100 Subject: [PATCH] chore: Use deploy, and not deploy-file Did not work because url has to be provided --- .gitlab-ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4773d5e..dc356ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -221,12 +221,8 @@ upload-and-tag-release: - export RELEASE_VERSION=$(./mvnw $MAVEN_POM_WITH_MODELS $MAVEN_CLI_OPTS $MAVEN_OPTS --batch-mode --no-transfer-progress --non-recursive help:evaluate -Dexpression=project.version | grep -v "\[.*") - export RELEASE_TAG="v${RELEASE_VERSION}" - echo "Version to deploy '$RELEASE_VERSION', will be tagged '$RELEASE_TAG'" - - # Find name of war file in target folder (built previously in build stage), exit if none exists - - WAR_FILE=$(find target -maxdepth 1 -type f -name "*.war" | sort -n | tail -1 | xargs basename) - - if [ -z "$WAR_FILE" ]; then echo "No war file found in target directory"; exit 1; fi - - echo "Deploy war file built in build job '$WAR_FILE'" - - "./mvnw $MAVEN_CLI_OPTS $MAVEN_OPTS deploy:deploy-file -DpomFile=pom.xml -Dfile=target/$WAR_FILE" + - "./mvnw $MAVEN_POM_WITH_MODELS $MAVEN_CLI_OPTS $MAVEN_OPTS deploy -DskipTests" + # NB! Wanted to use deploy:deploy-file with already built war file above, but this requires url to be specifically set - git tag -a $RELEASE_TAG -m "Tag release ${RELEASE_TAG}" - git push origin $RELEASE_TAG -- GitLab