Skip to content

Commit

Permalink
REORG/MINOR: make: unite make models and equal
Browse files Browse the repository at this point in the history
both needs to be executed always one after another, so it only make sense to have them more tightly coupled
  • Loading branch information
oktalz committed Dec 1, 2023
1 parent 4713bef commit f1632f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ generate:
- go
before_script:
- rm -rf models/*
- make models equal
- make models
script:
- test -z "$(git diff 2> /dev/null)" || exit "Models are not generated, issue \`make models equal\` and commit the result"
- test -z "$(git diff 2> /dev/null)" || exit "Models are not generated, issue \`make models\` and commit the result"
- test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "Models generation created untracked files, cannot proceed"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
Expand Down
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ e2e-docker:
spec:
go run specification/build/build.go -file specification/haproxy-spec.yaml > specification/build/haproxy_spec.yaml

.PHONY: equal
equal:
rm -rf models/*_compare.go
rm -rf models/*_compare_test.go
go run cmd/struct_equal_generator/*.go -l ${PROJECT_PATH}/specification/copyright.txt ${PROJECT_PATH}/models

.PHONY: models
models: spec swagger-check
./bin/swagger generate model --additional-initialism=FCGI -f ${PROJECT_PATH}/specification/build/haproxy_spec.yaml -r ${PROJECT_PATH}/specification/copyright.txt -m models -t ${PROJECT_PATH}
rm -rf models/*_compare.go
rm -rf models/*_compare_test.go
go run cmd/struct_equal_generator/*.go -l ${PROJECT_PATH}/specification/copyright.txt ${PROJECT_PATH}/models

.PHONY: swagger-check
swagger-check:
Expand Down

0 comments on commit f1632f3

Please sign in to comment.