diff --git a/deploy.sh b/deploy.sh index 49bf129e4..9ff0badd2 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,8 @@ #!/bin/bash +# shellcheck source=scripts/build_step.inc.sh +source "$(dirname "${0}")/scripts/build_step.inc.sh" + push_helm_charts() { PACKAGE=$1 VERSION=${ENV_CSI_IMAGE_VERSION//v/} # Set version (without v prefix) @@ -60,6 +63,7 @@ build_push_images() { manifests=$(docker manifest inspect "${baseimg}" | jq '.manifests[] | {arch: .platform.architecture, digest: .digest}') # qemu-user-static is to enable an execution of different multi-architecture containers by QEMU # more info at https://github.com/multiarch/qemu-user-static + build_step "docker run multiarch/qemu-user-static container" docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # build and push per arch images for ARCH in amd64 arm64; do @@ -68,7 +72,9 @@ build_push_images() { digest=$(awk -v ARCH=${ARCH} '{if (archfound) {print $NF; exit 0}}; {archfound=($0 ~ "arch.*"ARCH)}' <<<"${manifests}") IFS=$ifs base_image=${baseimg}@${digest} + build_step "make push-image-cephcsi for ${ARCH}" GOARCH=${ARCH} BASE_IMAGE=${base_image} make push-image-cephcsi + build_step_log "done: make push-image-cephcsi for ${ARCH} (ret=${?})" done } @@ -80,6 +86,7 @@ else fi if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then + build_step "log in to quay.io as user ${QUAY_IO_USERNAME}" "${CONTAINER_CMD:-docker}" login -u "${QUAY_IO_USERNAME}" -p "${QUAY_IO_PASSWORD}" quay.io set -xe @@ -89,15 +96,20 @@ if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then mkdir -p tmp pushd tmp >/dev/null + build_step "installing helm" curl https://raw.githubusercontent.com/helm/helm/master/scripts/get >get_helm.sh chmod 700 get_helm.sh ./get_helm.sh + build_step "cloning ceph/csi-charts repository" git clone https://github.com/ceph/csi-charts mkdir -p csi-charts/docs popd >/dev/null + build_step "pushing RBD helm charts" push_helm_charts rbd + build_step "pushing CephFS helm charts" push_helm_charts cephfs + build_step_log "finished deployment!" fi