From 71ee7827780f15f5126f4d0cbe55ad38723fa67c Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 7 Dec 2020 15:22:24 +0100 Subject: update build pipeline to test deployment to egiz public maven --- .cisettings.xml | 23 ++++++++++++++++++++--- .gitlab-ci.yml | 16 +++++++++++++--- pom.xml | 4 ++++ 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/.cisettings.xml b/.cisettings.xml index 2e050b67..8556c6a8 100644 --- a/.cisettings.xml +++ b/.cisettings.xml @@ -9,12 +9,29 @@ Job-Token ${env.CI_JOB_TOKEN} - + ${env.PRIVATE_TOKEN} + + + + egizMaven + ${env.EGIZ_MAVEN_USER} + ${env.EGIZ_MAVEN_PASSWORD} + + + no + + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db89c941..37ca635e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ stages: cache: paths: - ".m2/repository" - + assemble: stage: assemble except: @@ -42,10 +42,14 @@ publishToGitlab: stage: package except: - tags + before_script: + - mkdir -p ~/.ssh + - ssh-keyscan apps.egiz.gv.at >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts script: | export VERSION=$(mvn -B help:evaluate -Dexpression=project.version -B | grep -v "\[INFO\]" | grep -Po "\d+\.\d+\.\d+((-\w*)+)?") - echo "Publishing version $VERSION for $LIB_NAME" - mvn $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P gitlabDeploy + echo "Publishing version $VERSION for $LIB_NAME to public EGIZ maven" + mvn $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P jenkinsDeploy -DskipTests echo "VERSION=$VERSION" >> variables.env artifacts: when: always @@ -61,8 +65,14 @@ release: when: manual only: - master + before_script: + - mkdir -p ~/.ssh + - ssh-keyscan apps.egiz.gv.at >> ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts script: | echo "Releasing version $VERSION of $LIB_NAME" + echo "Publishing version $VERSION to public EGIZ maven" + mvn $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P jenkinsDeploy release: name: "$VERSION" tag_name: "v$VERSION" diff --git a/pom.xml b/pom.xml index 104d25db..1889eb35 100644 --- a/pom.xml +++ b/pom.xml @@ -102,6 +102,10 @@ gitlab https://gitlab.iaik.tugraz.at/api/v4/groups/119/-/packages/maven + + gitlab-localbuild + https://gitlab.iaik.tugraz.at/api/v4/groups/119/-/packages/maven + egiz-commons https://apps.egiz.gv.at/maven/ -- cgit v1.2.3