mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
copy container tag to generate stable with crane to avoid flattening image
This commit is contained in:
parent
dbad475254
commit
6e7c177157
1 changed files with 14 additions and 11 deletions
|
@ -91,7 +91,7 @@ variables:
|
||||||
# -- jobs ------------------------------------------------------------
|
# -- jobs ------------------------------------------------------------
|
||||||
|
|
||||||
android:
|
android:
|
||||||
image: golang:1.23-$DEBIAN_STABLE
|
image: containers.torproject.org/tpo/anti-censorship/duplicatedcontainerimages:golang-1.23-$DEBIAN_STABLE
|
||||||
variables:
|
variables:
|
||||||
ANDROID_HOME: /usr/lib/android-sdk
|
ANDROID_HOME: /usr/lib/android-sdk
|
||||||
LANG: C.UTF-8
|
LANG: C.UTF-8
|
||||||
|
@ -156,7 +156,7 @@ debian-testing:
|
||||||
- *go-test
|
- *go-test
|
||||||
|
|
||||||
shadow-integration:
|
shadow-integration:
|
||||||
image: golang:1.21-$DEBIAN_STABLE
|
image: containers.torproject.org/tpo/anti-censorship/duplicatedcontainerimages:golang-1.21-$DEBIAN_STABLE
|
||||||
variables:
|
variables:
|
||||||
SHADOW_VERSION: "193924aae0dab30ffda0abe29467f552949849fa"
|
SHADOW_VERSION: "193924aae0dab30ffda0abe29467f552949849fa"
|
||||||
TGEN_VERSION: "v1.1.2"
|
TGEN_VERSION: "v1.1.2"
|
||||||
|
@ -279,7 +279,7 @@ release-job:
|
||||||
url: '${CI_PROJECT_URL}/-/jobs/${TAR_JOB_ID}/artifacts/file/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz'
|
url: '${CI_PROJECT_URL}/-/jobs/${TAR_JOB_ID}/artifacts/file/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.gz'
|
||||||
|
|
||||||
# Build the container only if the commit is to main, or it is a tag.
|
# Build the container only if the commit is to main, or it is a tag.
|
||||||
# If the commit is to main, then the docker image tag should be set to `latest`.
|
# If the commit is to main, then the docker image tag should be set to `nightly`.
|
||||||
# If it is a tag, then the docker image tag should be set to the tag name.
|
# If it is a tag, then the docker image tag should be set to the tag name.
|
||||||
build-container:
|
build-container:
|
||||||
variables:
|
variables:
|
||||||
|
@ -314,7 +314,7 @@ merge-manifests:
|
||||||
- job: build-container
|
- job: build-container
|
||||||
artifacts: false
|
artifacts: false
|
||||||
image:
|
image:
|
||||||
name: mplatform/manifest-tool:alpine
|
name: containers.torproject.org/tpo/anti-censorship/duplicatedcontainerimages:mplatform-manifest-tool-alpine
|
||||||
entrypoint: [""]
|
entrypoint: [""]
|
||||||
script:
|
script:
|
||||||
- if [ $CI_COMMIT_REF_NAME == "main" ]; then export TAG='nightly'; fi
|
- if [ $CI_COMMIT_REF_NAME == "main" ]; then export TAG='nightly'; fi
|
||||||
|
@ -332,23 +332,24 @@ merge-manifests:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
when: always
|
when: always
|
||||||
|
|
||||||
# If this is a tag, then we want to additionally tag the image as `stable`
|
# If this is a tag, then we want to additionally tag the image as `latest`
|
||||||
tag-container-release:
|
tag-container-release:
|
||||||
stage: container-build
|
stage: container-build
|
||||||
needs:
|
needs:
|
||||||
- job: merge-manifests
|
- job: merge-manifests
|
||||||
artifacts: false
|
artifacts: false
|
||||||
image: quay.io/podman/stable
|
image:
|
||||||
|
name: gcr.io/go-containerregistry/crane:debug
|
||||||
|
entrypoint: [""]
|
||||||
allow_failure: false
|
allow_failure: false
|
||||||
variables:
|
variables:
|
||||||
|
CI_REGISTRY: $CI_REGISTRY
|
||||||
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
|
||||||
RELEASE_TAG: $CI_REGISTRY_IMAGE:latest
|
RELEASE_TAG: $CI_REGISTRY_IMAGE:latest
|
||||||
script:
|
script:
|
||||||
- echo "Tagging docker image with stable tag"
|
- echo "Tagging docker image with stable tag with crane"
|
||||||
- echo -n "$CI_JOB_TOKEN" | podman login -u gitlab-ci-token --password-stdin $CI_REGISTRY
|
- echo -n "$CI_JOB_TOKEN" | crane auth login $CI_REGISTRY -u gitlab-ci-token --password-stdin
|
||||||
- podman pull $IMAGE_TAG || true
|
- crane cp $IMAGE_TAG $RELEASE_TAG
|
||||||
- podman tag $IMAGE_TAG $RELEASE_TAG
|
|
||||||
- podman push $RELEASE_TAG
|
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
when: always
|
when: always
|
||||||
|
@ -376,6 +377,8 @@ mirror-image-to-dockerhub:
|
||||||
needs:
|
needs:
|
||||||
- job: clean-image-tags
|
- job: clean-image-tags
|
||||||
artifacts: false
|
artifacts: false
|
||||||
|
- job: tag-container-release
|
||||||
|
artifacts: false
|
||||||
variables:
|
variables:
|
||||||
DOCKERHUB_MIRROR_REPOURL: $DOCKERHUB_MIRROR_REPOURL
|
DOCKERHUB_MIRROR_REPOURL: $DOCKERHUB_MIRROR_REPOURL
|
||||||
DOCKERHUB_USERNAME: $DOCKERHUB_MIRROR_USERNAME
|
DOCKERHUB_USERNAME: $DOCKERHUB_MIRROR_USERNAME
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue