Skip to content
Merged
Changes from all 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
31 changes: 28 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ update:
exit 1; \
fi
@echo "Updating service: $(SERVICE)"
@echo "Step 1: Updating SDK package..."
@go get -u github.com/equinix/equinix-sdk-go/services/$(SERVICE)
@echo "Step 1: Fetching SDK package..."
@go get $$(go list -f '{{.Path}}@{{.Version}}' -m github.com/equinix/equinix-sdk-go)
@go mod tidy
@echo ""
@echo "Step 2: Extracting SDK descriptions..."
Expand Down Expand Up @@ -99,4 +99,29 @@ onboard:
@echo "2. Add service-specific aliases in cmd/$(SERVICE).go if desired"
@echo "3. Run 'make build' to verify the integration"
@echo "4. Run 'make docs' to generate documentation"
@echo "5. Update README.md with information about the new service"
@echo "5. Update README.md with information about the new service"

# generate-all - Onboard/update all service integrations by fetching latest SDK
# and looping over all services that exist in the SDK
# Usage: make generate-all
# This will:
# 1. Update the SDK package to the latest version
# 2. Extract SDK descriptions and save to cmd/descriptions/<service>.json
generate-all:
@echo "Generating all services"
@echo "Step 1: Fetching SDK package..."
@go get $$(go list -f '{{.Path}}@{{.Version}}' -m github.com/equinix/equinix-sdk-go)
@go mod tidy
@echo ""
@echo "Step 2: Onboarding all service packages in the SDK..."
@mkdir -p cmd/descriptions
@SDK_PATH=$$(go list -f '{{.Dir}}' -m github.com/equinix/equinix-sdk-go)/services; \
if [ -z "$$SDK_PATH" ] || [ ! -d "$$SDK_PATH" ]; then \
echo "Error: Could not find SDK path for services"; \
echo "Make sure github.com/equinix/equinix-sdk-go/services is a valid module"; \
exit 1; \
fi; \
SERVICES=$$(ls -1 $$SDK_PATH); \
for SERVICE in $$SERVICES; do \
$(MAKE) onboard SERVICE=$$SERVICE; \
done;