Compare commits

...

4 Commits

Author SHA1 Message Date
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
+7 -9
View File
@@ -1,6 +1,4 @@
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 DOCKER_HOST: unix:///var/run/docker.sock
@@ -24,7 +22,6 @@ build:
artifacts: artifacts:
paths: paths:
- build/libs/*.jar - build/libs/*.jar
expire_in: 30 min
rules: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
@@ -37,11 +34,12 @@ package:
- 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: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
@@ -51,9 +49,9 @@ deploy:
needs: needs:
- package - package
script: script:
- echo "Pushing image $REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG" - echo "Pushing image $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker login "$REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" - docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push "$REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG" - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker push "$REGISTRY/$IMAGE_NAME:latest" - docker push "$CI_REGISTRY_IMAGE:latest"
rules: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG