File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,12 @@ SKIP_UPLOAD="false"
27
27
28
28
function detect() {
29
29
local v
30
- REGISTRY=$( kubectl get productbases.product.alauda.io base -o jsonpath=' {.spec.registry.address}' --ignore-not-found)
31
- v=$( kubectl get secrets -n cpaas-system registry-admin -o jsonpath=' {.data.username}' --ignore-not-found)
30
+ REGISTRY=$( kubectl get productbases.product.alauda.io base -o jsonpath=' {.spec.registry.address}' --ignore-not-found || : )
31
+ v=$( kubectl get secrets -n cpaas-system registry-admin -o jsonpath=' {.data.username}' --ignore-not-found || : )
32
32
if [ -n " ${v} " ]; then
33
33
USERNAME=$( echo " ${v} " | base64 -d)
34
34
fi
35
- v=$( kubectl get secrets -n cpaas-system registry-admin -o jsonpath=' {.data.password}' --ignore-not-found)
35
+ v=$( kubectl get secrets -n cpaas-system registry-admin -o jsonpath=' {.data.password}' --ignore-not-found || : )
36
36
if [ -n " ${v} " ]; then
37
37
PASSWORD=$( echo " ${v} " | base64 -d)
38
38
fi
@@ -70,12 +70,17 @@ function apply_resources() {
70
70
71
71
function apply_hooks() {
72
72
local hooks
73
- hooks=$( ls " ${HOOKS_DIR} /" * .sh)
73
+ # When the hook script does not exist, ensure that it can run normally.
74
+ hooks=$( ls " ${HOOKS_DIR} /" * .sh || :)
74
75
for it in ${hooks} ; do
75
76
bash " ${it} "
76
77
done
77
78
}
78
79
80
+ function success() {
81
+ echo " setup success"
82
+ }
83
+
79
84
function parse_args() {
80
85
if [ " $# " -eq " 0" ]; then
81
86
return
@@ -104,7 +109,8 @@ function parse_args() {
104
109
shift
105
110
;;
106
111
--skip-upload)
107
- SKIP_UPLOAD=" true"
112
+ SKIP_UPLOAD=" $2 "
113
+ shift
108
114
;;
109
115
* )
110
116
if [ -n " $1 " ]; then
@@ -124,3 +130,4 @@ parse_args "$@"
124
130
upload_artifacts
125
131
apply_resources
126
132
apply_hooks
133
+ success
You can’t perform that action at this time.
0 commit comments