forked from TykTechnologies/tyk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
83 lines (75 loc) · 3.96 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
version: "3"
includes:
deps: ./.taskfiles/deps/Taskfile.yml
tracetest: ./.taskfiles/tracetest/Taskfile.yml
tasks:
docker:
desc: "build Tyk gateway internal/tyk-gateway"
cmds:
- docker build --platform "linux/amd64" --rm -t internal/tyk-gateway .
sources:
- go.mod
- go.sum
- "./**/*.go"
test:plugin-compiler:
desc: "Plugin compiler local build/test"
cmds:
- docker build --build-arg GO_VERSION=1.19 --build-arg BASE_IMAGE=tykio/golang-cross:1.19-bullseye --build-arg GITHUB_TAG=v5.1.0-alpha18 --build-arg GITHUB_SHA=$(git rev-parse HEAD) --platform=linux/amd64 --rm -t internal/plugin-compiler -f ci/images/plugin-compiler/Dockerfile .
- docker run -it -e GOARCH=arm64 -e GOOS=linux --rm -v $(readlink -f .)/ci/images/plugin-compiler/data/basic-plugin:/plugin-source internal/plugin-compiler basic-plugin.so
- docker run -it --rm -v $PWD:/go/src/github.com/TykTechnologies/tyk -w /go/src/github.com/TykTechnologies/tyk tykio/golang-cross:1.19-bullseye go build -trimpath -tags=goplugin .
- ./tyk plugin load -f ./ci/images/plugin-compiler/data/basic-plugin/basic-plugin*.so -s MyPluginPre
- docker rmi internal/plugin-compiler
test:goreleaser:
desc: "Test goreleaser locally"
vars:
pluginTemp: /tmp/plugin-compiler.extra_paths
cmds:
- go list ./... | perl -p -e 's/.+tyk\///g' | grep -v github | perl -p -e 's/\/.+//g' | sort | uniq > {{.pluginTemp}}
- echo -e "go.mod\ngo.sum\nmain.go\nci/images/plugin-compiler" >> {{.pluginTemp}}
- |
set -x
replacement=$(cat {{.pluginTemp}} | paste -sd , - | sed -e 's/,/","/g')
yq -i ".dockers[4].extra_files |= [\"$replacement\"]" ci/goreleaser/goreleaser-5.0.yml
yq -i ".dockers[0].extra_files |= [\"$replacement\"]" ci/goreleaser/goreleaser-el7.yml
yq -i ".dockers[4].extra_files |= [\"$replacement\"]" ci/goreleaser/goreleaser.yml
- echo goreleaser release --clean --snapshot -f ci/goreleaser/goreleaser.yml
test:opentelemetry:setup:
desc: "setup e2e opentelemetry tests"
deps:
- tracetest
- docker
status:
- tracetest version
cmds:
- docker compose -f ci/tests/tracing/docker-compose.yml up -d
- tracetest configure -g --endpoint http://localhost:11633
test:opentelemetry:test:
desc: "run e2e opentelemetry tests"
deps:
- test:opentelemetry:setup
cmds:
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_test_200.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_test_500.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_testauth_401.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_tykprotocol_200.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_tykprotocol-auth_401.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_grpcapi_200.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_versioned_200.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_versioned_403.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_versioned_not_detailed_200.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_versioned_not_detailed_403.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_test-graphql-tracing_200.yml -w -o pretty
- tracetest test run -d ./ci/tests/tracing/scenarios/tyk_test-graphql-tracing-invalid_404.yml -w -o pretty
test:opentelemetry:teardown:
desc: "teardown e2e opentelemetry tests enviroment"
cmds:
- docker compose -f ci/tests/tracing/docker-compose.yml down --remove-orphans
test:opentelemetry:
desc: "setup, execute and shutdown e2e opentelemetry tests"
cmds:
- |
set -e
task test:opentelemetry:setup
trap 'task test:opentelemetry:teardown' EXIT
task test:opentelemetry:test