-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.sh
executable file
·152 lines (126 loc) · 2.4 KB
/
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
. ./color.rc
run() {
echo "$Yellow--demo run >>${NC}$BIGreen $@ ${NC}"
sleep 0.5
$@
echo "$Blue--step completed--${NC}"
read
}
runcat() {
echo "$Yellow--demo run >>${NC}$Green $@ ${NC}"
echo "-----------------------------"
$@
echo "-----------------------------"
echo "$Blue--step completed--${NC}"
read
}
info() {
msg=$1
echo "$Green $msg ${NC}\n"
}
pause(){
sleep 1000
}
alias l='ls -alrtG'
# alias cls='clear'
alias cls='printf "\033c"'
cls
info "demo1: create upcmd task skeleton using init command"
info "upcmd usage"
run 'up'
run 'mkdir -p demo'
# sleep 0.2
run cd demo
# sleep 0.2
info "use init command to create a skeleton task and configuration as a start"
run up init
echo "."
l
cls
info "upcmd configuration file(optional)"
runcat highlight upconfig.yml
# sleep 1
info "the skeleton task file"
runcat highlight up.yml
# sleep 0.6
info "hello world! skeleton task execution"
run up ngo
# sleep 1
# pause
# sleep 100
run cd ..
rm -rf ./demo
cls
info "demo2: show the intro demo code and execution"
info "task configuration:"
read
runcat highlight demo.yml
run cp demo.yml up.yml
info "Main task execution"
read
cls
run up ngo
read
# sleep 2
info "run task in verbose levle: vvv to reveal more information"
read
cls
up ngo -v vvv
read
# sleep 2
cls
info "list all task"
run up list
# sleep 2
info "inspect a task"
run up list Main
# sleep 2
echo ".."
cls
info "validate a task will make a dry run without actual execution"
read
up validate Main
# sleep 2
read
cls
info "demo3: use module"
read
cd module-demo
run tree -I .git -a
info "task refers to external module call"
read
runcat highlight up.yml
info "the config with required module settings"
run highlight upconfig.yml
read
cls
info "module sub command as mod"
run up mod --help
info "list all modules"
run up mod list
info "pull defined modules"
run up mod pull
run tree -I .git -a
info "now freeze and lock the modules' versions"
run up mod lock
read
cls
info "probe cmd lists all modules, including the main direct modules and the all indirect modules"
up mod probe
cls
info "task execution to run a module call provided by others"
up ngo
rm -rf ./.upmodules
rm ./modlock.yml
cd ..
read
cls
info "demo4: color print and test driven ..."
run cp assert.yml up.yml
info "task configuration"
runcat highlight up.yml
cls
info "task execution"
run up ngo
info "demo n: please refer to the documentation site for more information"
info "Thank you!"