Compare commits
10
Commits
dca0164e79
...
6510729588
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6510729588 | ||
|
|
b96e5b2880 | ||
|
|
b3bd6a45fe | ||
|
|
83e618c6a3 | ||
|
|
078c540327 | ||
|
|
e021a713b2 | ||
|
|
91aaafeb40 | ||
|
|
99457b40fc | ||
|
|
78a359ba09 | ||
|
|
2a4dc09a9e |
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
.git
|
||||
.gitlab-ci.yml
|
||||
.gitea
|
||||
.idea
|
||||
.mvn
|
||||
src
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
jobs:
|
||||
package:
|
||||
name: Package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '25'
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
chmod +x ./mvnw
|
||||
./mvnw --batch-mode --update-snapshots verify
|
||||
|
||||
- name: Upload test reports
|
||||
if: always()
|
||||
uses: actions/upload-artifact@c6a366c94c3e0affe28c06c8df20a878f24da3cf # v3
|
||||
with:
|
||||
name: junit-reports
|
||||
path: |
|
||||
**/target/*-reports/TEST-*.xml
|
||||
if-no-files-found: ignore
|
||||
|
||||
- name: Upload Maven artifacts
|
||||
uses: actions/upload-artifact@c6a366c94c3e0affe28c06c8df20a878f24da3cf # v3
|
||||
with:
|
||||
name: maven-artifacts
|
||||
path: |
|
||||
target/netneutrality.jar
|
||||
startup.sh
|
||||
if-no-files-found: error
|
||||
|
||||
docker-main:
|
||||
name: Docker Build and Push (main)
|
||||
runs-on: ubuntu-latest
|
||||
needs: package
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@a9bc5e6ef2cb54c177f32aa5726adaa15e7e2d59 # v3
|
||||
with:
|
||||
name: maven-artifacts
|
||||
path: .
|
||||
|
||||
- name: Log in to registry
|
||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_URL }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push (main)
|
||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: "${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/netneutrality:main"
|
||||
|
||||
docker-release:
|
||||
name: Docker Build and Push (release)
|
||||
runs-on: ubuntu-latest
|
||||
needs: package
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@a9bc5e6ef2cb54c177f32aa5726adaa15e7e2d59 # v3
|
||||
with:
|
||||
name: maven-artifacts
|
||||
path: .
|
||||
|
||||
- name: Compute release version
|
||||
id: rel
|
||||
shell: bash
|
||||
run: |
|
||||
# Strip leading 'v' if present (e.g., v1.2.3 -> 1.2.3)
|
||||
ver="${GITHUB_REF_NAME#v}"
|
||||
echo "version=$ver" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Log in to registry
|
||||
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_URL }}
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push (release + latest)
|
||||
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/netneutrality:${{ steps.rel.outputs.version }}
|
||||
${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USER }}/netneutrality:latest
|
||||
-101
@@ -1,101 +0,0 @@
|
||||
image: docker.io/library/eclipse-temurin:25-jdk-alpine@sha256:da683f4f02f9427597d8fa162b73b8222fe08596dcebaf23e4399576ff8b037e
|
||||
|
||||
variables:
|
||||
MAVEN_OPTS: >-
|
||||
-Dhttps.protocols=TLSv1.2
|
||||
-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository
|
||||
-Dorg.slf4j.simpleLogger.showDateTime=true
|
||||
-Djava.awt.headless=true
|
||||
|
||||
MAVEN_CLI_OPTS: >-
|
||||
--batch-mode
|
||||
--errors
|
||||
--fail-at-end
|
||||
--show-version
|
||||
--no-transfer-progress
|
||||
-DinstallAtEnd=true
|
||||
-DdeployAtEnd=true
|
||||
|
||||
cache:
|
||||
key: ${CI_PROJECT_NAME}-${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- .m2/repository
|
||||
- .mvn
|
||||
policy: pull-push
|
||||
|
||||
stages:
|
||||
- compile
|
||||
- test
|
||||
- package
|
||||
- docker-build
|
||||
|
||||
compile:
|
||||
stage: compile
|
||||
script:
|
||||
- "chmod +x ./mvnw"
|
||||
- "./mvnw $MAVEN_CLI_OPTS compile"
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
- if: '$CI_COMMIT_BRANCH == "main"'
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
|
||||
test:
|
||||
stage: test
|
||||
script:
|
||||
- "chmod +x ./mvnw"
|
||||
- "./mvnw $MAVEN_CLI_OPTS test"
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
junit:
|
||||
- "**/target/*-reports/TEST-*.xml"
|
||||
codequality:
|
||||
- "target/gl-code-quality-report.json"
|
||||
rules:
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
- if: '$CI_COMMIT_BRANCH == "main"'
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
|
||||
package:
|
||||
stage: package
|
||||
script:
|
||||
- "chmod +x ./mvnw"
|
||||
- "./mvnw $MAVEN_CLI_OPTS package -DskipTests=true"
|
||||
artifacts:
|
||||
name: "Maven artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
|
||||
paths:
|
||||
- target/netneutrality.jar
|
||||
- startup.sh
|
||||
expire_in: 1 week
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "main"'
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
|
||||
docker-build-main:
|
||||
stage: docker-build
|
||||
image: quay.io/buildah/stable
|
||||
needs:
|
||||
- job: package
|
||||
artifacts: true
|
||||
script:
|
||||
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
|
||||
- buildah bud -f Dockerfile -t $CI_REGISTRY_IMAGE:main .
|
||||
- buildah push $CI_REGISTRY_IMAGE:main
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "main"'
|
||||
|
||||
docker-build-release:
|
||||
stage: docker-build
|
||||
image: quay.io/buildah/stable
|
||||
needs:
|
||||
- job: package
|
||||
artifacts: true
|
||||
script:
|
||||
- export RELEASE_VERSION="${CI_COMMIT_TAG#v}"
|
||||
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
|
||||
- buildah bud -f Dockerfile -t $CI_REGISTRY_IMAGE:$RELEASE_VERSION .
|
||||
- buildah push $CI_REGISTRY_IMAGE:$RELEASE_VERSION
|
||||
- buildah tag $CI_REGISTRY_IMAGE:$RELEASE_VERSION $CI_REGISTRY_IMAGE:latest
|
||||
- buildah push $CI_REGISTRY_IMAGE:latest
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG'
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
wrapperVersion=3.3.4
|
||||
distributionType=only-script
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.14/apache-maven-3.9.14-bin.zip
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM docker.io/library/eclipse-temurin:25-jre@sha256:0a9c973778b03b88f39ccae4f8cc26022d84a3237a818cb98770369eb6c5daf9
|
||||
FROM eclipse-temurin:25-jre@sha256:ff82c74a630c08b417502c4c18189e62074edbb28eb1f2d31b799ac138c01058
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends netcat-openbsd curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ services:
|
||||
- MARIADB_AUTO_UPGRADE=1
|
||||
|
||||
netneutrality-bot:
|
||||
image: registry.bobert.me/anthorob/netneutrality:${NETNEUTRALITY_TAG:-latest}
|
||||
image: gitea.bobert.me/anthorob/netneutrality:${NETNEUTRALITY_TAG:-latest}
|
||||
container_name: bot
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
|
||||
@@ -119,20 +119,6 @@
|
||||
<outputFormat>xml</outputFormat>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>de.chkal.maven</groupId>
|
||||
<artifactId>gitlab-code-quality-plugin</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
Reference in new issue
Block a user