Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
add pr publish job for ci-unified
Browse files Browse the repository at this point in the history
  • Loading branch information
alvicsam committed Dec 13, 2023
1 parent ebb6cd6 commit af90bf0
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
52 changes: 50 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,58 @@ ci-linux:
- $BUILDAH_COMMAND push --format=v2s2 "$REGISTRY_PATH/$IMAGE_NAME:$VERSION_TAG"
- buildah logout "$REGISTRY_NAME"

ci-unified-pr-push:
variables:
IMAGE_NAME: "ci-unified"
RUST_STABLE_VERSION: "1.74.0"
RUST_NIGHTLY_VERSION: "2023-11-01"
REGISTRY_PATH: docker.io/paritypr
stage: build
image: $CI_IMAGE
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
changes:
paths:
- dockerfiles/${IMAGE_NAME}/**
compare_to: "master"
when: manual
before_script:
- dnf install -y git
script:
- DISTRO_CODENAME=$(grep 'DISTRO_CODENAME' dockerfiles/$IMAGE_NAME/Dockerfile | head -n 1 | cut -d '"' -f 2)
- PR_INFO="${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}"
- DATESTAMP=$(git log -1 --pretty=format:"%ad" --date=format:"%Y%m%d" -- dockerfiles/$IMAGE_NAME/Dockerfile)
- $BUILDAH_COMMAND build
--format=docker
--build-arg VCS_REF="$CI_COMMIT_SHA"
--build-arg BUILD_DATE="$(date +%Y%m%d)"
--build-arg REGISTRY_PATH="$REGISTRY_PATH"
--build-arg RUST_STABLE_VERSION="$RUST_STABLE_VERSION"
--build-arg RUST_NIGHTLY_VERSION="$RUST_NIGHTLY_VERSION"
--tag "$REGISTRY_PATH/$IMAGE_NAME:$PR_INFO-$DISTRO_CODENAME-$RUST_STABLE_VERSION"
--tag "$REGISTRY_PATH/$IMAGE_NAME:$PR_INFO-$DISTRO_CODENAME-$RUST_STABLE_VERSION-v$DATESTAMP"
--tag "$REGISTRY_PATH/$IMAGE_NAME:$PR_INFO-$DISTRO_CODENAME-$RUST_STABLE_VERSION-$RUST_NIGHTLY_VERSION"
--tag "$REGISTRY_PATH/$IMAGE_NAME:$PR_INFO-$DISTRO_CODENAME-$RUST_STABLE_VERSION-$RUST_NIGHTLY_VERSION-v$DATESTAMP"
--file "dockerfiles/$IMAGE_NAME/Dockerfile" dockerfiles
- $BUILDAH_COMMAND info
- echo "$PARITYPR_PASS" |
buildah login --username "$PARITYPR_USER" --password-stdin "$REGISTRY_NAME"
- $BUILDAH_COMMAND push --format=v2s2 "$REGISTRY_PATH/$IMAGE_NAME:$PR_INFO-$DISTRO_CODENAME-$RUST_STABLE_VERSION"
- $BUILDAH_COMMAND push --format=v2s2 "$REGISTRY_PATH/$IMAGE_NAME:$PR_INFO-$DISTRO_CODENAME-$RUST_STABLE_VERSION-v$DATESTAMP"
- $BUILDAH_COMMAND push --format=v2s2 "$REGISTRY_PATH/$IMAGE_NAME:$PR_INFO-$DISTRO_CODENAME-$RUST_STABLE_VERSION-$RUST_NIGHTLY_VERSION"
- $BUILDAH_COMMAND push --format=v2s2 "$REGISTRY_PATH/$IMAGE_NAME:$PR_INFO-$DISTRO_CODENAME-$RUST_STABLE_VERSION-$RUST_NIGHTLY_VERSION-v$DATESTAMP"
- buildah logout "$REGISTRY_NAME"
retry:
max: 2
when:
- always
tags:
- linux-docker-vm-c2

ci-unified:
variables:
RUST_STABLE_VERSION: "1.73.0"
RUST_NIGHTLY_VERSION: "2023-05-23"
RUST_STABLE_VERSION: "1.74.0"
RUST_NIGHTLY_VERSION: "2023-11-01"
<<: *docker_build
before_script:
- dnf install -y git
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/ci-unified/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM docker.io/library/debian:bookworm-20231120-slim

ARG DISTRO_CODENAME="bookworm"
ARG RESTIC_VERSION="0.16.1"
ARG RUST_STABLE_VERSION="1.73.0"
ARG RUST_STABLE_VERSION="1.74.0"
ARG RUST_NIGHTLY_VERSION="2023-11-01"
ARG LLVM_VERSION="15"
ARG MINIO_VERSION="2023-04-06T16-51-10Z"
Expand Down

0 comments on commit af90bf0

Please sign in to comment.