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

HCE-823: consolidate API pipeline actions/scripts #167

Merged
merged 10 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
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
85 changes: 0 additions & 85 deletions .github/workflows/publish-sdk.yml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/publish-shared-sdk.yml

This file was deleted.

48 changes: 0 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,51 +31,3 @@ go/lint:
test-ci: go/lint
go test -coverprofile=coverage.out -short ./...
go tool cover -html=coverage.out -o coverage.html

# args passed to sdk/update
commit=false

# This recipe pulls the latest specs for the given service in cloud-api and re-generates the service's go clients.
.PHONY: sdk/update # service=cloud-foo-service commit=true/false
sdk/update:
@if [ -z $(GITHUB_TOKEN) ]; then \
echo "ERROR: GITHUB_TOKEN is not set. Please ensure the token has 'repo' access and is SSO enabled." >&2; \
exit 1; \
fi

@if [ -z $(service) ]; then \
echo "ERROR: No service argument provided, please provide in the format 'service=...'" >&2; \
exit 1; \
fi

bash ./scripts/pull-specs.sh $(service);

@if [ $(service) = "cloud-shared" ]; then \
echo "Generating latest SDK for cloud-shared"; \
bash ./scripts/gen-go-shared-sdk.sh; \
else \
echo "Generating latest SDK for $(service)"; \
bash ./scripts/gen-go-service-sdk.sh $(service); \
fi

@if [ $(commit) = true ]; then \
./scripts/open-pr.sh $(service); \
fi

# This recipe pulls the specs for the given service from locally cloned cloud-api and re-generates the service's go clients.
.PHONY: sdk/update-local # service=cloud-foo-service
sdk/update-local:
@if [ -z $(service) ]; then \
echo "ERROR: No service argument provided, please provide in the format 'service=...'" >&2; \
exit 1; \
fi

bash ./scripts/pull-specs-local.sh $(service);

@if [ $(service) = "cloud-shared" ]; then \
echo "Generating latest SDK for cloud-shared"; \
bash ./scripts/gen-go-shared-sdk.sh; \
else \
echo "Generating latest SDK for $(service)"; \
bash ./scripts/gen-go-service-sdk.sh $(service); \
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ HCP_ORGANIZATION_ID="22abc..."

```bash
import (
network "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service"
network "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service"
)
```

Expand Down
2 changes: 1 addition & 1 deletion cmd/hcp-sdk-go-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"

consul "github.com/hashicorp/hcp-sdk-go/clients/cloud-consul-service/stable/2021-02-04/client/consul_service"
network "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/preview/2020-09-07/client/network_service"
network "github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/client/network_service"
"github.com/hashicorp/hcp-sdk-go/httpclient"
)

Expand Down
11 changes: 0 additions & 11 deletions cmd/transform-swagger/README.md

This file was deleted.

Loading