File tree 6 files changed +42
-13
lines changed
6 files changed +42
-13
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ CONTAINER_NAMESPACE=test
17
17
# never set username and password, you must login manually in your local system firstly.
18
18
DOCKERHUB_USERNAME=xxx
19
19
DOCKERHUB_PASSWORD=xxx
20
- DOCKERHUB_DOMAIN=docker.io
20
+ # DOCKERHUB_DOMAIN=docker.io # Deprecated, it will not be used
21
21
DOCKERHUB_REPO=docker.io/lvsid # change to your own docker hub.
22
22
23
23
### Services ##############################################
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ CONTAINER_NAMESPACE=test
17
17
# never set username and password, you must login manually in your local system firstly.
18
18
DOCKERHUB_USERNAME=xxx
19
19
DOCKERHUB_PASSWORD=xxx
20
- DOCKERHUB_DOMAIN=docker.io
20
+ # DOCKERHUB_DOMAIN=docker.io # Deprecated, it will not be used
21
21
DOCKERHUB_REPO=docker.io/lvsid # change to your own docker hub.
22
22
23
23
### Services ##############################################
Original file line number Diff line number Diff line change @@ -21,3 +21,6 @@ CONST_BASE_CONFIG_ENV_ARM64_FILE=".work/config/.env.arm64"
21
21
CONST_BASE_CONFIG_COMPOSE_FILE=" .work/config/docker-compose.yml"
22
22
CONST_SPARROW_CONFIG_ENV_FILE=" .env"
23
23
CONST_SPARROW_CONFIG_COMPOSE_FILE=" docker-compose.yml"
24
+
25
+ # define some default values
26
+ CONST_DEFAULT_DOCKERHUB_REPO=" docker.io/lvsid"
Original file line number Diff line number Diff line change @@ -7,22 +7,26 @@ cd $SPARROW_BASE_PATH
7
7
# login of $DOCKERHUB_DOMAIN.
8
8
# to be safety, never allow login with account in the command, you must login manually in your local system firstly.
9
9
# docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD $DOCKERHUB_DOMAIN
10
- login () {
11
- print_info " docker login {$DOCKERHUB_DOMAIN }..."
12
- # due to the reasons mentioned above, there is no need to do login explicitly here, as the session will be retained after manual login.
13
- # if ! docker login; then
14
- # print_error "docker login failed"
15
- # exit 1
16
- # fi
17
- }
10
+ # @Deprecated: it is not available, and not being called
11
+ # login() {
12
+ # print_info "docker login {$DOCKERHUB_DOMAIN}..."
13
+ # due to the reasons mentioned above, there is no need to do login explicitly here, as the session will be retained after manual login.
14
+ # if ! docker login; then
15
+ # print_error "docker login failed"
16
+ # exit 1
17
+ # fi
18
+ # }
18
19
19
20
# search image
20
21
search () {
21
22
search_image=$1
22
23
remove_prefix_search_image=$( echo " $search_image " | sed ' s/^docker.io\///' )
24
+ echo " search search_image=${search_image} , remove_prefix_search_image=${remove_prefix_search_image} "
23
25
if docker search " $search_image " | grep -q " ^$remove_prefix_search_image " ; then
26
+ print_info " find it"
24
27
return 0 # find
25
28
else
29
+ print_warn " not find it"
26
30
return 1 # not find
27
31
fi
28
32
}
Original file line number Diff line number Diff line change @@ -16,11 +16,19 @@ sleep_seconds 3
16
16
testhttp () {
17
17
if is_mac; then
18
18
# open websites.
19
- open " http://127.0.0.1:${ETCDKEEPER_HOST_PORT} /etcdkeeper/" # etcdkeeper
20
- open " http://127.0.0.1:${KAFKAUI_HOST_PORT} /" # kafkaui
19
+ open " http://127.0.0.1:${ETCDKEEPER_HOST_PORT} /etcdkeeper/" # etcdkeeper
20
+ open " http://127.0.0.1:${KAFKAUI_HOST_PORT} /" # kafkaui
21
21
fi
22
22
}
23
- testhttp
23
+ # testhttp
24
+
25
+ echo " test search"
26
+ for service in " ${ENABLE_SERVICE_LIST[@]} " ; do
27
+ image=" sparrow-basic-${service} "
28
+ search " $DOCKERHUB_REPO /$image "
29
+ image=" sparrow-app-${service} "
30
+ search " $DOCKERHUB_REPO /$image "
31
+ done
24
32
25
33
printf " UnitTest Success"
26
34
exit 0
Original file line number Diff line number Diff line change @@ -63,6 +63,20 @@ modify_files() {
63
63
# this operation is fine because when the sdk.sh file is included at the beginning, the /env file is created.
64
64
print_info " set GO_PATH: before($GO_PATH ), after($local_go_path )"
65
65
awk -F= ' /^GO_PATH=/{OFS="="; $2="' ${local_go_path} ' "}1' " $CONST_SPARROW_CONFIG_ENV_FILE " > temp && mv temp " $CONST_SPARROW_CONFIG_ENV_FILE "
66
+
67
+ # modify DOCKERHUB_REPO in /env file
68
+ if [ " $DOCKERHUB_REPO " == " $CONST_DEFAULT_DOCKERHUB_REPO " ]; then
69
+ echo " set DOCKERHUB_REPO to configure your remote repository, press enter will use the default value (default=docker.io/lvsid)"
70
+ printf " please input: "
71
+ read dockerhub_repo
72
+ if [ " $dockerhub_repo " == " " ]; then
73
+ dockerhub_repo=" $CONST_DEFAULT_DOCKERHUB_REPO "
74
+ else
75
+ awk -F= ' /^DOCKERHUB_REPO=/{OFS="="; $2="' ${dockerhub_repo} ' "}1' " $CONST_SPARROW_CONFIG_ENV_FILE " > temp && mv temp " $CONST_SPARROW_CONFIG_ENV_FILE "
76
+ fi
77
+ print_info " your DOCKERHUB_REPO config is: ${dockerhub_repo} "
78
+ print_warn " If you need to change the configuration in the future, you can update the DOCKERHUB_REPO variable in the /.env file."
79
+ fi
66
80
}
67
81
68
82
# before run install command.
You can’t perform that action at this time.
0 commit comments