Skip to content

Commit

Permalink
HCE-823: consolidate API pipeline actions/scripts (#167)
Browse files Browse the repository at this point in the history
* Delete publish-sdk.yml

* Delete publish-shared-sdk.yml

* Delete gen-go-service-sdk.sh

* Delete gen-go-shared-sdk.sh

* Delete open-pr.sh

* Delete pull-specs-local.sh

* Delete pull-specs.sh

* remove generation make targets

* Delete cmd/transform-swagger directory

* bonus: bump cloud-network to stable
  • Loading branch information
bcmdarroch authored Mar 10, 2023
1 parent c920f18 commit 8144158
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 872 deletions.
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

0 comments on commit 8144158

Please sign in to comment.