-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.json
130 lines (130 loc) · 7.22 KB
/
package.json
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{
"name": "does-it-scale",
"version": "5.0.0",
"description": "hobby experiment playing with EKS",
"main": "dist/server.js",
"scripts": {
"start-local": "node -r source-map-support/register dist/server.js --abort-on-uncaught-exception",
"start": "npm run docker-build && docker run --name $npm_package_name --rm -P $npm_package_name",
"stop": "docker stop $npm_package_name",
"lint": "eslint",
"build": "tsc --build --verbose",
"test": "jest --coverage --verbose",
"clean": "rm -rfv dist/",
"deploy": "npm run docker-build && npm run docker-push",
"docker-build": ". ./.env && docker build . -t $npm_package_name:$npm_package_version -t $npm_package_name:latest -t $ECR/$npm_package_name:$npm_package_version -t $ECR/$npm_package_name:latest",
"docker-push": ". ./.env && docker push $ECR/$npm_package_name:$npm_package_version",
"ecr-login": ". ./.env && aws ecr get-login-password --region $ECR_REGION | docker login --username AWS --password-stdin $ECR_HOST",
"common": "echo \"===============FETCH COMMON COMPONENTS SCRIPTS ===============\"",
"get-common": "npm run get-ambassador-crds && npm run get-ambassador-rbac && npm run get-metrics-server && npm run get-ca",
"get-ambassador-crds": "curl -sL https://www.getambassador.io/yaml/ambassador/ambassador-crds.yaml > k8s/common/02_ambassador_proxy/ambassador-crds.yml",
"get-ambassador-rbac": "curl -sL https://www.getambassador.io/yaml/ambassador/ambassador-rbac.yaml > k8s/common/02_ambassador_proxy/ambassador-rbac.yml",
"get-metrics-server": "curl -sL https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml > k8s/common/00_metrics_server/components.yml",
"get-ca": "curl -sL https://raw.githubusercontent.com/kubernetes/autoscaler/master/cluster-autoscaler/cloudprovider/aws/examples/cluster-autoscaler-autodiscover.yaml > k8s/common/01_cluster_autoscaler/cluster-autscaler-autodiscover.yml",
"dkr": "echo \"===============DOCKER SCRIPTS ===============\"",
"dkr-start": "npm run docker-build && docker run --name $npm_package_name -d --rm -p 3000:80 $npm_package_name",
"dkr-test": "API_HOST=localhost API_PORT=3000 jest --verbose -i test/api.spec.ts",
"dkr-stop": "docker stop $npm_package_name",
"k8s": "echo \"===============KUBERNETES SCRIPTS===============\"",
"k8s-deploy": "npm run docker-build",
"k8s-start-common": "kubectl --context='docker-desktop' apply -f k8s/common/ && kubectl --context='docker-desktop' wait --for=condition=ready pods -l service=ambassador --timeout=300s",
"k8s-start-local": "kubectl --context='docker-desktop' apply -f k8s/local/ && kubectl --context='docker-desktop' wait --for=condition=ready pods -l app=myapi --timeout=300s",
"k8s-start": "npm run k8s-start-common && npm run k8s-start-local",
"k8s-test": "env API_HOST=myapi-service telepresence --context docker-desktop --run jest --verbose -i test/api.spec.ts",
"k8s-stop": "npm run k8s-stop-local && npm run k8s-stop-common",
"k8s-stop-local": "kubectl --context='docker-desktop' delete -f k8s/local/ --wait",
"k8s-stop-common": "kubectl --context='docker-desktop' delete -f k8s/common/ --wait && kubectl --context='docker-desktop' wait --for=delete pods -l service=ambassador --timeout=120s",
"eks": "echo \"===============EKS SCRIPTS===============\"",
"eks-start-cluster": "eksctl create cluster -f eks/cluster-managed.yml",
"eks-iam-get-role": "aws iam list-roles | xargs -0 node -e \"console.log(JSON.parse(process.argv[1])['Roles'].filter((r)=>(r['RoleName'].startsWith('eksctl-my-managed-cluster-nodegro')))[0]['RoleName'])\"",
"eks-iam-get-service-role": "aws iam list-roles | xargs -0 node -e \"console.log(JSON.parse(process.argv[1])['Roles'].filter((r)=>(r['RoleName'].startsWith('eksctl-my-managed-cluster-cluster')))[0]['RoleName'])\"",
"eks-deploy": "npm run deploy",
"eks-start-hpa": "kubectl apply -f k8s/common/00_metrics_server/",
"eks-start-ca": "kubectl apply -f k8s/common/01_cluster_autoscaler/",
"eks-start-common": "kubectl apply -f k8s/common/02_ambassador_proxy/ && kubectl wait --for=condition=ready pods -l service=ambassador --timeout=90s",
"eks-start-cloud": "kubectl apply -f k8s/cloud/ && kubectl wait --for=condition=ready pods -l app=myapi --timeout=90s",
"eks-start": "npm run eks-start-cluster && npm run eks-start-common && npm run eks-start-cloud",
"eks-test": "env API_HOST=$(kubectl get svc ambassador -o \"go-template={{range .status.loadBalancer.ingress}}{{or .ip .hostname}}{{end}}\") jest --verbose -i test/api.spec.ts",
"eks-stop-cloud": "kubectl delete -f k8s/cloud/ --wait",
"eks-stop-common": "kubectl delete -f k8s/common/02_ambassador_proxy/ && kubectl wait --for=delete pods -l service=ambassador --timeout=120s",
"eks-stop-ca": "kubectl delete -f k8s/common/00_metrics_server/ -f k8s/common/01_cluster_autoscaler/",
"eks-stop-cluster": "eksctl delete cluster -f eks/cluster-managed.yml --wait",
"eks-stop": "npm run eks-stop-cloud && npm run eks-stop-common && npm run eks-stop-cluster",
"ci": "echo \"===============CONTINUOUS INTEGRATION SCRIPTS===============\"",
"ci-app": "npm run clean && npm run lint && npm run build && npm run test",
"ci-dkr": "npm run dkr-start && npm run dkr-test; npm run dkr-stop",
"ci-k8s": "npm run k8s-start && npm run k8s-test; npm run k8s-stop",
"ci-eks": "npm run eks-start && npm run eks-test; npm run eks-stop",
"monitor": "ts-node scripts/monitor.ts"
},
"jest": {
"verbose": true,
"testEnvironment": "node",
"testTimeout": 120000,
"globals": {
"ts-jest": {
"tsconfig": "./test/tsconfig.json"
}
},
"displayName": "integration",
"preset": "ts-jest",
"testMatch": [
"<rootDir>/test/**/*.spec.ts",
"<rootDir>/src/**/*.spec.ts"
],
"coverageThreshold": {
"global": {
"lines": 75,
"statements": 75,
"functions": 75,
"branches": 66
}
},
"collectCoverageFrom": [
"src/**/*.ts",
"!src/**/*.d.ts",
"!src/**/*.spec.ts"
],
"coveragePathIgnorePatterns": [
"src/server.ts",
"src/scripts"
]
},
"author": "Josh Peak <neozenith.dev@gmail.com>",
"license": "MIT",
"devDependencies": {
"@influxdata/influxdb-client": "^1.24.0",
"@types/express": "^4.17.8",
"@types/jest": "^26.0.15",
"@types/log4js": "^2.3.5",
"@types/mongoose": "^5.7.36",
"@types/node": "^14.14.5",
"@types/shelljs": "^0.8.8",
"@types/supertest": "^2.0.10",
"@types/throng": "^4.0.2",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"eslint": "^7.12.0",
"eslint-config-prettier": "^6.14.0",
"eslint-config-standard": "^15.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.2",
"jest": "^26.6.1",
"prettier": "^2.1.2",
"shelljs": "^0.8.4",
"supertest": "^6.0.0",
"ts-jest": "^26.4.3",
"ts-node": "^9.1.1",
"typescript": "^4.0.5"
},
"dependencies": {
"express": "^4.17.1",
"log4js": "^6.3.0",
"mongoose": "^5.10.11",
"source-map-support": "^0.5.19",
"throng": "^5.0.0"
}
}