summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cisettings.xml16
-rw-r--r--.gitlab-ci.yml68
-rw-r--r--pom.xml37
3 files changed, 101 insertions, 20 deletions
diff --git a/.cisettings.xml b/.cisettings.xml
new file mode 100644
index 00000000..61f6265f
--- /dev/null
+++ b/.cisettings.xml
@@ -0,0 +1,16 @@
+<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
+ <servers>
+ <server>
+ <id>gitlab</id>
+ <configuration>
+ <httpHeaders>
+ <property>
+ <name>Job-Token</name>
+ <value>${env.CI_JOB_TOKEN}</value>
+ </property>
+ </httpHeaders>
+ </configuration>
+ </server>
+ </servers>
+</settings>
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00000000..2d0e2687
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,68 @@
+image: maven:latest
+
+variables:
+ LC_ALL: "en_US.UTF-8"
+ LANG: "en_US.UTF-8"
+ LANGUAGE: "en_US"
+ LIB_NAME: "eaaf-components"
+ MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true --settings .cisettings.xml"
+ MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=${CI_PROJECT_DIR}/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
+ GIT_SUBMODULE_STRATEGY: recursive
+ GIT_DEPTH: "2"
+ SECURE_LOG_LEVEL: "debug"
+
+include:
+ - template: Dependency-Scanning.gitlab-ci.yml
+ - template: Security/SAST.gitlab-ci.yml
+ - template: Secret-Detection.gitlab-ci.yml
+
+stages:
+ - assemble
+ - test
+ - package
+ - release
+
+cache:
+ paths:
+ - ".m2/repository"
+
+assemble:
+ stage: assemble
+ except:
+ - tags
+ script: |
+ mvn $MAVEN_CLI_OPTS compile test
+ artifacts:
+ when: always
+ reports:
+ junit: "target/surefire-reports/TEST-*.xml"
+
+publishToGitlab:
+ stage: package
+ except:
+ - tags
+ 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"
+ mvnw $MAVEN_CLI_OPTS deploy -s .cisettings.xml -P gitlabDeploy
+ echo "VERSION=$VERSION" >> variables.env
+ artifacts:
+ when: always
+ reports:
+ dotenv: variables.env
+
+release:
+ stage: release
+ image: registry.gitlab.com/gitlab-org/release-cli:latest
+ needs:
+ - job: publishToGitlab
+ artifacts: true
+ when: manual
+ only:
+ - master
+ script: |
+ echo "Releasing version $VERSION of $LIB_NAME"
+ release:
+ name: "$VERSION"
+ tag_name: "v$VERSION"
+ description: "$(cat README.md)"
diff --git a/pom.xml b/pom.xml
index 9dc9c733..b9ad9c9a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,7 +43,7 @@
<iaik.prod.iaik_xades.version>2.13_moa</iaik.prod.iaik_xades.version>
<iaik.prod.iaik_xsect.version>2.13_moa</iaik.prod.iaik_xsect.version>
- <hsm-facade-provider.version>0.5.1</hsm-facade-provider.version>
+ <hsm-facade-provider.version>0.5.3-SNAPSHOT</hsm-facade-provider.version>
<io.grpc-core.version>1.30.2</io.grpc-core.version>
<!-- Other third-party libs -->
@@ -99,24 +99,8 @@
<repositories>
<repository>
- <id>asit-snapshot</id>
- <url>https://dev.a-sit.at/repositories/snapshot</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>asit-release</id>
- <url>https://dev.a-sit.at/repositories/release</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
+ <id>gitlab</id>
+ <url>https://gitlab.iaik.tugraz.at/api/v4/groups/119/-/packages/maven</url>
</repository>
<repository>
<id>egiz-commons</id>
@@ -143,6 +127,19 @@
</activation>
</profile>
<profile>
+ <id>gitlabDeploy</id>
+ <distributionManagement>
+ <repository>
+ <id>gitlab</id>
+ <url>https://gitlab.iaik.tugraz.at/api/v4/projects/507/packages/maven</url>
+ </repository>
+ <snapshotRepository>
+ <id>gitlab</id>
+ <url>https://gitlab.iaik.tugraz.at/api/v4/projects/507/packages/maven</url>
+ </snapshotRepository>
+ </distributionManagement>
+ </profile>
+ <profile>
<id>jenkinsDeploy</id>
<distributionManagement>
<repository>
@@ -737,4 +734,4 @@
</plugins>
</reporting>
-</project> \ No newline at end of file
+</project>