Merge pull request #496 from missuo/canary

feat: add update option
This commit is contained in:
Mauricio Siu
2024-09-30 15:04:03 -06:00
committed by GitHub
3 changed files with 345 additions and 288 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
install_dokploy() {
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" >&2 echo "This script must be run as root" >&2
exit 1 exit 1
@@ -111,4 +111,23 @@ printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n"
printf "${BLUE}Wait 15 seconds for the server to start${NC}\n" printf "${BLUE}Wait 15 seconds for the server to start${NC}\n"
printf "${YELLOW}Please go to http://${formatted_addr}:3000${NC}\n\n" printf "${YELLOW}Please go to http://${formatted_addr}:3000${NC}\n\n"
echo "" echo ""
}
update_dokploy() {
echo "Updating Dokploy..."
# Pull the latest canary image
docker pull dokploy/dokploy:canary
# Update the service
docker service update --image dokploy/dokploy:canary dokploy
echo "Dokploy has been updated to the latest canary version."
}
# Main script execution
if [ "$1" = "update" ]; then
update_dokploy
else
install_dokploy
fi

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
install_dokploy() {
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" >&2 echo "This script must be run as root" >&2
exit 1 exit 1
@@ -95,3 +95,23 @@ printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n"
printf "${BLUE}Wait 15 seconds for the server to start${NC}\n" printf "${BLUE}Wait 15 seconds for the server to start${NC}\n"
printf "${YELLOW}Please go to http://${formatted_addr}:3000${NC}\n\n" printf "${YELLOW}Please go to http://${formatted_addr}:3000${NC}\n\n"
echo "" echo ""
}
update_dokploy() {
echo "Updating Dokploy..."
# Pull the latest feature image
docker pull dokploy/dokploy:feature
# Update the service
docker service update --image dokploy/dokploy:feature dokploy
echo "Dokploy has been updated to the latest feature version."
}
# Main script execution
if [ "$1" = "update" ]; then
update_dokploy
else
install_dokploy
fi

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
install_dokploy() {
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" >&2 echo "This script must be run as root" >&2
exit 1 exit 1
@@ -11,7 +11,6 @@ if [ "$(uname)" = "Darwin" ]; then
exit 1 exit 1
fi fi
# check if is running inside a container # check if is running inside a container
if [ -f /.dockerenv ]; then if [ -f /.dockerenv ]; then
echo "This script must be run on Linux" >&2 echo "This script must be run on Linux" >&2
@@ -109,4 +108,23 @@ echo ""
printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n" printf "${GREEN}Congratulations, Dokploy is installed!${NC}\n"
printf "${BLUE}Wait 15 seconds for the server to start${NC}\n" printf "${BLUE}Wait 15 seconds for the server to start${NC}\n"
printf "${YELLOW}Please go to http://${formatted_addr}:3000${NC}\n\n" printf "${YELLOW}Please go to http://${formatted_addr}:3000${NC}\n\n"
echo "" }
update_dokploy() {
echo "Updating Dokploy..."
# Pull the latest image
docker pull dokploy/dokploy:latest
# Update the service
docker service update --image dokploy/dokploy:latest dokploy
echo "Dokploy has been updated to the latest version."
}
# Main script execution
if [ "$1" = "update" ]; then
update_dokploy
else
install_dokploy
fi