-
Notifications
You must be signed in to change notification settings - Fork 1
/
app-full-demo.sh
128 lines (84 loc) · 3.51 KB
/
app-full-demo.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
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
#!/bin/bash
########################
# include the magic
########################
. demo-magic.sh
########################
# Configure the options
########################
#
# speed at which to simulate typing. bigger num = faster
#
TYPE_SPEED=15
#
# custom prompt
#
# see http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html for escape sequences
#
#DEMO_PROMPT="${GREEN}➜ ${CYAN}\W "
# hide the evidence
clear
DEMO_PROMPT="${GREEN}➜ TAP ${CYAN}\W "
p "show all tap clusters "
pei "kubectl config get-contexts"
p "login to build cluster"
read -p "Enter build cluster context : " build_context
pei "kubectl config use-context ${build_context}"
p "Show Tanzu Application Platform(TAP) Build cluster Packages "
pei "tanzu package installed list -A"
p "Enter App Name "
read -p "App Name: " app_name
p "Enter App git url "
read -p "Git App Url: " git_app_url
echo
p "List apps workloads "
pei "tanzu apps workload list"
p "Delete all existing app workloads "
pei "tanzu apps workload delete --all"
echo
p "List apps workloads "
pei "tanzu apps workload list"
echo
p "Create ${app_name} workload config yaml"
pei "tanzu apps workload create ${app_name} --git-repo ${git_app_url} --git-branch main --git-tag tap-1.0 --type web --label app.kubernetes.io/part-of=${app_name} --yes --dry-run"
echo
p "Execute ${app_name} workload "
pei "tanzu apps workload create ${app_name} --git-repo ${git_app_url} --git-branch main --git-tag tap-1.0 --type web --label app.kubernetes.io/part-of=${app_name} --yes"
echo
p " ${app_name} deploy logs "
pei "tanzu apps workload tail ${app_name} --since 10m --timestamp"
echo
clear
p "List apps workloads "
pei "tanzu apps workload list"
echo
p " ${app_name} workload details "
pei "tanzu apps workload get ${app_name}"
p " Generate ${app_name} delivery yaml "
pei "kubectl get deliverables ${app_name} -o yaml | yq 'del(.status)' | yq 'del(.metadata.ownerReferences)' | yq 'del(.metadata.resourceVersion)' | yq 'del(.metadata.uid)' > ${app_name}-delivery.yaml"
p "show all tap clusters "
pei "kubectl config get-contexts"
p "login to Run cluster"
read -p "Enter build cluster context : " run_context
pei "kubectl config use-context ${run_context}"
p "Show Tanzu Application Platform(TAP) Run cluster Packages "
pei "tanzu package installed list -A"
p "check existing app status"
pei "kubectl get deliverables ${app_name}"
p "delete already existing app"
pei "kubectl delete deliverables ${app_name}"
p "deploy ${app_name} deliverable into run cluster"
pei "kubectl apply -f ${app_name}-delivery.yaml"
p "check app status"
pei "kubectl get deliverables ${app_name}"
p "get app url"
pei "kubectl get all -A | grep route.serving.knative"
p "show all tap clusters "
pei "kubectl config get-contexts"
p "login to ui cluster"
read -p "Enter build cluster context : " ui_context
pei "kubectl config use-context ${ui_context}"
p "Show Tanzu Application Platform(TAP) UI cluster Packages "
pei "tanzu package installed list -A"
p "open tap-gui url and register entiry app. Provide app catelog_info.yaml path for register entiry into tap-gui. "
133,0-1 Bot