π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
improvement: 1 click deployment (#3794)
Manish Guptae1f13af084d3
diff --git a/deploy/1-click/install.sh b/deploy/1-click/install.shindex 917d08fdf8..9a0eac9026 100644--- a/deploy/1-click/install.sh+++ b/deploy/1-click/install.sh@@ -1,17 +1,20 @@#!/bin/bash+export GIT_REPO=makeplane/plane+# Check if the user has sudo accessif command -v curl &> /dev/null; thensudo curl -sSL \-o /usr/local/bin/plane-app \- https://raw.githubusercontent.com/makeplane/plane/${BRANCH:-master}/deploy/1-click/plane-app?token=$(date +%s)+ https://raw.githubusercontent.com/$GIT_REPO/${BRANCH:-master}/deploy/1-click/plane-app?token=$(date +%s)elsesudo wget -q \-O /usr/local/bin/plane-app \- https://raw.githubusercontent.com/makeplane/plane/${BRANCH:-master}/deploy/1-click/plane-app?token=$(date +%s)+ https://raw.githubusercontent.com/$GIT_REPO/${BRANCH:-master}/deploy/1-click/plane-app?token=$(date +%s)fisudo chmod +x /usr/local/bin/plane-app-sudo sed -i 's/export DEPLOY_BRANCH=${BRANCH:-master}/export DEPLOY_BRANCH='${BRANCH:-master}'/' /usr/local/bin/plane-app+sudo sed -i 's@export DEPLOY_BRANCH=${BRANCH:-master}@export DEPLOY_BRANCH='${BRANCH:-master}'@' /usr/local/bin/plane-app+sudo sed -i 's@CODE_REPO=${GIT_REPO:-makeplane/plane}@CODE_REPO='$GIT_REPO'@' /usr/local/bin/plane-app-plane-app --help+plane-app -i #--helpdiff --git a/deploy/1-click/plane-app b/deploy/1-click/plane-appindex 2d6ef0a6f1..e6bd24b9ec 100644--- a/deploy/1-click/plane-app+++ b/deploy/1-click/plane-app@@ -90,9 +90,9 @@ function prepare_environment() {show_message "- Updating OS with required tools β" >&2sudo "$PACKAGE_MANAGER" update -y- sudo "$PACKAGE_MANAGER" upgrade -y+ # sudo "$PACKAGE_MANAGER" upgrade -y- local required_tools=("curl" "awk" "wget" "nano" "dialog" "git" "uidmap")+ local required_tools=("curl" "awk" "wget" "nano" "dialog" "git" "uidmap" "jq")for tool in "${required_tools[@]}"; doif ! command -v $tool &> /dev/null; then@@ -150,11 +150,11 @@ function download_plane() {show_message "Downloading Plane Setup Files β" >&2sudo curl -H 'Cache-Control: no-cache, no-store' \-s -o $PLANE_INSTALL_DIR/docker-compose.yaml \- https://raw.githubusercontent.com/makeplane/plane/$DEPLOY_BRANCH/deploy/selfhost/docker-compose.yml?token=$(date +%s)+ https://raw.githubusercontent.com/$CODE_REPO/$DEPLOY_BRANCH/deploy/selfhost/docker-compose.yml?token=$(date +%s)sudo curl -H 'Cache-Control: no-cache, no-store' \-s -o $PLANE_INSTALL_DIR/variables-upgrade.env \- https://raw.githubusercontent.com/makeplane/plane/$DEPLOY_BRANCH/deploy/selfhost/variables.env?token=$(date +%s)+ https://raw.githubusercontent.com/$CODE_REPO/$DEPLOY_BRANCH/deploy/selfhost/variables.env?token=$(date +%s)# if .env does not exists rename variables-upgrade.env to .envif [ ! -f "$PLANE_INSTALL_DIR/.env" ]; then@@ -202,7 +202,7 @@ function printUsageInstructions() {}function build_local_image() {show_message "- Downloading Plane Source Code β" >&2- REPO=https://github.com/makeplane/plane.git+ REPO=https://github.com/$CODE_REPO.gitCURR_DIR=$PWDPLANE_TEMP_CODE_DIR=$PLANE_INSTALL_DIR/tempsudo rm -rf $PLANE_TEMP_CODE_DIR > /dev/null@@ -290,40 +290,40 @@ function configure_plane() {fi- smtp_host=$(read_env "EMAIL_HOST")- smtp_user=$(read_env "EMAIL_HOST_USER")- smtp_password=$(read_env "EMAIL_HOST_PASSWORD")- smtp_port=$(read_env "EMAIL_PORT")- smtp_from=$(read_env "EMAIL_FROM")- smtp_tls=$(read_env "EMAIL_USE_TLS")- smtp_ssl=$(read_env "EMAIL_USE_SSL")-- SMTP_SETTINGS=$(dialog \- --ok-label "Next" \- --cancel-label "Skip" \- --backtitle "Plane Configuration" \- --title "SMTP Settings" \- --form "" \- 0 0 0 \- "Host:" 1 1 "$smtp_host" 1 10 80 0 \- "User:" 2 1 "$smtp_user" 2 10 80 0 \- "Password:" 3 1 "$smtp_password" 3 10 80 0 \- "Port:" 4 1 "${smtp_port:-587}" 4 10 5 0 \- "From:" 5 1 "${smtp_from:-Mailer <[email protected]>}" 5 10 80 0 \- "TLS:" 6 1 "${smtp_tls:-1}" 6 10 1 1 \- "SSL:" 7 1 "${smtp_ssl:-0}" 7 10 1 1 \- 2>&1 1>&3)-- save_smtp_settings=0- if [ $? -eq 0 ]; then- save_smtp_settings=1- smtp_host=$(echo "$SMTP_SETTINGS" | sed -n 1p)- smtp_user=$(echo "$SMTP_SETTINGS" | sed -n 2p)- smtp_password=$(echo "$SMTP_SETTINGS" | sed -n 3p)- smtp_port=$(echo "$SMTP_SETTINGS" | sed -n 4p)- smtp_from=$(echo "$SMTP_SETTINGS" | sed -n 5p)- smtp_tls=$(echo "$SMTP_SETTINGS" | sed -n 6p)- fi+ # smtp_host=$(read_env "EMAIL_HOST")+ # smtp_user=$(read_env "EMAIL_HOST_USER")+ # smtp_password=$(read_env "EMAIL_HOST_PASSWORD")+ # smtp_port=$(read_env "EMAIL_PORT")+ # smtp_from=$(read_env "EMAIL_FROM")+ # smtp_tls=$(read_env "EMAIL_USE_TLS")+ # smtp_ssl=$(read_env "EMAIL_USE_SSL")++ # SMTP_SETTINGS=$(dialog \+ # --ok-label "Next" \+ # --cancel-label "Skip" \+ # --backtitle "Plane Configuration" \+ # --title "SMTP Settings" \+ # --form "" \+ # 0 0 0 \+ # "Host:" 1 1 "$smtp_host" 1 10 80 0 \+ # "User:" 2 1 "$smtp_user" 2 10 80 0 \+ # "Password:" 3 1 "$smtp_password" 3 10 80 0 \+ # "Port:" 4 1 "${smtp_port:-587}" 4 10 5 0 \+ # "From:" 5 1 "${smtp_from:-Mailer <[email protected]>}" 5 10 80 0 \+ # "TLS:" 6 1 "${smtp_tls:-1}" 6 10 1 1 \+ # "SSL:" 7 1 "${smtp_ssl:-0}" 7 10 1 1 \+ # 2>&1 1>&3)++ # save_smtp_settings=0+ # if [ $? -eq 0 ]; then+ # save_smtp_settings=1+ # smtp_host=$(echo "$SMTP_SETTINGS" | sed -n 1p)+ # smtp_user=$(echo "$SMTP_SETTINGS" | sed -n 2p)+ # smtp_password=$(echo "$SMTP_SETTINGS" | sed -n 3p)+ # smtp_port=$(echo "$SMTP_SETTINGS" | sed -n 4p)+ # smtp_from=$(echo "$SMTP_SETTINGS" | sed -n 5p)+ # smtp_tls=$(echo "$SMTP_SETTINGS" | sed -n 6p)+ # fiexternal_pgdb_url=$(dialog \--backtitle "Plane Configuration" \--title "Using External Postgres Database ?" \@@ -383,15 +383,6 @@ function configure_plane() {domain_name: $domain_nameupload_limit: $upload_limit- save_smtp_settings: $save_smtp_settings- smtp_host: $smtp_host- smtp_user: $smtp_user- smtp_password: $smtp_password- smtp_port: $smtp_port- smtp_from: $smtp_from- smtp_tls: $smtp_tls- smtp_ssl: $smtp_ssl-save_aws_settings: $save_aws_settingsaws_region: $aws_regionaws_access_key: $aws_access_key@@ -413,15 +404,15 @@ function configure_plane() {fi# check enable smpt settings value- if [ $save_smtp_settings == 1 ]; then- update_env "EMAIL_HOST" "$smtp_host"- update_env "EMAIL_HOST_USER" "$smtp_user"- update_env "EMAIL_HOST_PASSWORD" "$smtp_password"- update_env "EMAIL_PORT" "$smtp_port"- update_env "EMAIL_FROM" "$smtp_from"- update_env "EMAIL_USE_TLS" "$smtp_tls"- update_env "EMAIL_USE_SSL" "$smtp_ssl"- fi+ # if [ $save_smtp_settings == 1 ]; then+ # update_env "EMAIL_HOST" "$smtp_host"+ # update_env "EMAIL_HOST_USER" "$smtp_user"+ # update_env "EMAIL_HOST_PASSWORD" "$smtp_password"+ # update_env "EMAIL_PORT" "$smtp_port"+ # update_env "EMAIL_FROM" "$smtp_from"+ # update_env "EMAIL_USE_TLS" "$smtp_tls"+ # update_env "EMAIL_USE_SSL" "$smtp_ssl"+ # fi# check enable aws settings valueif [[ $save_aws_settings == 1 && $aws_access_key != "" && $aws_secret_key != "" ]] ; then@@ -493,13 +484,24 @@ function install() {check_for_docker_imageslast_installed_on=$(read_config "INSTALLATION_DATE")- if [ "$last_installed_on" == "" ]; then- configure_plane- fi- printUsageInstructions+ # if [ "$last_installed_on" == "" ]; then+ # configure_plane+ # fi++ update_env "NGINX_PORT" "80"+ update_env "DOMAIN_NAME" "$MY_IP"+ update_env "WEB_URL" "http://$MY_IP"+ update_env "CORS_ALLOWED_ORIGINS" "http://$MY_IP"- update_config "INSTALLATION_DATE" "$(date)"+ update_config "INSTALLATION_DATE" "$(date '+%Y-%m-%d')"+ if command -v crontab &> /dev/null; then+ sudo touch /etc/cron.daily/makeplane+ sudo chmod +x /etc/cron.daily/makeplane+ sudo echo "0 2 * * * root /usr/local/bin/plane-app --upgrade" > /etc/cron.daily/makeplane+ sudo crontab /etc/cron.daily/makeplane+ fi+show_message "Plane Installed Successfully β "show_message ""else@@ -539,12 +541,15 @@ function upgrade() {prepare_environmentif [ $? -eq 0 ]; then+ stop_serverdownload_planeif [ $? -eq 0 ]; thencheck_for_docker_imagesupgrade_configurationupdate_config "UPGRADE_DATE" "$(date)"-++ start_server+show_message ""show_message "Plane Upgraded Successfully β "show_message ""@@ -601,6 +606,11 @@ function uninstall() {sudo rm $PLANE_INSTALL_DIR/variables-upgrade.env &> /dev/nullsudo rm $PLANE_INSTALL_DIR/config.env &> /dev/nullsudo rm $PLANE_INSTALL_DIR/docker-compose.yaml &> /dev/null++ if command -v crontab &> /dev/null; then+ sudo crontab -r &> /dev/null+ sudo rm /etc/cron.daily/makeplane &> /dev/null+ fi# rm -rf $PLANE_INSTALL_DIR &> /dev/nullshow_message "- Configuration Cleaned β "@@ -642,7 +652,39 @@ function start_server() {while ! sudo docker compose -f "$docker_compose_file" --env-file="$env_file" ps --services --filter "status=running" --quiet | grep -q "."; dosleep 1done+ # wait for migrator container to exit with status 0 before starting the application+ migrator_container_id=$(sudo docker container ls -aq -f "name=plane-migrator")++ # if migrator container is running, wait for it to exit+ if [ -n "$migrator_container_id" ]; then+ while sudo docker inspect --format='{{.State.Status}}' $migrator_container_id | grep -q "running"; do+ show_message "Waiting for Plane Server ($APP_RELEASE) to start...β (Migrator in progress)" "replace_last_line" >&2+ sleep 1+ done+ fi++ # if migrator exit status is not 0, show error message and exit+ if [ -n "$migrator_container_id" ]; then+ migrator_exit_code=$(sudo docker inspect --format='{{.State.ExitCode}}' $migrator_container_id)+ if [ $migrator_exit_code -ne 0 ]; then+ # show_message "Migrator failed with exit code $migrator_exit_code β" "replace_last_line" >&2+ show_message "Plane Server failed to start β" "replace_last_line" >&2+ stop_server+ exit 1+ fi+ fi++ api_container_id=$(sudo docker container ls -q -f "name=plane-api")+ while ! sudo docker logs $api_container_id 2>&1 | grep -i "Application startup complete";+ do+ show_message "Waiting for Plane Server ($APP_RELEASE) to start...β (API starting)" "replace_last_line" >&2+ sleep 1+ doneshow_message "Plane Server Started ($APP_RELEASE) β " "replace_last_line" >&2+ show_message "---------------------------------------------------------------" >&2+ show_message "Access the Plane application at http://$MY_IP" >&2+ show_message "---------------------------------------------------------------" >&2+elseshow_message "Plane Server not installed. Please install Plane first β" "replace_last_line" >&2fi@@ -694,7 +736,7 @@ function update_installer() {show_message "Updating Plane Installer β" >&2sudo curl -H 'Cache-Control: no-cache, no-store' \-s -o /usr/local/bin/plane-app \- https://raw.githubusercontent.com/makeplane/plane/$DEPLOY_BRANCH/deploy/1-click/plane-app?token=$(date +%s)+ https://raw.githubusercontent.com/$CODE_REPO/$DEPLOY_BRANCH/deploy/1-click/plane-app?token=$(date +%s)sudo chmod +x /usr/local/bin/plane-app > /dev/null&> /dev/nullshow_message "Plane Installer Updated β " "replace_last_line" >&2@@ -711,12 +753,14 @@ fiPLANE_INSTALL_DIR=/opt/planeDATA_DIR=$PLANE_INSTALL_DIR/data-LOG_DIR=$PLANE_INSTALL_DIR/log+LOG_DIR=$PLANE_INSTALL_DIR/logs+CODE_REPO=${GIT_REPO:-makeplane/plane}OS_SUPPORTED=falseCPU_ARCH=$(uname -m)PROGRESS_MSG=""USE_GLOBAL_IMAGES=0PACKAGE_MANAGER=""+MY_IP=$(curl -s ifconfig.me)if [[ $CPU_ARCH == "amd64" || $CPU_ARCH == "x86_64" || ( $DEPLOY_BRANCH == "master" && ( $CPU_ARCH == "arm64" || $CPU_ARCH == "aarch64" ) ) ]]; thenUSE_GLOBAL_IMAGES=1@@ -740,6 +784,9 @@ elif [ "$1" == "restart" ]; thenrestart_serverelif [ "$1" == "--install" ] || [ "$1" == "-i" ]; theninstall+ start_server+ show_message "" >&2+ show_message "To view help, use plane-app --help " >&2elif [ "$1" == "--configure" ] || [ "$1" == "-c" ]; thenconfigure_planeprintUsageInstructionsdiff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.ymlindex 60861878cb..07e5ea9f62 100644--- a/deploy/selfhost/docker-compose.yml+++ b/deploy/selfhost/docker-compose.yml@@ -56,8 +56,6 @@ x-app-env : &app-env- BUCKET_NAME=${BUCKET_NAME:-uploads}- FILE_SIZE_LIMIT=${FILE_SIZE_LIMIT:-5242880}--services:web:<<: *app-env@@ -138,7 +136,6 @@ services:command: postgres -c 'max_connections=1000'volumes:- pgdata:/var/lib/postgresql/data-plane-redis:<<: *app-envimage: redis:6.2.7-alpine