File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1010 "author" : " snyk.io" ,
1111 "main" : " dist/index.js" ,
1212 "scripts" : {
13+ "local" : " ./scripts/local-testing.sh" ,
1314 "pretest" : " ./scripts/docker/build-image.sh" ,
1415 "test" : " npm run lint && npm run build && npm run test:unit:tap && npm run test:unit:jest && npm run test:integration:kind:helm" ,
1516 "test:unit:tap" : " NODE_ENV=test tap test/unit/*.test.ts test/unit/**/*.test.ts --timeout=300" ,
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ get_latest_release () {
4+ curl --silent " https://api.github.com/repos/$1 /releases/latest" | # Get latest release from GitHub api
5+ grep ' "tag_name":' | # Get tag line
6+ sed -E ' s/.*"([^"]+)".*/\1/' | # Pluck JSON value
7+ sed ' s/v//' # Remove "v" prefix
8+ }
9+
10+ LATEST_TAG=$( get_latest_release snyk/kubernetes-monitor)
11+ IP=$( ifconfig | grep " inet " | grep -Fv 127.0.0.1 | awk ' NR==1{print $2}' )
12+
13+ if [ " $INTEGRATION_ID " == " " ]; then
14+ echo " Enter your integration ID: "
15+ read INTEGRATION_ID
16+ fi
17+
18+ kind delete cluster
19+ kind create cluster
20+ kubectl create namespace snyk-monitor
21+ kubectl create secret generic snyk-monitor -n snyk-monitor --from-literal=dockercfg.json={} --from-literal=integrationId=${INTEGRATION_ID}
22+ helm upgrade --install snyk-monitor ./snyk-monitor --namespace snyk-monitor --set clusterName=" kind localhost" --set image.tag=${LATEST_TAG} --set integrationApi=http://${IP} :9000
23+
24+ printf " \r\n\r\nYou can now check if the pod is running using:\r\n\tkubectl get pod -n snyk-monitor\r\n"
You can’t perform that action at this time.
0 commit comments