Don't build/publish minideb in GCR

Signed-off-by: Carlos Rodriguez Hernandez <carlosrh@vmware.com>
This commit is contained in:
Carlos Rodriguez Hernandez 2022-06-29 21:20:45 +00:00
parent cea4415cf6
commit f864c9f5cb
No known key found for this signature in database
GPG Key ID: 100ECB0F58E45C4A
4 changed files with 0 additions and 42 deletions

View File

@ -62,9 +62,6 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GCR_EMAIL: ${{ secrets.GCR_EMAIL }}
GCR_KEY: ${{ secrets.GCR_KEY }}
GCR_TOKEN: ${{ secrets.GCR_TOKEN }}
DOCKER_CONTENT_TRUST_REPOSITORY_KEY: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_KEY }}
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
run: |
@ -83,9 +80,6 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GCR_EMAIL: ${{ secrets.GCR_EMAIL }}
GCR_KEY: ${{ secrets.GCR_KEY }}
GCR_TOKEN: ${{ secrets.GCR_TOKEN }}
DOCKER_CONTENT_TRUST_REPOSITORY_KEY: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_KEY }}
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }}
steps:

10
pushall
View File

@ -10,16 +10,11 @@ bullseye
DISTS_WITH_SNAPSHOT="buster"
LATEST=bullseye
BASENAME=bitnami/minideb
GCR_BASENAME=gcr.io/bitnami-containers/minideb
if [ -n "${DOCKER_PASSWORD:-}" ]; then
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
fi
if [ -n "${GCR_KEY:-}" ]; then
gcloud auth activate-service-account "$GCR_EMAIL" --key-file <(echo "$GCR_KEY")
fi
ENABLE_DOCKER_CONTENT_TRUST=0
if [ -n "${DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE:-}" ] && [ -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY:-}" ]; then
tmpdir=$(mktemp -d)
@ -33,11 +28,9 @@ fi
push() {
local dist="$1"
DOCKER_CONTENT_TRUST=${ENABLE_DOCKER_CONTENT_TRUST} docker push "${BASENAME}:${dist}"
gcloud docker -- push "${GCR_BASENAME}:${dist}"
}
for DIST in $DISTS; do
docker tag "${BASENAME}:${DIST}" "${GCR_BASENAME}:${DIST}"
push "$DIST"
done
@ -46,14 +39,11 @@ if [ -f "build/snapshot_id" ]; then
for DIST in $DISTS_WITH_SNAPSHOT; do
TAG="${DIST}-snapshot-${snapshot_id}"
docker tag "${BASENAME}:${TAG}" "${GCR_BASENAME}:${TAG}"
push "${TAG}"
done
fi
docker tag "${BASENAME}:${LATEST}" "${BASENAME}:latest"
docker tag "${GCR_BASENAME}:${LATEST}" "${GCR_BASENAME}:latest"
push latest

View File

@ -11,7 +11,6 @@ latest
DISTS_WITH_SNAPSHOT=${DISTS_WITH_SNAPSHOT:-buster}
BASENAME=bitnami/minideb
GCR_BASENAME=gcr.io/bitnami-containers/minideb
PLATFORMS=${PLATFORMS:-amd64 arm64}
DRY_RUN=${DRY_RUN:-}
SNAPSHOT_ID=${SNAPSHOT_ID:-}
@ -44,13 +43,6 @@ if [ -n "${DOCKER_PASSWORD:-}" ]; then
echo "$DOCKER_PASSWORD" | run_docker login -u "$DOCKER_USERNAME" --password-stdin
fi
if [ -n "${GCR_KEY:-}" ]; then
gcloud auth activate-service-account "$GCR_EMAIL" --key-file <(echo "$GCR_KEY")
gcloud auth print-access-token | run_docker login -u oauth2accesstoken --password-stdin gcr.io
elif [ -n "${GCR_TOKEN:-}" ]; then
echo "${GCR_TOKEN:-}" | run_docker login -u oauth2accesstoken --password-stdin gcr.io
fi
push_manifest() {
local image=""
local archs=""
@ -75,12 +67,6 @@ done
repositories=("$BASENAME")
if [[ -n "${GCR_KEY:-}" || -n "${GCR_TOKEN:-}" ]]; then
repositories+=("$GCR_BASENAME")
else
echo "Skipping repository gcr.io (empty password)"
fi
for tag in "${tags[@]}"; do
for repo in "${repositories[@]}"; do
push_manifest "$repo:$tag" "${ARCHS[@]}"

12
pushone
View File

@ -8,19 +8,11 @@ DIST=${1:?Specify the distrubution name}
PLATFORM=${2:-amd64}
BASENAME=bitnami/minideb
GCR_BASENAME=gcr.io/bitnami-containers/minideb
if [ -n "${DOCKER_PASSWORD:-}" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
if [ -n "${GCR_KEY:-}" ]; then
gcloud auth activate-service-account "$GCR_EMAIL" --key-file <(echo "$GCR_KEY")
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin gcr.io
elif [ -n "${GCR_TOKEN:-}" ]; then
echo "${GCR_TOKEN:-}" | docker login -u oauth2accesstoken --password-stdin gcr.io
fi
ENABLE_DOCKER_CONTENT_TRUST=0
if [ -n "${DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE:-}" ] && [ -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY:-}" ]; then
tmpdir=$(mktemp -d)
@ -34,10 +26,6 @@ fi
push() {
local dist="$1"
DOCKER_CONTENT_TRUST=${ENABLE_DOCKER_CONTENT_TRUST} docker push "${BASENAME}:${dist}"
docker push "${GCR_BASENAME}:${dist}"
}
docker tag "${BASENAME}:${DIST}-${PLATFORM}" "${GCR_BASENAME}:${DIST}-${PLATFORM}"
push "$DIST-${PLATFORM}"