forked from Vincinator/gl-pkg-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmirror-snapshot.sh
executable file
·30 lines (19 loc) · 1.06 KB
/
mirror-snapshot.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -x
SNAPSHOT_IMAGE_ARM=$1
SNAPSHOT_IMAGE_AMD=$2
TARGET_VERSION=$3
IMAGE_NAME="gardenlinux/debian-snapshot-container"
export DOCKER_CLI_EXPERIMENTAL=enabled
CUSTOM_CRE="docker"
echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
$CUSTOM_CRE pull $SNAPSHOT_IMAGE_ARM
$CUSTOM_CRE pull $SNAPSHOT_IMAGE_AMD
$CUSTOM_CRE tag $SNAPSHOT_IMAGE_ARM ghcr.io/$IMAGE_NAME:arm64-$TARGET_VERSION
$CUSTOM_CRE tag $SNAPSHOT_IMAGE_AMD ghcr.io/$IMAGE_NAME:amd64-$TARGET_VERSION
$CUSTOM_CRE push ghcr.io/$IMAGE_NAME:arm64-$TARGET_VERSION
$CUSTOM_CRE push ghcr.io/$IMAGE_NAME:amd64-$TARGET_VERSION
$CUSTOM_CRE manifest create ghcr.io/$IMAGE_NAME:$TARGET_VERSION ghcr.io/$IMAGE_NAME:arm64-$TARGET_VERSION ghcr.io/$IMAGE_NAME:amd64-$TARGET_VERSION
$CUSTOM_CRE manifest annotate ghcr.io/$IMAGE_NAME:$TARGET_VERSION ghcr.io/$IMAGE_NAME:arm64-$TARGET_VERSION --os linux --arch arm64
$CUSTOM_CRE manifest annotate ghcr.io/$IMAGE_NAME:$TARGET_VERSION ghcr.io/$IMAGE_NAME:amd64-$TARGET_VERSION --os linux --arch amd64
$CUSTOM_CRE manifest push ghcr.io/$IMAGE_NAME:$TARGET_VERSION