From d91f455373a08d25491f700ac2527901b755d943 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Fri, 24 May 2024 11:13:58 -0400 Subject: [PATCH] USe regsync --- .github/workflows/sync-registry.yaml | 11 ++++++++--- build-scripts/hack/regsync-config.yaml | 5 +++++ build-scripts/hack/regsync.sh | 4 ++++ build-scripts/hack/skopeo-sync.sh | 9 --------- 4 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 build-scripts/hack/regsync-config.yaml create mode 100755 build-scripts/hack/regsync.sh delete mode 100755 build-scripts/hack/skopeo-sync.sh diff --git a/.github/workflows/sync-registry.yaml b/.github/workflows/sync-registry.yaml index e90d13706..853fff014 100644 --- a/.github/workflows/sync-registry.yaml +++ b/.github/workflows/sync-registry.yaml @@ -8,8 +8,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Login to GHCR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Sync registry.k8s.io to ghcr.io/canonical - env: - DEST_CREDS: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} run: | - ${GITHUB_WORKSPACE}/build-scripts/hack/skopeo-sync.sh + ${GITHUB_WORKSPACE}/build-scripts/hack/regsync.sh diff --git a/build-scripts/hack/regsync-config.yaml b/build-scripts/hack/regsync-config.yaml new file mode 100644 index 000000000..caa4d3419 --- /dev/null +++ b/build-scripts/hack/regsync-config.yaml @@ -0,0 +1,5 @@ +version: 1 +sync: + - source: quay.io/skopeo/stable:v1.15.0 + target: ghcr.io/canonical/stable:v1.15.0 + type: image diff --git a/build-scripts/hack/regsync.sh b/build-scripts/hack/regsync.sh new file mode 100755 index 000000000..46f23d01d --- /dev/null +++ b/build-scripts/hack/regsync.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +go install github.com/regclient/regclient/cmd/regsync@latest +regsync once -c regsync-config.yaml diff --git a/build-scripts/hack/skopeo-sync.sh b/build-scripts/hack/skopeo-sync.sh deleted file mode 100755 index f9e56648e..000000000 --- a/build-scripts/hack/skopeo-sync.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -docker run -v ./skopeo-config.yaml:/config.yaml quay.io/skopeo/stable:v1.15 sync \ - --src yaml \ - --dest docker \ - /config.yaml ghcr.io/canonical \ - --format oci \ - --all \ - --dest-creds "${DEST_CREDS}"