Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add load-pkg to the makefile and add the development guide link to README #361

Merged
merged 6 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,49 @@ go.cachedir:
go.mod.cachedir:
@go env GOMODCACHE

.PHONY: cobertura reviewable submodules fallthrough go.mod.cachedir go.cachedir run crds.clean $(TERRAFORM_PROVIDER_SCHEMA)
DEP_CONSTRAINT ?= >= 0.0.0
ifeq (-,$(findstring -,$(VERSION)))
DEP_CONSTRAINT = >= 0.0.0-0
endif
load-pkg: $(UP) build.all
turkenf marked this conversation as resolved.
Show resolved Hide resolved
turkenf marked this conversation as resolved.
Show resolved Hide resolved
@$(INFO) Loading the family providers into the Docker daemon: $(SUBPACKAGES)
@for p in $(PLATFORMS); do \
mkdir -p "$(XPKG_OUTPUT_DIR)/$$p"; \
done
@$(UP) xpkg batch --smaller-providers $$(echo -n "$(SUBPACKAGES) config" | tr ' ' ',') \
--family-base-image $(BUILD_REGISTRY)/$(PROJECT_NAME) \
--platform $(BATCH_PLATFORMS) \
--provider-name $(PROJECT_NAME) \
--family-package-url-format $(XPKG_REG_ORGS)/%s:$(VERSION) \
--package-repo-override monolith=$(PROJECT_NAME) --package-repo-override config=provider-family-$(PROVIDER_NAME) \
--provider-bin-root $(OUTPUT_DIR)/bin \
--output-dir $(XPKG_OUTPUT_DIR) \
--store-packages $$(echo -n "$(SUBPACKAGES) config" | tr ' ' ',') \
--build-only=true \
--examples-root $(ROOT_DIR)/examples \
--examples-group-override monolith=* --examples-group-override config=providerconfig \
--auth-ext $(ROOT_DIR)/package/auth.yaml \
--crd-root $(ROOT_DIR)/package/crds \
--crd-group-override monolith=* --crd-group-override config=$(PROVIDER_NAME) \
--package-metadata-template $(ROOT_DIR)/package/crossplane.yaml.tmpl \
--template-var XpkgRegOrg=$(XPKG_REG_ORGS) --template-var DepConstraint="$(DEP_CONSTRAINT)" --template-var ProviderName=$(PROVIDER_NAME) \
--push-retry 10 || $(FAIL)

@for p in $(PLATFORMS); do \
docker tag $$(docker load -qi $(XPKG_OUTPUT_DIR)/$$p/$(PROJECT_NAME)-config-$(VERSION).xpkg | awk -F: '{print $$3}') $(XPKG_REG_ORGS)/provider-family-$(PROVIDER_NAME)-$${p#"linux_"}:$(VERSION); \
echo Loaded the provider package "provider-family-$(PROVIDER_NAME)-$${p#"linux_"}:$(VERSION)" into the Docker daemon; \
for s in $(SUBPACKAGES); do \
if [ "$$s" = "config" ]; then \
continue; \
fi; \
docker tag $$(docker load -qi $(XPKG_OUTPUT_DIR)/$$p/$(PROJECT_NAME)-$$s-$(VERSION).xpkg | awk -F: '{print $$3}') $(XPKG_REG_ORGS)/$(PROJECT_NAME)-$$s-$${p#"linux_"}:$(VERSION); \
turkenf marked this conversation as resolved.
Show resolved Hide resolved
echo Loaded the provider package "$(PROJECT_NAME)-$$s-$${p#"linux_"}:$(VERSION)" into the Docker daemon; \
done \
done

@$(OK) Loaded the family providers into the Docker daemon: $(SUBPACKAGES)

.PHONY: cobertura reviewable submodules fallthrough go.mod.cachedir go.cachedir run crds.clean $(TERRAFORM_PROVIDER_SCHEMA) load-pkg

build.init: kustomize-crds

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ If you'd like to learn how to use Upjet, see [Usage Guide](https://github.com/cr

Follow the guide [here](https://github.com/crossplane/upjet/blob/v0.10.0/docs/add-new-resource-short.md).

### Local Development

For building provider images locally, follow the guide [here](https://github.com/upbound/upjet/blob/main/docs/buliding-provider-images.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For building provider images locally, follow the guide [here](https://github.com/upbound/upjet/blob/main/docs/buliding-provider-images.md).
For building provider images locally, follow the guide [here](https://github.com/upbound/upjet/blob/main/docs/building-provider-images.md).


## Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please
Expand Down
Loading