Skip to content

Commit

Permalink
chore: add rockcraft as oci-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornplusplus committed Oct 2, 2024
1 parent b729cde commit 317bab3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions make_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -166,7 +172,7 @@ seed_repository() {
else
break
fi
done
done
}

wait_for_dpkg() {
Expand Down

0 comments on commit 317bab3

Please sign in to comment.