-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
68 lines (61 loc) · 2.56 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
---
version: "3"
tasks:
login:
desc: Logins into AWS ECR registry to allow pull required images from it
cmds:
- aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 754489498669.dkr.ecr.eu-central-1.amazonaws.com
bootstrap:
desc: Bootstraps dashboard with an organization and user
cmds:
- sleep 8
- ./dash-bootstrap.sh http://localhost:3000
- sleep 8
local:
desc: Deploys infrastructure locally using docker compose manifest
env:
FLAVOUR: '{{ or .FLAVOUR "pro" }}'
DB: '{{ or .DB "mongo44" }}'
CACHE: '{{ or .CACHE "redis6" }}'
VARIATION: '{{or .VARIATION "murmur64" }}'
confs_dir: './{{ .FLAVOUR }}'
env_file: local-{{.DB}}.env
cmds:
- |
git checkout -f confs/${VARIATION}.env
cat "confs/${VARIATION}.env" "${env_file}" | sort -u > tmp.env
mv tmp.env ${env_file}
docker compose -p auto -f ${FLAVOUR}.yml -f deps_${FLAVOUR}.yml -f ${DB}.yml -f ${CACHE}.yml --env-file master.env --profile master-datacenter up --quiet-pull -d --build
if [[ "${FLAVOUR}" == "pro-ha" ]];then
task bootstrap
docker compose -p auto -f pro-ha.yml -f deps_pro-ha.yml -f ${DB}.yml -f ${CACHE}.yml --env-file master.env --profile slave-datacenter up --quiet-pull -d --build
fi
clean:
desc: Tears down all local infrastructure including networking
env:
FLAVOUR: '{{ or .FLAVOUR "pro" }}'
DB: '{{ or .DB "mongo44" }}'
CACHE: '{{ or .CACHE "redis6" }}'
VARIATION: '{{or .VARIATION "murmur64" }}'
confs_dir: './{{ .FLAVOUR }}'
env_file: local-{{.DB}}.env
cmds:
- docker compose -p auto -f ${FLAVOUR}.yml -f deps_${FLAVOUR}.yml -f ${DB}.yml -f ${CACHE}.yml --env-file master.env --env-file master.env --profile all down --remove-orphans
- docker volume prune -f
pytest:
desc: |
Deploys pytest container that runs against local infrastructure using docker compose manifest
- For mdcb you may want to use the ARGS "--ci -m "mdcb""
- For non mdcb deployments something like "-m "not local and not mdcb""
cmds:
- |
docker run --rm --network auto_default --env-file ./pytest.env \
754489498669.dkr.ecr.eu-central-1.amazonaws.com/tyk-automated-tests:master \
pytest -c pytest_ci.ini {{.CLI_ARGS}}
healthcheck:
desc: Usefull healthchecks to ensure services are up and running
cmds:
- echo "---Gateway Status---"
- curl -s --fail -k https://"{{.HOST}}":8080/hello
vars:
HOST: localhost