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:
7
7
DOCKER_BASE_IMAGE : $CI_REGISTRY_GO/haproxy-alpine
8
8
BATS_VERSION : v1.4.1
9
9
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
+
10
28
golangci-lint :
11
29
stage : lint
12
30
artifacts :
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ generate:
34
34
--build-arg UID=$(shell id -u) \
35
35
--build-arg GID=$(shell id -g) \
36
36
-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
38
38
generate/post_swagger.sh
39
39
40
40
.PHONY : generate-native
Original file line number Diff line number Diff line change 17
17
# check if version is there, if not, use one from require
18
18
[ -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}' )
19
19
echo " ---> version of client native used: $CN_VERSION "
20
-
21
20
# extract repository
22
21
REPO_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}' ) || " "
23
22
[ -z " $REPO_PATH " ] && REPO_PATH=haproxytech/client-native
@@ -41,6 +40,7 @@ if [ "$REMOTE_VERSION" = "null" ]; then
41
40
else
42
41
echo " ---> URL path: $URL_PATH "
43
42
echo " ---> repository path: $REPO_PATH "
43
+ echo " ---> client native version: $CN_VERSION "
44
44
SPEC_URL=https://$URL_PATH /$REPO_PATH /$EXTRA_PATH$CN_VERSION /specification
45
45
46
46
echo " ---> fetching specification: $SPEC_URL /build/haproxy_spec.yaml"
You can’t perform that action at this time.
0 commit comments