File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,24 @@ variables:
77 DOCKER_BASE_IMAGE : $CI_REGISTRY_GO/haproxy-alpine
88 BATS_VERSION : v1.4.1
99
10+ diff :
11+ stage : lint
12+ image :
13+ name : $CI_REGISTRY_GO/docker:stable-go1.17
14+ entrypoint : [ "" ]
15+ services :
16+ - name : $CI_REGISTRY_GO/docker:20.10.5-dind
17+ alias : docker
18+ tags :
19+ - go
20+ script :
21+ # - apk add make curl bash jq
22+ - SWAGGER_VERSION=$(curl -s https://raw.githubusercontent.com/haproxytech/client-native/master/Makefile | grep SWAGGER_VERSION -m 1 | awk -F"=" '{print $2}')
23+ - wget -q "https://github.com/go-swagger/go-swagger/releases/download/${SWAGGER_VERSION}/swagger_linux_amd64" -O /usr/local/bin/swagger && chmod +x /usr/local/bin/swagger
24+ - make generate-native
25+ - test -z "$(git diff 2> /dev/null)" || exit "Specification is not generated, issue \`make swagger\` and commit the result"
26+ - test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "Specification generation created untracked files, cannot proceed"
27+
1028golangci-lint :
1129 stage : lint
1230 artifacts :
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ generate:
3434 --build-arg UID=$(shell id -u) \
3535 --build-arg GID=$(shell id -g) \
3636 -t dataplaneapi-swagger-gen .
37- docker run --rm -it - v " $( PWD) " :/data dataplaneapi-swagger-gen
37+ docker run --rm -v " $( PWD) " :/data dataplaneapi-swagger-gen
3838 generate/post_swagger.sh
3939
4040.PHONY : generate-native
Original file line number Diff line number Diff line change 1717# check if version is there, if not, use one from require
1818[ -z " $CN_VERSION " ] && CN_VERSION=$( go mod edit -json | jq -c -r ' .Require | .[] | select(.Path | contains("github.com/haproxytech/client-native/v2")) | .Version' 2> /dev/null | awk -F" -" ' {print $NF}' )
1919echo " ---> version of client native used: $CN_VERSION "
20-
2120# extract repository
2221REPO_PATH=$( go mod edit -json | jq -r ' .Replace | .[] | select(.Old.Path | contains("github.com/haproxytech/client-native/v2")) | .New.Path' 2> /dev/null | awk -F" /" ' {print $2 "/" $3}' ) || " "
2322[ -z " $REPO_PATH " ] && REPO_PATH=haproxytech/client-native
@@ -41,6 +40,7 @@ if [ "$REMOTE_VERSION" = "null" ]; then
4140else
4241 echo " ---> URL path: $URL_PATH "
4342 echo " ---> repository path: $REPO_PATH "
43+ echo " ---> client native version: $CN_VERSION "
4444 SPEC_URL=https://$URL_PATH /$REPO_PATH /$EXTRA_PATH$CN_VERSION /specification
4545
4646 echo " ---> fetching specification: $SPEC_URL /build/haproxy_spec.yaml"
You can’t perform that action at this time.
0 commit comments