summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2026-01-11 05:19:42 +0000
committerGravatar Uko Kokņevičs2026-01-11 15:37:08 +0200
commit6c0764d25afc264b849f20526db83cfb1695ccdc (patch)
tree46eab275c5316688ef64bfff8bf96a56a7eb134f
parentAdd org.codehaus.mojo:build-helper-maven-plugin (diff)
downloadlv.enes:parent-6c0764d25afc264b849f20526db83cfb1695ccdc.tar.gz
lv.enes:parent-6c0764d25afc264b849f20526db83cfb1695ccdc.tar.xz
lv.enes:parent-6c0764d25afc264b849f20526db83cfb1695ccdc.zip
GitLab CI setup
-rw-r--r--.gitignore3
-rw-r--r--.gitlab-ci.yml42
-rw-r--r--REUSE.toml7
-rwxr-xr-xbuild.sh2
-rw-r--r--ci/mvn-settings.xml20
5 files changed, 71 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index e98a643..8a401cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,3 +37,6 @@ build/
37 37
38### JVM crashes ### 38### JVM crashes ###
39hs_err_* 39hs_err_*
40
41### GitLab CI ###
42/.m2
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..6df673d
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,42 @@
1variables:
2 M2_REPO: ".m2/repository"
3 MAVEN_OPTS: "-Dmaven.repo.local=$M2_REPO"
4
5default:
6 image: registry.gitlab.com/lv.enes/containers/build-env:latest
7 cache:
8 paths:
9 - .m2/repository
10 - target/
11
12stages:
13 - lint
14 - build
15 - deploy
16
17pre-commit-job:
18 stage: lint
19 script:
20 - pre-commit run -a
21
22build-repro-job:
23 stage: build
24 cache:
25 # This job deletes stuff from the maven repository to make sure it's reproducible, don't update the cache
26 policy: pull
27 script:
28 - ./build.sh
29
30# TODO: Should run owasp plugin but that beast is complaining about too many requests :confused:
31build-job:
32 stage: build
33 script:
34 - ./mvnw verify
35
36deploy-job:
37 stage: deploy
38 environment: production
39 script:
40 - ./mvnw -s ci/mvn-settings.xml deploy
41 rules:
42 - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
diff --git a/REUSE.toml b/REUSE.toml
index 57eeea1..5134362 100644
--- a/REUSE.toml
+++ b/REUSE.toml
@@ -9,6 +9,9 @@ SPDX-FileCopyrightText = "Apache Software Foundation"
9 9
10[[annotations]] 10[[annotations]]
11label = "Miscellaneous little shits I put under CC0" 11label = "Miscellaneous little shits I put under CC0"
12path = ["build.sh", ".gitattributes", ".gitignore", ".pre-commit-config.yaml", ".sdkmanrc"] 12path = [
13 "build.sh", "ci/mvn-settings.xml", ".gitattributes", ".gitignore", ".gitlab-ci.yml", ".pre-commit-config.yaml",
14 ".sdkmanrc",
15]
13SPDX-License-Identifier = "CC0-1.0" 16SPDX-License-Identifier = "CC0-1.0"
14SPDX-FileCopyrightText = " 2025 Uko Kokņevičs <perkontevs@gmail.com>" 17SPDX-FileCopyrightText = " 2025-2026 Uko Kokņevičs <perkontevs@gmail.com>"
diff --git a/build.sh b/build.sh
index 52ae44a..db17021 100755
--- a/build.sh
+++ b/build.sh
@@ -6,6 +6,6 @@
6set -eu 6set -eu
7 7
8./mvnw dependency:go-offline install 8./mvnw dependency:go-offline install
9rm -fr ~/.m2/repository/lv/enes/ 9rm -fr ${M2_REPO:-~/.m2/repository}/lv/enes/
10./mvnw -o clean 10./mvnw -o clean
11./mvnw -o install 11./mvnw -o install
diff --git a/ci/mvn-settings.xml b/ci/mvn-settings.xml
new file mode 100644
index 0000000..933e3ff
--- /dev/null
+++ b/ci/mvn-settings.xml
@@ -0,0 +1,20 @@
1<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
4 <servers>
5 <server>
6 <id>mvn.enes.lv</id>
7 <username>${env.MAVEN_REPO_USER}</username>
8 <password>${env.MAVEN_REPO_PASS}</password>
9 </server>
10 <server>
11 <id>mvn.enes.lv-snapshots</id>
12 <username>${env.MAVEN_REPO_USER}</username>
13 <password>${env.MAVEN_REPO_PASS}</password>
14 </server>
15 <server>
16 <id>nvd.nist.gov</id>
17 <password>${env.NVD_NIST_API_KEY}</password>
18 </server>
19 </servers>
20</settings>