diff options
| author | 2026-01-11 05:19:42 +0000 | |
|---|---|---|
| committer | 2026-01-11 15:37:08 +0200 | |
| commit | 6c0764d25afc264b849f20526db83cfb1695ccdc (patch) | |
| tree | 46eab275c5316688ef64bfff8bf96a56a7eb134f | |
| parent | Add org.codehaus.mojo:build-helper-maven-plugin (diff) | |
| download | lv.enes:parent-6c0764d25afc264b849f20526db83cfb1695ccdc.tar.gz lv.enes:parent-6c0764d25afc264b849f20526db83cfb1695ccdc.tar.xz lv.enes:parent-6c0764d25afc264b849f20526db83cfb1695ccdc.zip | |
GitLab CI setup
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | .gitlab-ci.yml | 42 | ||||
| -rw-r--r-- | REUSE.toml | 7 | ||||
| -rwxr-xr-x | build.sh | 2 | ||||
| -rw-r--r-- | ci/mvn-settings.xml | 20 |
5 files changed, 71 insertions, 3 deletions
| @@ -37,3 +37,6 @@ build/ | |||
| 37 | 37 | ||
| 38 | ### JVM crashes ### | 38 | ### JVM crashes ### |
| 39 | hs_err_* | 39 | hs_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 @@ | |||
| 1 | variables: | ||
| 2 | M2_REPO: ".m2/repository" | ||
| 3 | MAVEN_OPTS: "-Dmaven.repo.local=$M2_REPO" | ||
| 4 | |||
| 5 | default: | ||
| 6 | image: registry.gitlab.com/lv.enes/containers/build-env:latest | ||
| 7 | cache: | ||
| 8 | paths: | ||
| 9 | - .m2/repository | ||
| 10 | - target/ | ||
| 11 | |||
| 12 | stages: | ||
| 13 | - lint | ||
| 14 | - build | ||
| 15 | - deploy | ||
| 16 | |||
| 17 | pre-commit-job: | ||
| 18 | stage: lint | ||
| 19 | script: | ||
| 20 | - pre-commit run -a | ||
| 21 | |||
| 22 | build-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: | ||
| 31 | build-job: | ||
| 32 | stage: build | ||
| 33 | script: | ||
| 34 | - ./mvnw verify | ||
| 35 | |||
| 36 | deploy-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 | ||
| @@ -9,6 +9,9 @@ SPDX-FileCopyrightText = "Apache Software Foundation" | |||
| 9 | 9 | ||
| 10 | [[annotations]] | 10 | [[annotations]] |
| 11 | label = "Miscellaneous little shits I put under CC0" | 11 | label = "Miscellaneous little shits I put under CC0" |
| 12 | path = ["build.sh", ".gitattributes", ".gitignore", ".pre-commit-config.yaml", ".sdkmanrc"] | 12 | path = [ |
| 13 | "build.sh", "ci/mvn-settings.xml", ".gitattributes", ".gitignore", ".gitlab-ci.yml", ".pre-commit-config.yaml", | ||
| 14 | ".sdkmanrc", | ||
| 15 | ] | ||
| 13 | SPDX-License-Identifier = "CC0-1.0" | 16 | SPDX-License-Identifier = "CC0-1.0" |
| 14 | SPDX-FileCopyrightText = " 2025 Uko Kokņevičs <perkontevs@gmail.com>" | 17 | SPDX-FileCopyrightText = " 2025-2026 Uko Kokņevičs <perkontevs@gmail.com>" |
| @@ -6,6 +6,6 @@ | |||
| 6 | set -eu | 6 | set -eu |
| 7 | 7 | ||
| 8 | ./mvnw dependency:go-offline install | 8 | ./mvnw dependency:go-offline install |
| 9 | rm -fr ~/.m2/repository/lv/enes/ | 9 | rm -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> | ||