Update .gitlab-ci.yml, pom.xml

This commit is contained in:
Christopher Moyer 2022-10-14 01:47:30 +00:00
parent 89d251072d
commit 47a3ed5adb
2 changed files with 24 additions and 1 deletions

View file

@ -35,12 +35,21 @@ cache:
# For merge requests do not `deploy` but only run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
.verify: &verify
stages:
- test
- upload artifacts
stage: test
script:
- 'mvn $MAVEN_CLI_OPTS verify'
except:
variables:
- $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
stage: upload artifacts
script:
- 'mvn $MAVEN_CLI_OPTS deploy -s ci_settings.xml'
except:
variables:
- $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Verify merge requests using JDK8
build:
@ -56,7 +65,13 @@ upload artifacts:
- if [ ! -f ci_settings.xml ];
then echo "CI settings missing\! If deploying to GitLab Maven Repository, please see https://docs.gitlab.com/ee/user/packages/maven_repository/index.html#create-maven-packages-with-gitlab-cicd for instructions.";
fi
- 'mvn $MAVEN_CLI_OPTS deploy -s ci_settings.xml'
- eval $(ssh-agent -s)
- ssh-add <(echo "$GITLAB_RUNNER_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- git checkout -B "$CI_BUILD_REF_NAME"
- 'mvn -B release:prepare -s ci_settings.xml'
- 'mvn -B release:perform -s ci_settings.xml'
only:
variables:
- $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

View file

@ -97,6 +97,14 @@
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<scmCommentPrefix>[skip ci] [maven-release-plugin]</scmCommentPrefix>
</configuration>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${surefire-plugin.version}</version>