feat: add update option for canary and feature tag

This commit is contained in:
Vincent Yang
2024-09-29 22:45:39 -04:00
parent 7027f39c48
commit 18b4b23f79
2 changed files with 230 additions and 191 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