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

Bump version 2.8.2 #16

Merged
merged 3 commits into from
Jun 21, 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
14 changes: 1 addition & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@ SWAGGER_VERSION=v0.30.3
SWAGGER := $(DOCKERCMD) run --rm -it -v $(HOME):$(HOME) -w $(shell pwd) quay.io/goswagger/swagger:$(SWAGGER_VERSION)

ifeq ($(VERSION),)
VERSION := v2.6.2
VERSION := v2.8.2
endif

HARBOR_ASSIST_SPEC=api/swagger.yaml
HARBOR_CLIENT_ASSIST_DIR=pkg/sdk/assist
HARBOR_ASSIST_SPEC_URL=https://raw.githubusercontent.com/goharbor/harbor/$(VERSION)/api/swagger.yaml

HARBOR_2.0_SPEC=api/v2.0/swagger.yaml
HARBOR_CLIENT_2.0_DIR=pkg/sdk/v2.0
HARBOR_2.0_SPEC_URL=https://raw.githubusercontent.com/goharbor/harbor/$(VERSION)/api/v2.0/swagger.yaml

HARBOR_2.0_LEGACY_SPEC=api/v2.0/legacy_swagger.yaml
HARBOR_CLIENT_2.0_LEGACY_DIR=pkg/sdk/v2.0/legacy
HARBOR_2.0_LEGACY_SPEC_URL=https://raw.githubusercontent.com/goharbor/harbor/$(VERSION)/api/v2.0/legacy_swagger.yaml

## --------------------------------------
## Help
## --------------------------------------
Expand All @@ -36,15 +28,11 @@ help: ## Display this help
.PHONY: update-spec
update-spec: ## update all swagger spec files
@echo "Downloading spec from Harbor with version: $(VERSION)"
@wget ${HARBOR_ASSIST_SPEC_URL} -O ${HARBOR_ASSIST_SPEC}
@wget ${HARBOR_2.0_SPEC_URL} -O ${HARBOR_2.0_SPEC}
@wget ${HARBOR_2.0_LEGACY_SPEC_URL} -O ${HARBOR_2.0_LEGACY_SPEC}

.PHONY: gen-harbor-api
gen-harbor-api: update-spec ## generate goswagger client for harbor
@$(SWAGGER) generate client -f ${HARBOR_ASSIST_SPEC} --target=$(HARBOR_CLIENT_ASSIST_DIR) --template=stratoscale --additional-initialism=CVE --additional-initialism=GC --additional-initialism=OIDC
@$(SWAGGER) generate client -f ${HARBOR_2.0_SPEC} --target=$(HARBOR_CLIENT_2.0_DIR) --template=stratoscale --additional-initialism=CVE --additional-initialism=GC --additional-initialism=OIDC
@$(SWAGGER) generate client -f ${HARBOR_2.0_LEGACY_SPEC} --target=$(HARBOR_CLIENT_2.0_LEGACY_DIR) --template=stratoscale --additional-initialism=CVE --additional-initialism=GC --additional-initialism=OIDC

.PHONY: test
test: ## run the test
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ api/

## Download swagger spec by version

Currently, the default Harbor version is `v2.5.0`.
Currently, the default Harbor version is `v2.8.2`.

*NOTE* Default version need to be updated manually inside [Makefile](Makefile)

Expand All @@ -29,13 +29,13 @@ make update-spec
To download swagger spec from previous Harbor version, add `VERSION` as an argument:

```sh
make update-spec VERSION=v2.5.0
make update-spec VERSION=v2.8.2
```

## Generate Clients

```sh
make gen-harbor-api VERSION=v2.5.0
make gen-harbor-api VERSION=v2.8.2
```

## Check all available make commands
Expand Down
Loading