diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 53651590c837..9aeeb5ea1fd4 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -58,6 +58,10 @@ jobs: addons: '["dns", "hostpath-storage", "rbac"]' launch-configuration: "$GITHUB_WORKSPACE/.github/microk8s-launch-config-aws.yaml" + - name: Setup rockcraft + run: | + sudo snap install rockcraft --classic + - name: Set up Go uses: actions/setup-go@v5 with: diff --git a/Makefile b/Makefile index e456983a6d1e..086198204776 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ OCI_IMAGE_PLATFORMS ?= linux/$(GOARCH) # Build tags passed to go install/build. # Passing no-dqlite will disable building with dqlite. # Example: BUILD_TAGS="minimal provider_kubernetes" -BUILD_TAGS ?= +BUILD_TAGS ?= # EXTRA_BUILD_TAGS is not passed in, but built up from context. EXTRA_BUILD_TAGS = @@ -566,7 +566,7 @@ check-deps: # CAAS related targets -export OCI_BUILDER ?= $(shell (which podman 2>&1 > /dev/null && echo podman) || echo docker ) +export OCI_BUILDER ?= $(shell (which rockcraft 2>&1 > /dev/null && echo rockcraft) || echo docker ) DOCKER_USERNAME ?= docker.io/jujusolutions DOCKER_BUILDX_CONTEXT ?= juju-make DOCKER_STAGING_DIR ?= ${BUILD_DIR}/docker-staging diff --git a/make_functions.sh b/make_functions.sh index c422bfa58ebb..a23c8f2b2b57 100755 --- a/make_functions.sh +++ b/make_functions.sh @@ -146,8 +146,14 @@ build_push_operator_image() { if [[ "$push_image" = true ]]; then "$DOCKER_BIN" manifest push -f v2s2 "$(operator_image_path)" "docker://$(operator_image_path)" fi + elif [[ "${OCI_BUILDER}" == "rockcraft" ]]; then + rockcraft pack -v + mv *.rock "${BUILD_DIR}/oci.tar.gz" + rockcraft.skopeo copy --insecure-policy \ + oci-archive:"${BUILD_DIR}/oci.tar.gz" \ + "docker-daemon:$(operator_image_path)" else - echo "unknown OCI_BUILDER=${OCI_BUILDER} expected docker or podman" + echo "unknown OCI_BUILDER=${OCI_BUILDER} expected docker, podman or rockcraft" exit 1 fi } @@ -166,7 +172,7 @@ seed_repository() { else break fi - done + done } wait_for_dpkg() {