Compare commits

..

10 Commits

Author SHA1 Message Date
siujamo e4dca61f98 chore: merge CI stages into a single release job to optimize speed
Merge build, package, and deploy stages into a single 'release' job. By building
the jar and running docker commands in the same container using local docker socket,
we completely bypass the need for GitLab artifact uploading/downloading. This significantly
reduces network overhead and speeds up release deployment.
2026-05-25 15:43:23 +08:00
siujamo e7da3a76b7 ci: recover artefact uploading 2026-05-25 14:45:26 +08:00
siujamo 5cea825bc0 chore: remove gitlab artifacts to avoid slow uploads
Remove artifacts uploading from the build stage. Since we use a shared
docker socket on the same runner host, the package stage can access the
locally built jar file directly without needing gitlab coordinator upload/download.
2026-05-25 14:39:33 +08:00
siujamo bd2748e25c fix: disable provenance in docker build to fix GitLab Registry 0B display
Add `--provenance=false` flag to `docker build` command. This stops Docker BuildKit
from generating OCI Referrers/attestations, which are not correctly parsed by GitLab
Container Registry and cause the UI to display 0B size and "missing manifest digest" errors.
2026-05-25 13:58:14 +08:00
siujamo 0f1093774f fix: use GitLab predefined environment variables for container registry
Replace custom registry variables with GitLab's predefined CI_REGISTRY,
CI_REGISTRY_IMAGE, and CI_REGISTRY_USER to ensure the built-in CI_JOB_TOKEN
has correct push permissions.
2026-05-25 11:47:22 +08:00
siujamo d19b7f5563 fix: allow jar files to be copied in Docker build context
Add '!build/libs/*.jar' to .dockerignore so that Docker build can access the build
artifacts in the package stage.
2026-05-25 11:05:25 +08:00
siujamo ea1456c5a5 Merge branch 'develop' into 'main'
chore: switch CI to Docker socket binding and add artefact version parameter

See merge request onixbyte/delta-force-guide-server!2
2026-05-25 10:20:50 +08:00
siujamo b60cd36535 chore: switch CI to Docker socket binding and add artefact version parameter
Replace DinD services with unix:///var/run/docker.sock socket binding to
fix "Cannot connect to Docker daemon" errors. Add -PartefactVersion
parameter to Gradle build for release version tracking.
2026-05-25 10:17:33 +08:00
siujamo 1115cd4527 Merge branch 'develop' into 'main'
v1.3.0: Introduced Daily Password

See merge request onixbyte/delta-force-guide-server!1
2026-05-25 09:11:13 +08:00
zihluwang 6e6843c412 Merge pull request #1 from zihluwang/develop
Enhance Firearm model and add tag filtering to queries
2026-04-09 17:53:28 +08:00
2 changed files with 15 additions and 40 deletions
+2
View File
@@ -1,4 +1,6 @@
delta-force-guide-server.iml delta-force-guide-server.iml
build/ build/
!.gitlab-ci.yml
!build/libs/*.jar
.idea/ .idea/
.gradle .gradle
+13 -40
View File
@@ -1,15 +1,12 @@
variables: variables:
REGISTRY: registry.onixbyte.cn
IMAGE_NAME: delta-force-guide
GRADLE_OPTS: -Dorg.gradle.daemon=false GRADLE_OPTS: -Dorg.gradle.daemon=false
DOCKER_HOST: unix:///var/run/docker.sock
stages: stages:
- build - release
- package
- deploy
build: release:
stage: build stage: release
image: amazoncorretto:21-alpine image: amazoncorretto:21-alpine
cache: cache:
key: gradle key: gradle
@@ -18,45 +15,21 @@ build:
- .gradle/caches - .gradle/caches
before_script: before_script:
- chmod +x gradlew - chmod +x gradlew
- apk add --no-cache docker-cli
script: script:
- ./gradlew bootJar -x test - ./gradlew bootJar -x test -PartefactVersion="$CI_COMMIT_TAG"
artifacts:
paths:
- build/libs/*.jar
expire_in: 30 min
rules:
- if: $CI_COMMIT_TAG
package:
stage: package
image: docker:27
services:
- docker:27-dind
needs:
- build
script:
- JAR_FILE=$(find build/libs -name '*.jar' | head -1) - JAR_FILE=$(find build/libs -name '*.jar' | head -1)
- echo "Building Docker image for tag $CI_COMMIT_TAG with JAR $JAR_FILE" - echo "Building Docker image for tag $CI_COMMIT_TAG with JAR $JAR_FILE"
- docker build - docker build
--provenance=false
-f Dockerfile.ci -f Dockerfile.ci
--build-arg JAR_FILE="$JAR_FILE" --build-arg JAR_FILE="$JAR_FILE"
-t "$REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG" -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
. .
- docker tag "$REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG" "$REGISTRY/$IMAGE_NAME:latest" - docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" "$CI_REGISTRY_IMAGE:latest"
rules: - echo "Pushing image $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- if: $CI_COMMIT_TAG - docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
deploy: - docker push "$CI_REGISTRY_IMAGE:latest"
stage: deploy
image: docker:27
services:
- docker:27-dind
needs:
- package
script:
- echo "Pushing image $REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG"
- docker login "$REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push "$REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG"
- docker push "$REGISTRY/$IMAGE_NAME:latest"
rules: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG