π₯π₯π₯ 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
feat: muti-arch build (#3569)
Manish Guptaa43dfc097d11
diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.ymlindex 38694a62ea..c43305fc0d 100644--- a/.github/workflows/build-branch.yml+++ b/.github/workflows/build-branch.yml@@ -2,11 +2,6 @@ name: Branch Buildon:workflow_dispatch:- inputs:- branch_name:- description: "Branch Name"- required: true- default: "preview"push:branches:- master@@ -16,49 +11,71 @@ on:types: [released, prereleased]env:- TARGET_BRANCH: ${{ inputs.branch_name || github.ref_name || github.event.release.target_commitish }}+ TARGET_BRANCH: ${{ github.ref_name || github.event.release.target_commitish }}jobs:branch_build_setup:name: Build-Push Web/Space/API/Proxy Docker Image- runs-on: ubuntu-20.04- steps:- - name: Check out the repo- uses: actions/[email protected]+ runs-on: ubuntu-latestoutputs:- gh_branch_name: ${{ env.TARGET_BRANCH }}+ gh_branch_name: ${{ steps.set_env_variables.outputs.TARGET_BRANCH }}+ gh_buildx_driver: ${{ steps.set_env_variables.outputs.BUILDX_DRIVER }}+ gh_buildx_version: ${{ steps.set_env_variables.outputs.BUILDX_VERSION }}+ gh_buildx_platforms: ${{ steps.set_env_variables.outputs.BUILDX_PLATFORMS }}+ gh_buildx_endpoint: ${{ steps.set_env_variables.outputs.BUILDX_ENDPOINT }}++ steps:+ - id: set_env_variables+ name: Set Environment Variables+ run: |+ if [ "${{ env.TARGET_BRANCH }}" == "master" ]; then+ echo "BUILDX_DRIVER=cloud" >> $GITHUB_OUTPUT+ echo "BUILDX_VERSION=lab:latest" >> $GITHUB_OUTPUT+ echo "BUILDX_PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT+ echo "BUILDX_ENDPOINT=makeplane/plane-dev" >> $GITHUB_OUTPUT+ else+ echo "BUILDX_DRIVER=docker-container" >> $GITHUB_OUTPUT+ echo "BUILDX_VERSION=latest" >> $GITHUB_OUTPUT+ echo "BUILDX_PLATFORMS=linux/amd64" >> $GITHUB_OUTPUT+ echo "BUILDX_ENDPOINT=local" >> $GITHUB_OUTPUT+ fi+ echo "TARGET_BRANCH=${{ env.TARGET_BRANCH }}" >> $GITHUB_OUTPUTbranch_build_push_frontend:runs-on: ubuntu-20.04needs: [branch_build_setup]env:FRONTEND_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ needs.branch_build_setup.outputs.gh_branch_name }}+ TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}+ BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}+ BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}+ BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}+ BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}steps:- name: Set Frontend Docker Tagrun: |- if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; thenTAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:${{ github.event.release.tag_name }}- elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then+ elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; thenTAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend:stableelseTAG=${{ env.FRONTEND_TAG }}fiecho "FRONTEND_TAG=${TAG}" >> $GITHUB_ENV- - name: Docker Setup QEMU- uses: docker/[email protected]-- - name: Set up Docker Buildx- uses: docker/[email protected]- with:- platforms: linux/amd64,linux/arm64- buildkitd-flags: "--allow-insecure-entitlement security.insecure"- name: Login to Docker Hub- uses: docker/[email protected]+ uses: docker/login-action@v3with:username: ${{ secrets.DOCKERHUB_USERNAME }}password: ${{ secrets.DOCKERHUB_TOKEN }}+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3+ with:+ driver: ${{ env.BUILDX_DRIVER }}+ version: ${{ env.BUILDX_VERSION }}+ endpoint: ${{ env.BUILDX_ENDPOINT }}+- name: Check out the repouses: actions/[email protected]@@ -67,7 +84,7 @@ jobs:with:context: .file: ./web/Dockerfile.web- platforms: linux/amd64+ platforms: ${{ env.BUILDX_PLATFORMS }}tags: ${{ env.FRONTEND_TAG }}push: trueenv:@@ -80,33 +97,36 @@ jobs:needs: [branch_build_setup]env:SPACE_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ needs.branch_build_setup.outputs.gh_branch_name }}+ TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}+ BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}+ BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}+ BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}+ BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}steps:- name: Set Space Docker Tagrun: |- if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; thenTAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-space:${{ github.event.release.tag_name }}- elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then+ elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; thenTAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-space:stableelseTAG=${{ env.SPACE_TAG }}fiecho "SPACE_TAG=${TAG}" >> $GITHUB_ENV- - name: Docker Setup QEMU- uses: docker/[email protected]-- - name: Set up Docker Buildx- uses: docker/[email protected]- with:- platforms: linux/amd64,linux/arm64- buildkitd-flags: "--allow-insecure-entitlement security.insecure"-- name: Login to Docker Hub- uses: docker/[email protected]+ uses: docker/login-action@v3with:username: ${{ secrets.DOCKERHUB_USERNAME }}password: ${{ secrets.DOCKERHUB_TOKEN }}+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3+ with:+ driver: ${{ env.BUILDX_DRIVER }}+ version: ${{ env.BUILDX_VERSION }}+ endpoint: ${{ env.BUILDX_ENDPOINT }}+- name: Check out the repouses: actions/[email protected]@@ -115,7 +135,7 @@ jobs:with:context: .file: ./space/Dockerfile.space- platforms: linux/amd64+ platforms: ${{ env.BUILDX_PLATFORMS }}tags: ${{ env.SPACE_TAG }}push: trueenv:@@ -128,33 +148,36 @@ jobs:needs: [branch_build_setup]env:BACKEND_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ needs.branch_build_setup.outputs.gh_branch_name }}+ TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}+ BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}+ BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}+ BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}+ BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}steps:- name: Set Backend Docker Tagrun: |- if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; thenTAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:${{ github.event.release.tag_name }}- elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then+ elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; thenTAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-backend:stableelseTAG=${{ env.BACKEND_TAG }}fiecho "BACKEND_TAG=${TAG}" >> $GITHUB_ENV- - name: Docker Setup QEMU- uses: docker/[email protected]-- - name: Set up Docker Buildx- uses: docker/[email protected]- with:- platforms: linux/amd64,linux/arm64- buildkitd-flags: "--allow-insecure-entitlement security.insecure"-- name: Login to Docker Hub- uses: docker/[email protected]+ uses: docker/login-action@v3with:username: ${{ secrets.DOCKERHUB_USERNAME }}password: ${{ secrets.DOCKERHUB_TOKEN }}+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3+ with:+ driver: ${{ env.BUILDX_DRIVER }}+ version: ${{ env.BUILDX_VERSION }}+ endpoint: ${{ env.BUILDX_ENDPOINT }}+- name: Check out the repouses: actions/[email protected]@@ -163,7 +186,7 @@ jobs:with:context: ./apiserverfile: ./apiserver/Dockerfile.api- platforms: linux/amd64+ platforms: ${{ env.BUILDX_PLATFORMS }}push: truetags: ${{ env.BACKEND_TAG }}env:@@ -171,38 +194,42 @@ jobs:DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}+branch_build_push_proxy:runs-on: ubuntu-20.04needs: [branch_build_setup]env:PROXY_TAG: ${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ needs.branch_build_setup.outputs.gh_branch_name }}+ TARGET_BRANCH: ${{ needs.branch_build_setup.outputs.gh_branch_name }}+ BUILDX_DRIVER: ${{ needs.branch_build_setup.outputs.gh_buildx_driver }}+ BUILDX_VERSION: ${{ needs.branch_build_setup.outputs.gh_buildx_version }}+ BUILDX_PLATFORMS: ${{ needs.branch_build_setup.outputs.gh_buildx_platforms }}+ BUILDX_ENDPOINT: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }}steps:- name: Set Proxy Docker Tagrun: |- if [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; then+ if [ "${{ env.TARGET_BRANCH }}" == "master" ] && [ "${{ github.event_name }}" == "release" ]; thenTAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:latest,${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:${{ github.event.release.tag_name }}- elif [ "${{ needs.branch_build_setup.outputs.gh_branch_name }}" == "master" ]; then+ elif [ "${{ env.TARGET_BRANCH }}" == "master" ]; thenTAG=${{ secrets.DOCKERHUB_USERNAME }}/plane-proxy:stableelseTAG=${{ env.PROXY_TAG }}fiecho "PROXY_TAG=${TAG}" >> $GITHUB_ENV- - name: Docker Setup QEMU- uses: docker/[email protected]-- - name: Set up Docker Buildx- uses: docker/[email protected]- with:- platforms: linux/amd64,linux/arm64- buildkitd-flags: "--allow-insecure-entitlement security.insecure"-- name: Login to Docker Hub- uses: docker/[email protected]+ uses: docker/login-action@v3with:username: ${{ secrets.DOCKERHUB_USERNAME }}password: ${{ secrets.DOCKERHUB_TOKEN }}+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3+ with:+ driver: ${{ env.BUILDX_DRIVER }}+ version: ${{ env.BUILDX_VERSION }}+ endpoint: ${{ env.BUILDX_ENDPOINT }}+- name: Check out the repouses: actions/[email protected]@@ -211,10 +238,11 @@ jobs:with:context: ./nginxfile: ./nginx/Dockerfile- platforms: linux/amd64+ platforms: ${{ env.BUILDX_PLATFORMS }}tags: ${{ env.PROXY_TAG }}push: trueenv:DOCKER_BUILDKIT: 1DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}+diff --git a/deploy/1-click/install.sh b/deploy/1-click/install.shindex f32be504d0..917d08fdf8 100644--- a/deploy/1-click/install.sh+++ b/deploy/1-click/install.sh@@ -1,5 +1,6 @@#!/bin/bash+# Check if the user has sudo accessif command -v curl &> /dev/null; thensudo curl -sSL \-o /usr/local/bin/plane-app \@@ -11,6 +12,6 @@ elsefisudo chmod +x /usr/local/bin/plane-app-sudo sed -i 's/export BRANCH=${BRANCH:-master}/export 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 plane-app --help\ No newline at end of file+plane-app --helpdiff --git a/deploy/1-click/plane-app b/deploy/1-click/plane-appindex 445f39d697..2d6ef0a6f1 100644--- a/deploy/1-click/plane-app+++ b/deploy/1-click/plane-app@@ -17,7 +17,7 @@ Project management tool from the futureEOF}-function update_env_files() {+function update_env_file() {config_file=$1key=$2value=$3@@ -25,14 +25,16 @@ function update_env_files() {# Check if the config file existsif [ ! -f "$config_file" ]; thenecho "Config file not found. Creating a new one..." >&2- touch "$config_file"+ sudo touch "$config_file"fi# Check if the key already exists in the config file- if grep -q "^$key=" "$config_file"; then- awk -v key="$key" -v value="$value" -F '=' '{if ($1 == key) $2 = value} 1' OFS='=' "$config_file" > "$config_file.tmp" && mv "$config_file.tmp" "$config_file"+ if sudo grep "^$key=" "$config_file"; then+ sudo awk -v key="$key" -v value="$value" -F '=' '{if ($1 == key) $2 = value} 1' OFS='=' "$config_file" | sudo tee "$config_file.tmp" > /dev/null+ sudo mv "$config_file.tmp" "$config_file" &> /dev/nullelse- echo "$key=$value" >> "$config_file"+ # sudo echo "$key=$value" >> "$config_file"+ echo -e "$key=$value" | sudo tee -a "$config_file" > /dev/nullfi}function read_env_file() {@@ -42,12 +44,12 @@ function read_env_file() {# Check if the config file existsif [ ! -f "$config_file" ]; thenecho "Config file not found. Creating a new one..." >&2- touch "$config_file"+ sudo touch "$config_file"fi# Check if the key already exists in the config file- if grep -q "^$key=" "$config_file"; then- value=$(awk -v key="$key" -F '=' '{if ($1 == key) print $2}' "$config_file")+ if sudo grep -q "^$key=" "$config_file"; then+ value=$(sudo awk -v key="$key" -F '=' '{if ($1 == key) print $2}' "$config_file")echo "$value"elseecho ""@@ -55,19 +57,19 @@ function read_env_file() {}function update_config() {config_file="$PLANE_INSTALL_DIR/config.env"- update_env_files "$config_file" "$1" "$2"+ update_env_file $config_file $1 $2}function read_config() {config_file="$PLANE_INSTALL_DIR/config.env"- read_env_file "$config_file" "$1"+ read_env_file $config_file $1}function update_env() {config_file="$PLANE_INSTALL_DIR/.env"- update_env_files "$config_file" "$1" "$2"+ update_env_file $config_file $1 $2}function read_env() {config_file="$PLANE_INSTALL_DIR/.env"- read_env_file "$config_file" "$1"+ read_env_file $config_file $1}function show_message() {print_header@@ -87,14 +89,14 @@ function prepare_environment() {show_message "Prepare Environment..." >&2show_message "- Updating OS with required tools β" >&2- sudo apt-get update -y &> /dev/null- sudo apt-get upgrade -y &> /dev/null+ sudo "$PACKAGE_MANAGER" update -y+ sudo "$PACKAGE_MANAGER" upgrade -y- required_tools=("curl" "awk" "wget" "nano" "dialog" "git")+ local required_tools=("curl" "awk" "wget" "nano" "dialog" "git" "uidmap")for tool in "${required_tools[@]}"; doif ! command -v $tool &> /dev/null; then- sudo apt install -y $tool &> /dev/null+ sudo "$PACKAGE_MANAGER" install -y $toolfidone@@ -103,11 +105,30 @@ function prepare_environment() {# Install Docker if not installedif ! command -v docker &> /dev/null; thenshow_message "- Installing Docker β" >&2- sudo curl -o- https://get.docker.com | bash --- if [ "$EUID" -ne 0 ]; then- dockerd-rootless-setuptool.sh install &> /dev/null+ # curl -o- https://get.docker.com | bash -++ if [ "$PACKAGE_MANAGER" == "yum" ]; then+ sudo $PACKAGE_MANAGER install -y yum-utils+ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo &> /dev/null+ elif [ "$PACKAGE_MANAGER" == "apt-get" ]; then+ # Add Docker's official GPG key:+ sudo $PACKAGE_MANAGER update+ sudo $PACKAGE_MANAGER install ca-certificates curl &> /dev/null+ sudo install -m 0755 -d /etc/apt/keyrings &> /dev/null+ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc &> /dev/null+ sudo chmod a+r /etc/apt/keyrings/docker.asc &> /dev/null++ # Add the repository to Apt sources:+ echo \+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \+ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \+ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null++ sudo $PACKAGE_MANAGER updatefi++ sudo $PACKAGE_MANAGER install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y+show_message "- Docker Installed β " "replace_last_line" >&2elseshow_message "- Docker is already installed β " >&2@@ -127,17 +148,17 @@ function prepare_environment() {function download_plane() {# Download Docker Compose File from github urlshow_message "Downloading Plane Setup Files β" >&2- curl -H 'Cache-Control: no-cache, no-store' \+ sudo curl -H 'Cache-Control: no-cache, no-store' \-s -o $PLANE_INSTALL_DIR/docker-compose.yaml \- https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/selfhost/docker-compose.yml?$(date +%s)+ https://raw.githubusercontent.com/makeplane/plane/$DEPLOY_BRANCH/deploy/selfhost/docker-compose.yml?token=$(date +%s)- curl -H 'Cache-Control: no-cache, no-store' \+ sudo curl -H 'Cache-Control: no-cache, no-store' \-s -o $PLANE_INSTALL_DIR/variables-upgrade.env \- https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/selfhost/variables.env?$(date +%s)+ https://raw.githubusercontent.com/makeplane/plane/$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- mv $PLANE_INSTALL_DIR/variables-upgrade.env $PLANE_INSTALL_DIR/.env+ sudo mv $PLANE_INSTALL_DIR/variables-upgrade.env $PLANE_INSTALL_DIR/.envfishow_message "Plane Setup Files Downloaded β " "replace_last_line" >&2@@ -186,7 +207,7 @@ function build_local_image() {PLANE_TEMP_CODE_DIR=$PLANE_INSTALL_DIR/tempsudo rm -rf $PLANE_TEMP_CODE_DIR > /dev/null- sudo git clone $REPO $PLANE_TEMP_CODE_DIR --branch $BRANCH --single-branch -q > /dev/null+ sudo git clone $REPO $PLANE_TEMP_CODE_DIR --branch $DEPLOY_BRANCH --single-branch -q > /dev/nullsudo cp $PLANE_TEMP_CODE_DIR/deploy/selfhost/build.yml $PLANE_TEMP_CODE_DIR/build.yml@@ -199,25 +220,26 @@ function check_for_docker_images() {show_message "" >&2# show_message "Building Plane Images" >&2- update_env "DOCKERHUB_USER" "makeplane"- update_env "PULL_POLICY" "always"CURR_DIR=$(pwd)- if [ "$BRANCH" == "master" ]; then+ if [ "$DEPLOY_BRANCH" == "master" ]; thenupdate_env "APP_RELEASE" "latest"export APP_RELEASE=latestelse- update_env "APP_RELEASE" "$BRANCH"- export APP_RELEASE=$BRANCH+ update_env "APP_RELEASE" "$DEPLOY_BRANCH"+ export APP_RELEASE=$DEPLOY_BRANCHfi- if [ $CPU_ARCH == "amd64" ] || [ $CPU_ARCH == "x86_64" ]; then+ if [ $USE_GLOBAL_IMAGES == 1 ]; then# show_message "Building Plane Images for $CPU_ARCH is not required. Skipping... β " "replace_last_line" >&2+ export DOCKERHUB_USER=makeplane+ update_env "DOCKERHUB_USER" "$DOCKERHUB_USER"+ update_env "PULL_POLICY" "always"echo "Building Plane Images for $CPU_ARCH is not required. Skipping..."elseexport DOCKERHUB_USER=myplaneshow_message "Building Plane Images for $CPU_ARCH " >&2- update_env "DOCKERHUB_USER" "myplane"+ update_env "DOCKERHUB_USER" "$DOCKERHUB_USER"update_env "PULL_POLICY" "never"build_local_image@@ -233,7 +255,7 @@ function check_for_docker_images() {sudo sed -i "s|- uploads:|- $DATA_DIR/minio:|g" $PLANE_INSTALL_DIR/docker-compose.yamlshow_message "Downloading Plane Images for $CPU_ARCH β" >&2- docker compose -f $PLANE_INSTALL_DIR/docker-compose.yaml --env-file=$PLANE_INSTALL_DIR/.env pull+ sudo docker compose -f $PLANE_INSTALL_DIR/docker-compose.yaml --env-file=$PLANE_INSTALL_DIR/.env pullshow_message "Plane Images Downloaded β " "replace_last_line" >&2}function configure_plane() {@@ -453,9 +475,11 @@ function install() {show_message ""if [ "$(uname)" == "Linux" ]; thenOS="linux"- OS_NAME=$(awk -F= '/^ID=/{print $2}' /etc/os-release)- # check the OS- if [ "$OS_NAME" == "ubuntu" ]; then+ OS_NAME=$(sudo awk -F= '/^ID=/{print $2}' /etc/os-release)+ OS_NAME=$(echo "$OS_NAME" | tr -d '"')+ print_header+ if [ "$OS_NAME" == "ubuntu" ] || [ "$OS_NAME" == "debian" ] ||+ [ "$OS_NAME" == "centos" ] || [ "$OS_NAME" == "amazon" ]; thenOS_SUPPORTED=trueshow_message "******** Installing Plane ********"show_message ""@@ -488,7 +512,8 @@ function install() {fielse- PROGRESS_MSG="βββ Unsupported OS Detected βββ"+ OS_SUPPORTED=false+ PROGRESS_MSG="ββ Unsupported OS Varient Detected : $OS_NAME ββ"show_message ""exit 1fi@@ -499,12 +524,17 @@ function install() {fi}function upgrade() {+ print_headerif [ "$(uname)" == "Linux" ]; thenOS="linux"- OS_NAME=$(awk -F= '/^ID=/{print $2}' /etc/os-release)- # check the OS- if [ "$OS_NAME" == "ubuntu" ]; then+ OS_NAME=$(sudo awk -F= '/^ID=/{print $2}' /etc/os-release)+ OS_NAME=$(echo "$OS_NAME" | tr -d '"')+ if [ "$OS_NAME" == "ubuntu" ] || [ "$OS_NAME" == "debian" ] ||+ [ "$OS_NAME" == "centos" ] || [ "$OS_NAME" == "amazon" ]; then+OS_SUPPORTED=true+ show_message "******** Upgrading Plane ********"+ show_message ""prepare_environment@@ -528,53 +558,49 @@ function upgrade() {exit 1fielse- PROGRESS_MSG="Unsupported OS Detected"+ PROGRESS_MSG="ββ Unsupported OS Varient Detected : $OS_NAME ββ"show_message ""exit 1fielse- PROGRESS_MSG="Unsupported OS Detected : $(uname)"+ PROGRESS_MSG="βββ Unsupported OS Detected : $(uname) βββ"show_message ""exit 1fi}function uninstall() {+ print_headerif [ "$(uname)" == "Linux" ]; thenOS="linux"OS_NAME=$(awk -F= '/^ID=/{print $2}' /etc/os-release)- # check the OS- if [ "$OS_NAME" == "ubuntu" ]; then+ OS_NAME=$(echo "$OS_NAME" | tr -d '"')+ if [ "$OS_NAME" == "ubuntu" ] || [ "$OS_NAME" == "debian" ] ||+ [ "$OS_NAME" == "centos" ] || [ "$OS_NAME" == "amazon" ]; then+OS_SUPPORTED=trueshow_message "******** Uninstalling Plane ********"show_message ""stop_server- # CHECK IF PLANE SERVICE EXISTS- # if [ -f "/etc/systemd/system/plane.service" ]; then- # sudo systemctl stop plane.service &> /dev/null- # sudo systemctl disable plane.service &> /dev/null- # sudo rm /etc/systemd/system/plane.service &> /dev/null- # sudo systemctl daemon-reload &> /dev/null- # fi- # show_message "- Plane Service removed β "if ! [ -x "$(command -v docker)" ]; thenecho "DOCKER_NOT_INSTALLED" &> /dev/nullelse# Ask of user input to confirm uninstall docker ?- CONFIRM_DOCKER_PURGE=$(dialog --title "Uninstall Docker" --yesno "Are you sure you want to uninstall docker ?" 8 60 3>&1 1>&2 2>&3)+ CONFIRM_DOCKER_PURGE=$(dialog --title "Uninstall Docker" --defaultno --yesno "Are you sure you want to uninstall docker ?" 8 60 3>&1 1>&2 2>&3)if [ $? -eq 0 ]; thenshow_message "- Uninstalling Docker β"- sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli docker-compose-plugin &> /dev/null- sudo apt-get autoremove -y --purge docker-engine docker docker.io docker-ce docker-compose-plugin &> /dev/null+ sudo docker images -q | xargs -r sudo docker rmi -f &> /dev/null+ sudo "$PACKAGE_MANAGER" remove -y docker-engine docker docker.io docker-ce docker-ce-cli docker-compose-plugin &> /dev/null+ sudo "$PACKAGE_MANAGER" autoremove -y docker-engine docker docker.io docker-ce docker-compose-plugin &> /dev/nullshow_message "- Docker Uninstalled β " "replace_last_line" >&2fifi- rm $PLANE_INSTALL_DIR/.env &> /dev/null- rm $PLANE_INSTALL_DIR/variables-upgrade.env &> /dev/null- rm $PLANE_INSTALL_DIR/config.env &> /dev/null- rm $PLANE_INSTALL_DIR/docker-compose.yaml &> /dev/null+ sudo rm $PLANE_INSTALL_DIR/.env &> /dev/null+ sudo rm $PLANE_INSTALL_DIR/variables-upgrade.env &> /dev/null+ sudo rm $PLANE_INSTALL_DIR/config.env &> /dev/null+ sudo rm $PLANE_INSTALL_DIR/docker-compose.yaml &> /dev/null# rm -rf $PLANE_INSTALL_DIR &> /dev/nullshow_message "- Configuration Cleaned β "@@ -593,12 +619,12 @@ function uninstall() {show_message ""show_message ""else- PROGRESS_MSG="Unsupported OS Detected : $(uname) β"+ PROGRESS_MSG="ββ Unsupported OS Varient Detected : $OS_NAME ββ"show_message ""exit 1fielse- PROGRESS_MSG="Unsupported OS Detected : $(uname) β"+ PROGRESS_MSG="βββ Unsupported OS Detected : $(uname) βββ"show_message ""exit 1fi@@ -608,15 +634,15 @@ function start_server() {env_file="$PLANE_INSTALL_DIR/.env"# check if both the files exitsif [ -f "$docker_compose_file" ] && [ -f "$env_file" ]; then- show_message "Starting Plane Server β"- docker compose -f $docker_compose_file --env-file=$env_file up -d+ show_message "Starting Plane Server ($APP_RELEASE) β"+ sudo docker compose -f $docker_compose_file --env-file=$env_file up -d# Wait for containers to be runningecho "Waiting for containers to start..."- while ! docker compose -f "$docker_compose_file" --env-file="$env_file" ps --services --filter "status=running" --quiet | grep -q "."; do+ while ! sudo docker compose -f "$docker_compose_file" --env-file="$env_file" ps --services --filter "status=running" --quiet | grep -q "."; dosleep 1done- show_message "Plane Server Started β " "replace_last_line" >&2+ show_message "Plane Server Started ($APP_RELEASE) β " "replace_last_line" >&2elseshow_message "Plane Server not installed. Please install Plane first β" "replace_last_line" >&2fi@@ -626,11 +652,11 @@ function stop_server() {env_file="$PLANE_INSTALL_DIR/.env"# check if both the files exitsif [ -f "$docker_compose_file" ] && [ -f "$env_file" ]; then- show_message "Stopping Plane Server β"- docker compose -f $docker_compose_file --env-file=$env_file down- show_message "Plane Server Stopped β " "replace_last_line" >&2+ show_message "Stopping Plane Server ($APP_RELEASE) β"+ sudo docker compose -f $docker_compose_file --env-file=$env_file down+ show_message "Plane Server Stopped ($APP_RELEASE) β " "replace_last_line" >&2else- show_message "Plane Server not installed. Please install Plane first β" "replace_last_line" >&2+ show_message "Plane Server not installed [Skipping] β " "replace_last_line" >&2fi}function restart_server() {@@ -638,9 +664,9 @@ function restart_server() {env_file="$PLANE_INSTALL_DIR/.env"# check if both the files exitsif [ -f "$docker_compose_file" ] && [ -f "$env_file" ]; then- show_message "Restarting Plane Server β"- docker compose -f $docker_compose_file --env-file=$env_file restart- show_message "Plane Server Restarted β " "replace_last_line" >&2+ show_message "Restarting Plane Server ($APP_RELEASE) β"+ sudo docker compose -f $docker_compose_file --env-file=$env_file restart+ show_message "Plane Server Restarted ($APP_RELEASE) β " "replace_last_line" >&2elseshow_message "Plane Server not installed. Please install Plane first β" "replace_last_line" >&2fi@@ -666,28 +692,45 @@ function show_help() {}function update_installer() {show_message "Updating Plane Installer β" >&2- curl -H 'Cache-Control: no-cache, no-store' \+ sudo curl -H 'Cache-Control: no-cache, no-store' \-s -o /usr/local/bin/plane-app \- https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/1-click/install.sh?token=$(date +%s)+ https://raw.githubusercontent.com/makeplane/plane/$DEPLOY_BRANCH/deploy/1-click/plane-app?token=$(date +%s)- chmod +x /usr/local/bin/plane-app > /dev/null&> /dev/null+ sudo chmod +x /usr/local/bin/plane-app > /dev/null&> /dev/nullshow_message "Plane Installer Updated β " "replace_last_line" >&2}-export BRANCH=${BRANCH:-master}-export APP_RELEASE=$BRANCH+export DEPLOY_BRANCH=${BRANCH:-master}+export APP_RELEASE=$DEPLOY_BRANCHexport DOCKERHUB_USER=makeplaneexport PULL_POLICY=always+if [ "$DEPLOY_BRANCH" == "master" ]; then+ export APP_RELEASE=latest+fi+PLANE_INSTALL_DIR=/opt/planeDATA_DIR=$PLANE_INSTALL_DIR/dataLOG_DIR=$PLANE_INSTALL_DIR/logOS_SUPPORTED=falseCPU_ARCH=$(uname -m)PROGRESS_MSG=""-USE_GLOBAL_IMAGES=1+USE_GLOBAL_IMAGES=0+PACKAGE_MANAGER=""++if [[ $CPU_ARCH == "amd64" || $CPU_ARCH == "x86_64" || ( $DEPLOY_BRANCH == "master" && ( $CPU_ARCH == "arm64" || $CPU_ARCH == "aarch64" ) ) ]]; then+ USE_GLOBAL_IMAGES=1+fi-mkdir -p $PLANE_INSTALL_DIR/{data,log}+sudo mkdir -p $PLANE_INSTALL_DIR/{data,log}++if command -v apt-get &> /dev/null; then+ PACKAGE_MANAGER="apt-get"+elif command -v yum &> /dev/null; then+ PACKAGE_MANAGER="yum"+elif command -v apk &> /dev/null; then+ PACKAGE_MANAGER="apk"+fiif [ "$1" == "start" ]; thenstart_server@@ -704,7 +747,7 @@ elif [ "$1" == "--upgrade" ] || [ "$1" == "-up" ]; thenupgradeelif [ "$1" == "--uninstall" ] || [ "$1" == "-un" ]; thenuninstall-elif [ "$1" == "--update-installer" ] || [ "$1" == "-ui" ] ; then+elif [ "$1" == "--update-installer" ] || [ "$1" == "-ui" ]; thenupdate_installerelif [ "$1" == "--help" ] || [ "$1" == "-h" ]; thenshow_helpdiff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.ymlindex b223e722ab..60861878cb 100644--- a/deploy/selfhost/docker-compose.yml+++ b/deploy/selfhost/docker-compose.yml@@ -38,10 +38,6 @@ x-app-env : &app-env- EMAIL_USE_SSL=${EMAIL_USE_SSL:-0}- DEFAULT_EMAIL=${DEFAULT_EMAIL:[email protected]}- DEFAULT_PASSWORD=${DEFAULT_PASSWORD:-password123}- # OPENAI SETTINGS - Deprecated can be configured through admin panel- - OPENAI_API_BASE=${OPENAI_API_BASE:-https://api.openai.com/v1}- - OPENAI_API_KEY=${OPENAI_API_KEY:-""}- - GPT_ENGINE=${GPT_ENGINE:-"gpt-3.5-turbo"}# LOGIN/SIGNUP SETTINGS - Deprecated can be configured through admin panel- ENABLE_SIGNUP=${ENABLE_SIGNUP:-1}- ENABLE_EMAIL_PASSWORD=${ENABLE_EMAIL_PASSWORD:-1}diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.shindex 4e505cff9c..30f2d15d72 100755--- a/deploy/selfhost/install.sh+++ b/deploy/selfhost/install.sh@@ -20,8 +20,8 @@ function buildLocalImage() {DO_BUILD="2"elseprintf "\n" >&2- printf "${YELLOW}You are on ${ARCH} cpu architecture. ${NC}\n" >&2- printf "${YELLOW}Since the prebuilt ${ARCH} compatible docker images are not available for, we will be running the docker build on this system. ${NC} \n" >&2+ printf "${YELLOW}You are on ${CPU_ARCH} cpu architecture. ${NC}\n" >&2+ printf "${YELLOW}Since the prebuilt ${CPU_ARCH} compatible docker images are not available for, we will be running the docker build on this system. ${NC} \n" >&2printf "${YELLOW}This might take ${YELLOW}5-30 min based on your system's hardware configuration. \n ${NC} \n" >&2printf "\n" >&2printf "${GREEN}Select an option to proceed: ${NC}\n" >&2@@ -149,7 +149,7 @@ function upgrade() {function askForAction() {echoecho "Select a Action you want to perform:"- echo " 1) Install (${ARCH})"+ echo " 1) Install (${CPU_ARCH})"echo " 2) Start"echo " 3) Stop"echo " 4) Restart"@@ -193,8 +193,8 @@ function askForAction() {}# CPU ARCHITECHTURE BASED SETTINGS-ARCH=$(uname -m)-if [ $ARCH == "amd64" ] || [ $ARCH == "x86_64" ];+CPU_ARCH=$(uname -m)+if [[ $CPU_ARCH == "amd64" || $CPU_ARCH == "x86_64" || ( $BRANCH == "master" && ( $CPU_ARCH == "arm64" || $CPU_ARCH == "aarch64" ) ) ]];thenUSE_GLOBAL_IMAGES=1DOCKERHUB_USER=makeplanediff --git a/deploy/selfhost/variables.env b/deploy/selfhost/variables.envindex 4a37818115..6d2cde0ffb 100644--- a/deploy/selfhost/variables.env+++ b/deploy/selfhost/variables.env@@ -8,13 +8,13 @@ NGINX_PORT=80WEB_URL=http://localhostDEBUG=0NEXT_PUBLIC_DEPLOY_URL=http://localhost/spaces-SENTRY_DSN=""-SENTRY_ENVIRONMENT="production"-GOOGLE_CLIENT_ID=""-GITHUB_CLIENT_ID=""-GITHUB_CLIENT_SECRET=""+SENTRY_DSN=+SENTRY_ENVIRONMENT=production+GOOGLE_CLIENT_ID=+GITHUB_CLIENT_ID=+GITHUB_CLIENT_SECRET=DOCKERIZED=1 # deprecated-CORS_ALLOWED_ORIGINS="http://localhost"+CORS_ALLOWED_ORIGINS=http://localhost#DB SETTINGSPGHOST=plane-db@@ -31,19 +31,14 @@ REDIS_PORT=6379REDIS_URL=redis://${REDIS_HOST}:6379/# EMAIL SETTINGS-EMAIL_HOST=""-EMAIL_HOST_USER=""-EMAIL_HOST_PASSWORD=""+EMAIL_HOST=+EMAIL_HOST_USER=+EMAIL_HOST_PASSWORD=EMAIL_PORT=587-EMAIL_FROM="Team Plane <[email protected]>"+EMAIL_FROM=Team Plane <[email protected]>EMAIL_USE_TLS=1EMAIL_USE_SSL=0-# OPENAI SETTINGS-OPENAI_API_BASE=https://api.openai.com/v1 # deprecated-OPENAI_API_KEY="sk-" # deprecated-GPT_ENGINE="gpt-3.5-turbo" # deprecated-# LOGIN/SIGNUP SETTINGSENABLE_SIGNUP=1ENABLE_EMAIL_PASSWORD=1@@ -52,13 +47,13 @@ SECRET_KEY=60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b5# DATA STORE SETTINGSUSE_MINIO=1-AWS_REGION=""-AWS_ACCESS_KEY_ID="access-key"-AWS_SECRET_ACCESS_KEY="secret-key"+AWS_REGION=+AWS_ACCESS_KEY_ID=access-key+AWS_SECRET_ACCESS_KEY=secret-keyAWS_S3_ENDPOINT_URL=http://plane-minio:9000AWS_S3_BUCKET_NAME=uploads-MINIO_ROOT_USER="access-key"-MINIO_ROOT_PASSWORD="secret-key"+MINIO_ROOT_USER=access-key+MINIO_ROOT_PASSWORD=secret-keyBUCKET_NAME=uploadsFILE_SIZE_LIMIT=5242880