refactoring changes from sequpgrade (endReturn, ...) and some modernizations

This commit is contained in:
2023-01-03 15:49:08 +01:00
parent 215135e8aa
commit 3c22d5729f
69 changed files with 553 additions and 654 deletions

View File

@@ -56,7 +56,7 @@ step_1_alias() { echo "install"; }
step_1() {
exe apt update
exe apt install $dockerDeps $APTOPT
endReturn -o $? "Docker dependencies installation failed"
endReturn "Docker dependencies installation failed"
}
step_2_info() { echo "Install Docker repository"; }
@@ -66,9 +66,9 @@ step_2() {
# Add stable repository
exe add-apt-repository "deb [arch=amd64] ${dockerRepoUrl} $(lsb_release -cs) stable"
endReturn -o $? "Failed to add Docker repository"
endReturn "Failed to add Docker repository"
exe apt update
endReturn -o $? "Docker repository not available"
endReturn "Docker repository not available"
}
step_3_info() { echo "Install latest Docker version"; }
@@ -81,7 +81,7 @@ step_3() {
fi
exe apt install $dockerPackages $aptOption
echo " [I] You may test the installation by running:"
info "You may test the installation by running:"
echo " sudo docker run hello-world"
}
@@ -108,7 +108,7 @@ step_5() {
if [ ! -z "$2" ] ; then
secret="$2"
elif [ ! -z "$dockerSecret" ]; then
secret="$dockerSecret"
secret="$dockerSecret"
elif interactive ; then
exe read -s -p "JWT Secret: " secret
fi
@@ -143,7 +143,7 @@ step_7() {
warning -e "No $toolName Docker container found"
fi
exe docker pull $dockerImageName
endReturn -o $? "Error getting $toolName Docker update"
endReturn "Error getting $toolName Docker update"
step startoo
}
@@ -153,12 +153,12 @@ step_10_alias() { echo "ls"; }
step_10() {
exe docker container ls
echo
echo " [I] To stop a container run:"
info "To stop a container run:"
echo " docker stop [CONTAINER ID]"
echo " e.g.: docker stop 70f1c5c81be2"
}
step_12_info() {
step_12_info() {
echo "Clean unused Docker data"
echoinfo "(unused containers, dangling images, networks, build cache and volumes)"
}
@@ -182,7 +182,7 @@ step_102() {
case $answer in
[yY])
exe service docker stop
exe rm -rf /var/lib/docker
exe rm -rf /var/lib/docker
;;
*)
return 0