New step to upgrade only office installation
This commit is contained in:
@@ -34,7 +34,7 @@ step_config() {
|
||||
fi
|
||||
}
|
||||
|
||||
step_1_info() { echo "Install docker dependencies"; }
|
||||
step_1_info() { echo "Install Docker dependencies"; }
|
||||
step_1_alias() { ALIAS="install"; }
|
||||
step_1() {
|
||||
local aptOption=
|
||||
@@ -48,11 +48,11 @@ step_1() {
|
||||
endReturn -o $? "Docker dependencies installation failed"
|
||||
}
|
||||
|
||||
step_2_info() { echo "Install docker repository"; }
|
||||
step_2_info() { echo "Install Docker repository"; }
|
||||
step_2() {
|
||||
# Add official docker GPG key
|
||||
exep "curl -fsSL ${dockerGpgKeyUrl} | sudo apt-key add -"
|
||||
|
||||
|
||||
# Add stable repository
|
||||
exe add-apt-repository "deb [arch=amd64] ${dockerRepoUrl} $(lsb_release -cs) stable"
|
||||
endReturn -o $? "Failed to add Docker repository"
|
||||
@@ -60,7 +60,7 @@ step_2() {
|
||||
endReturn -o $? "Docker repository not available"
|
||||
}
|
||||
|
||||
step_3_info() { echo "Install latest docker version"; }
|
||||
step_3_info() { echo "Install latest Docker version"; }
|
||||
step_3() {
|
||||
# Install the latest version
|
||||
if [ $QUIET -ne 0 ] ; then
|
||||
@@ -83,20 +83,51 @@ step_4() {
|
||||
fi
|
||||
}
|
||||
|
||||
step_5_info() { echo "Install/start onlyoffice docker container <SECRET>"; }
|
||||
step_5_info() {
|
||||
echo "Install/start onlyoffice docker container <SECRET>."
|
||||
echoinfo "If <SECRET> is empty, user input will be available if not run --quiet."
|
||||
echoinfo "$toolName will be run unsecured if no secret was provied."
|
||||
}
|
||||
step_5_alias() { ALIAS="startoo"; }
|
||||
step_5() {
|
||||
local options=
|
||||
local secret=
|
||||
|
||||
if [ ! -z "$2" ] ; then
|
||||
secret="$2"
|
||||
elif [ $QUIET -eq 0 ] ; then
|
||||
exe read -s -p "JWT Secret: " secret
|
||||
fi
|
||||
|
||||
# The correct expansion for missing SECRET or SECRET with spaces is not possible.
|
||||
# Therefore docker without secret needs to be called separately
|
||||
if [ ! -z "$2" ] && [ "$2" != "" ] ; then
|
||||
if [ ! -z "$secret" ] ; then
|
||||
options="-e JWT_ENABLED=true -e JWT_SECRET="
|
||||
# This is the only way to provide SECRET($2) to docker command line which handles all types of characters.
|
||||
exe docker run -i -t -d -p ${onlyOfficePort}:80 ${options}"$2" --restart=always onlyoffice/documentserver
|
||||
exe docker run -i -t -d -p ${onlyOfficePort}:80 ${options}"$secret" --restart=always onlyoffice/documentserver
|
||||
else
|
||||
echo " [I] Running $toolName without JWT (JSON Web Tokens)"
|
||||
echoerr " [W] Running $toolName without JWT (JSON Web Tokens)"
|
||||
exe docker run -i -t -d -p ${onlyOfficePort}:80 --restart=always onlyoffice/documentserver
|
||||
fi
|
||||
|
||||
unset secret
|
||||
}
|
||||
|
||||
step_7_info() { echo "Upgrade $toolName to latest version"; }
|
||||
step_7_alias() { ALIAS="upgrade"; }
|
||||
step_7() {
|
||||
# get container ID
|
||||
local containerId=$(docker ps -aqf ancestor="$dockerImageName")
|
||||
if [ ! -z $containerId ] ; then
|
||||
exe docker stop $containerId
|
||||
exe docker rm $containerId
|
||||
else
|
||||
echoerr " [W] No $toolName Docker container found"
|
||||
fi
|
||||
exe docker pull $dockerImageName
|
||||
endReturn -o $? "Error getting $toolName Docker update"
|
||||
|
||||
step startoo
|
||||
}
|
||||
|
||||
step_10_info() { echo "List running Docker container"; }
|
||||
@@ -109,14 +140,18 @@ step_10() {
|
||||
echo " e.g.: docker stop 70f1c5c81be2"
|
||||
}
|
||||
|
||||
step_12_info() { echo "Clean unused Docker data (unused containers, dangling images, networks and build cache)"; }
|
||||
step_12_info() {
|
||||
echo "Clean unused Docker data"
|
||||
echoinfo "(unused containers, dangling images, networks, build cache and volumes)"
|
||||
}
|
||||
step_12_alias() { ALIAS="prune"; }
|
||||
step_12() {
|
||||
exe docker system df
|
||||
exe docker system prune
|
||||
exe docker volume prune
|
||||
}
|
||||
|
||||
step_100_info() { echo "Uninstall docker"; }
|
||||
step_100_info() { echo "Uninstall Docker"; }
|
||||
step_100_alias() { ALIAS="uninstall"; }
|
||||
step_100() {
|
||||
exe apt-get purge docker-ce
|
||||
|
Reference in New Issue
Block a user