mirror of
https://github.com/democratic-csi/democratic-csi.git
synced 2026-10-17 17:18:18 +02:00
include missing PATH for iscsiadm chroot, update PATH for other docker tools, build/push windows images
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
echo "$DOCKER_PASSWORD" | docker login docker.io -u "$DOCKER_USERNAME" --password-stdin
|
||||
echo "$GHCR_PASSWORD" | docker login ghcr.io -u "$GHCR_USERNAME" --password-stdin
|
||||
|
||||
export DOCKER_ORG="democraticcsi"
|
||||
export DOCKER_PROJECT="democratic-csi"
|
||||
export DOCKER_REPO="docker.io/${DOCKER_ORG}/${DOCKER_PROJECT}"
|
||||
|
||||
export GHCR_ORG="democratic-csi"
|
||||
export GHCR_PROJECT="democratic-csi"
|
||||
export GHCR_REPO="ghcr.io/${GHCR_ORG}/${GHCR_PROJECT}"
|
||||
|
||||
export MANIFEST_NAME="democratic-csi-combined:${IMAGE_TAG}"
|
||||
|
||||
if [[ -n "${IMAGE_TAG}" ]]; then
|
||||
# create local manifest to work with
|
||||
buildah manifest rm "${MANIFEST_NAME}" || true
|
||||
buildah manifest create "${MANIFEST_NAME}"
|
||||
|
||||
# all all the existing linux data to the manifest
|
||||
buildah manifest add "${MANIFEST_NAME}" --all "${DOCKER_REPO}:${IMAGE_TAG}"
|
||||
buildah manifest inspect "${MANIFEST_NAME}"
|
||||
|
||||
# import pre-built images
|
||||
buildah pull docker-archive:democratic-csi-windows-ltsc2019.tar
|
||||
buildah pull docker-archive:democratic-csi-windows-ltsc2022.tar
|
||||
|
||||
# add pre-built images to manifest
|
||||
buildah manifest add "${MANIFEST_NAME}" democratic-csi-windows:${GITHUB_RUN_ID}-ltsc2019
|
||||
buildah manifest add "${MANIFEST_NAME}" democratic-csi-windows:${GITHUB_RUN_ID}-ltsc2022
|
||||
buildah manifest inspect "${MANIFEST_NAME}"
|
||||
|
||||
# push manifest
|
||||
buildah manifest push --all "${MANIFEST_NAME}" docker://${DOCKER_REPO}:${IMAGE_TAG}
|
||||
buildah manifest push --all "${MANIFEST_NAME}" docker://${GHCR_REPO}:${IMAGE_TAG}
|
||||
|
||||
# cleanup
|
||||
buildah manifest rm "${MANIFEST_NAME}" || true
|
||||
else
|
||||
:
|
||||
fi
|
||||
@@ -11,20 +11,8 @@ export GHCR_ORG="democratic-csi"
|
||||
export GHCR_PROJECT="democratic-csi"
|
||||
export GHCR_REPO="ghcr.io/${GHCR_ORG}/${GHCR_PROJECT}"
|
||||
|
||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||
export GIT_TAG=${GITHUB_REF#refs/tags/}
|
||||
else
|
||||
export GIT_BRANCH=${GITHUB_REF#refs/heads/}
|
||||
fi
|
||||
|
||||
if [[ -n "${GIT_TAG}" ]]; then
|
||||
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:${GIT_TAG} -t ${GHCR_REPO}:${GIT_TAG} .
|
||||
elif [[ -n "${GIT_BRANCH}" ]]; then
|
||||
if [[ "${GIT_BRANCH}" == "master" ]]; then
|
||||
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:latest -t ${GHCR_REPO}:latest .
|
||||
else
|
||||
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:${GIT_BRANCH} -t ${GHCR_REPO}:${GIT_BRANCH} .
|
||||
fi
|
||||
if [[ -n "${IMAGE_TAG}" ]]; then
|
||||
docker buildx build --progress plain --pull --push --platform "${DOCKER_BUILD_PLATFORM}" -t ${DOCKER_REPO}:${IMAGE_TAG} -t ${GHCR_REPO}:${IMAGE_TAG} .
|
||||
else
|
||||
:
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user