Skip to content

Commit

Permalink
cloud-api v0.29.0 (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Oct 2, 2024
1 parent 59a2681 commit b3b2e9b
Show file tree
Hide file tree
Showing 59 changed files with 5,501 additions and 257 deletions.
39 changes: 21 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
.ONESHELL:
CGO_ENABLED := $(or ${CGO_ENABLED},0)
GO := go
GO111MODULE := on
CLOUD_API_VERSION := $(or ${CLOUD_API_VERSION},$(shell curl -L "https://raw.githubusercontent.com/fi-ts/releases/develop/release.yaml" | yq e '.docker-images.metal-stack.extensions.cloud-api.tag' -))

release:: generate-client mocks gofmt test;

.PHONY: gofmt
gofmt:
GO111MODULE=off $(GO) fmt ./...

.PHONY: test
test:
CGO_ENABLED=1 $(GO) test ./... -coverprofile=coverage.out -covermode=atomic && go tool cover -func=coverage.out

.PHONY: generate-client
generate-client:
rm -rf api
mkdir -p api
yq e -ij ".info.version=\"${CLOUD_API_VERSION}\"" cloud-api.json
yq e '.info.version' cloud-api.json
docker pull metalstack/builder
docker run --user $$(id -u):$$(id -g) --rm -v ${PWD}:/work metalstack/builder swagger generate client -f cloud-api.json -t api --skip-validation
docker run --rm \
--user $$(id -u):$$(id -g) \
-v ${PWD}:/work \
metalstack/builder swagger generate client -f cloud-api.json -t api

.PHONY: mocks
mocks:
rm -rf test/mocks
docker run --user $$(id -u):$$(id -g) --rm -w /work -v ${PWD}:/work vektra/mockery:v2.46.1 -r --keeptree --inpackage --dir api/client --output test/mocks --all
go run ./test/client/generate/generate_mock_client.go

.PHONY: gofmt
gofmt:
go fmt ./...

.PHONY: test
test:
go test ./... -coverprofile=coverage.out -covermode=atomic && go tool cover -func=coverage.out

.PHONY: golangcicheck
golangcicheck:
Expand All @@ -27,8 +35,3 @@ golangcicheck:
.PHONY: lint
lint: golangcicheck
CGO_ENABLED=1 golangci-lint run

.PHONY: mocks
mocks:
rm -rf test/mocks
docker run --user $$(id -u):$$(id -g) --rm -w /work -v ${PWD}:/work vektra/mockery:v2.45.1 -r --keeptree --inpackage --dir api/client --output test/mocks --all
40 changes: 40 additions & 0 deletions api/client/accounting/accounting_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

150 changes: 150 additions & 0 deletions api/client/accounting/machine_reservation_usage_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3b2e9b

Please sign in to comment.