File tree Expand file tree Collapse file tree 9 files changed +34
-123
lines changed Expand file tree Collapse file tree 9 files changed +34
-123
lines changed Original file line number Diff line number Diff line change 1
1
.DS_Store
2
- .env
3
- .gobincache /
2
+ /.env
Original file line number Diff line number Diff line change
1
+ # Already part of the project
2
+ /.gitignore
3
+ /api/openapi.yaml
4
+ /README.md
5
+
6
+ # Unwanted
7
+ /.travis.yml
8
+ /git_push.sh
Original file line number Diff line number Diff line change
1
+ generatorName : go
2
+
3
+ gitHost : github.com
4
+ gitUserId : netbox-community
5
+ gitRepoId : go-netbox/v3
6
+
7
+ packageName : netbox
8
+
9
+ additionalProperties :
10
+ disallowAdditionalPropertiesIfNotPresent : " false"
11
+ packageVersion : " 3"
Original file line number Diff line number Diff line change 1
- ARG GO_VERSION=1.20.1
2
- ARG ALPINE_VERSION=3.17
3
- ARG GOIMPORTS_VERSION=0.6.0
4
- ARG DELVE_VERSION=1.20.1
5
- ARG SWAGGER_VERSION=0.30.4
1
+ ARG GO_VERSION=1.21.0-alpine3.18
2
+ ARG GOIMPORTS_VERSION=0.12.0
3
+ ARG DELVE_VERSION=1.21.0
6
4
7
5
8
6
# # Base image
9
- FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
7
+ FROM golang:${GO_VERSION} AS base
10
8
11
9
WORKDIR /go/src/app
12
10
@@ -18,7 +16,6 @@ FROM base AS development
18
16
19
17
ARG GOIMPORTS_VERSION
20
18
ARG DELVE_VERSION
21
- ARG SWAGGER_VERSION
22
19
23
20
RUN apk add \
24
21
bash \
@@ -28,8 +25,7 @@ RUN apk add \
28
25
python3 \
29
26
zsh \
30
27
&& go install golang.org/x/tools/cmd/goimports@v${GOIMPORTS_VERSION} \
31
- && go install github.com/go-delve/delve/cmd/dlv@v${DELVE_VERSION} \
32
- && go install github.com/go-swagger/go-swagger/cmd/swagger@v${SWAGGER_VERSION}
28
+ && go install github.com/go-delve/delve/cmd/dlv@v${DELVE_VERSION}
33
29
34
30
ARG USER_ID=1000
35
31
ENV USER_NAME=default
Original file line number Diff line number Diff line change @@ -33,8 +33,10 @@ shell:
33
33
build :
34
34
$(EXEC ) ./scripts/set-versions.sh $(NETBOX_VERSION ) $(NETBOX_DOCKER_VERSION )
35
35
./scripts/fetch-spec.sh $$(cat api/netbox_version ) $$(cat api/netbox_docker_version )
36
- $(EXEC ) ./scripts/generate-code.sh
36
+ ./scripts/generate-code.sh
37
+ $(EXEC ) go mod tidy
38
+ $(EXEC ) goimports -w .
37
39
38
40
.PHONY : test
39
41
test :
40
- $(EXEC ) go test ./... -tags=integration
42
+ $(EXEC ) go test -v ./...
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
5
- export SRC_DIR=' ./netbox'
6
-
7
- # Prepare environment
8
- rm -rf netbox/client netbox/models
9
- go mod download
10
-
11
- # Run pre-generation hooks
12
- for SCRIPT in scripts/pre-generation/* ; do
13
- " ${SCRIPT} "
14
- done
15
-
16
- # Generate code
17
- swagger generate client -f api/openapi.json --target=" ${SRC_DIR} " --copyright-file=assets/copyright_header.txt
18
- go mod tidy
19
-
20
- # Run post-generation hooks
21
- for SCRIPT in scripts/post-generation/* ; do
22
- " ${SCRIPT} "
23
- done
24
-
25
- # Format generated code and fix imports
26
- goimports -w " ${SRC_DIR} "
5
+ docker run --rm -v " ${PWD} :/local" openapitools/openapi-generator-cli:v6.6.0 generate \
6
+ --config /local/.openapi-generator/config.yaml \
7
+ --input-spec /local/api/openapi.yaml \
8
+ --output /local \
9
+ --http-user-agent go-netbox/$( cat api/netbox_version)
You can’t perform that action at this time.
0 commit comments