Closed jastang closed 1 year ago
Updates the build machinery to build bundled provider packages, as well as publish to crossplane-contrib OCI repos in both DockerHub and Upbound registries.
xref https://github.com/crossplane/crossplane/issues/3350 I have:
make reviewable test
Build
➜ provider-alibaba git:(master) ✗ VERSION=v0.6.1 make build.all 14:45:24 [ .. ] verify go modules dependencies have expected content all modules verified 14:45:25 [ OK ] go modules dependencies verified 14:45:26 [ .. ] go build linux_amd64 github.com/crossplane-contrib/provider-alibaba/cmd/provider 14:45:31 [ OK ] go build linux_amd64 14:45:31 [ .. ] go build linux_arm64 github.com/crossplane-contrib/provider-alibaba/cmd/provider 14:45:33 [ OK ] go build linux_arm64 14:45:34 [ .. ] docker build build-6e69288a/provider-alibaba-amd64 [+] Building 1.4s (7/7) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 308B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for gcr.io/distroless/static@sha256:1f580b0a1922c3e54ae15b0758b5747b260bd99d39d40c2edb3e7f6e2452298b 0.3s => [internal] load build context 0.8s => => transferring context: 46.35MB 0.8s => CACHED [1/2] FROM gcr.io/distroless/static@sha256:1f580b0a1922c3e54ae15b0758b5747b260bd99d39d40c2edb3e7f6e2452298b 0.0s => [2/2] ADD bin/linux_amd64/provider /usr/local/bin/crossplane-alibaba-provider 0.1s => exporting to image 0.1s => => exporting layers 0.1s => => writing image sha256:6366772df099e0d51b5569839e9d80e73052ad0d538e3514f6a8ef4d16f47ef6 0.0s => => naming to docker.io/build-6e69288a/provider-alibaba-amd64 0.0s 14:45:36 [ OK ] docker build build-6e69288a/provider-alibaba-amd64 14:45:36 [ .. ] Building package provider-alibaba-v0.6.1.xpkg for linux_amd64 xpkg saved to /Users/jasontang/workspace/provider-alibaba/_output/xpkg/linux_amd64/provider-alibaba-v0.6.1.xpkg 14:45:38 [ OK ] Built package provider-alibaba-v0.6.1.xpkg for linux_amd64 14:45:39 [ .. ] docker build build-6e69288a/provider-alibaba-arm64 [+] Building 1.2s (7/7) FINISHED => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 308B 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for gcr.io/distroless/static@sha256:1f580b0a1922c3e54ae15b0758b5747b260bd99d39d40c2edb3e7f6e2452298b 0.0s => [internal] load build context 0.9s => => transferring context: 45.23MB 0.9s => CACHED [1/2] FROM gcr.io/distroless/static@sha256:1f580b0a1922c3e54ae15b0758b5747b260bd99d39d40c2edb3e7f6e2452298b 0.0s => [2/2] ADD bin/linux_arm64/provider /usr/local/bin/crossplane-alibaba-provider 0.1s => exporting to image 0.1s => => exporting layers 0.1s => => writing image sha256:eada3efcb6c37c2d1ffc4e8e9d39f6d6fe133b2099e5d59b6a5745b51cf489ef 0.0s => => naming to docker.io/build-6e69288a/provider-alibaba-arm64 0.0s 14:45:40 [ OK ] docker build build-6e69288a/provider-alibaba-arm64 14:45:40 [ .. ] Building package provider-alibaba-v0.6.1.xpkg for linux_arm64 xpkg saved to /Users/jasontang/workspace/provider-alibaba/_output/xpkg/linux_arm64/provider-alibaba-v0.6.1.xpkg 14:45:42 [ OK ] Built package provider-alibaba-v0.6.1.xpkg for linux_arm64
Publish
➜ provider-alibaba git:(master) ✗ VERSION=v0.6.1 BRANCH_NAME=master make -j2 publish 14:51:33 [ .. ] Pushing package xpkg.upbound.io/jastang/provider-alibaba:v0.6.1 14:51:34 [ .. ] Skipping image publish for docker.io/provider-alibaba:v0.6.1 Publish is deferred to xpkg machinery 14:51:34 [ OK ] Image publish skipped for docker.io/provider-alibaba:v0.6.1 xpkg pushed to xpkg.upbound.io/jastang/provider-alibaba:v0.6.1 14:51:47 [ OK ] Pushed package xpkg.upbound.io/jastang/provider-alibaba:v0.6.1
Verify
➜ provider-alibaba git:(master) ✗ crane manifest xpkg.upbound.io/jastang/provider-alibaba:v0.6.1 | jq . { "schemaVersion": 2, "manifests": [ { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 1006, "digest": "sha256:b2f50ecfb500cf179010de9a1fef294ce587f1258b914b99e11cfbb255be5d7b", "platform": { "architecture": "amd64", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 1006, "digest": "sha256:5d6b240d98e2dcba0dc05e1b4bfcd047aeb7fd46610343a1b25a54536ac04fcb", "platform": { "architecture": "arm64", "os": "linux" } } ] }
Description of your changes
Updates the build machinery to build bundled provider packages, as well as publish to crossplane-contrib OCI repos in both DockerHub and Upbound registries.
xref https://github.com/crossplane/crossplane/issues/3350 I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Build
Publish
Verify