forked from timosalm/tap-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-additional-dev-space.sh
executable file
·62 lines (54 loc) · 1.42 KB
/
create-additional-dev-space.sh
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
#!/bin/bash
set -e
set -u
set -o pipefail
if [ -z "$1" ]
then
echo "No argument for the developer namespace supplied"
exit 1
fi
# base everything relative to the directory of this script file
script_dir="$(cd $(dirname "$BASH_SOURCE[0]") && pwd)"
values_file_default="${script_dir}/values.yaml"
values_file=${VALUES_FILE:-$values_file_default}
DEVELOPER_NAMESPACE=${1}
kapp deploy \
--app "tap-dev-ns-${DEVELOPER_NAMESPACE}" \
--namespace tap-install \
--file <(\
kubectl create namespace "${DEVELOPER_NAMESPACE}" \
--dry-run=client \
--output=yaml \
--save-config \
) \
--yes
./configure-dev-space.sh $DEVELOPER_NAMESPACE
cat <<EOF | kapp deploy --yes --app "tap-dev-ns-${DEVELOPER_NAMESPACE}-grype" --namespace tap-install --into-ns tap-install --file -
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall
metadata:
name: ${DEVELOPER_NAMESPACE}-grype
spec:
serviceAccountName: tap-install-sa
packageRef:
refName: grype.scanning.apps.tanzu.vmware.com
versionSelection:
constraints: ">=0.0.0"
prereleases:
identifiers: [beta, build]
values:
- secretRef:
name: ${DEVELOPER_NAMESPACE}-grype-values
---
apiVersion: v1
kind: Secret
metadata:
name: ${DEVELOPER_NAMESPACE}-grype-values
stringData:
values.yaml: |
---
namespace: ${DEVELOPER_NAMESPACE}
scanner:
pullSecret: ""
targetImagePullSecret: registry-credentials
EOF