From 739da82c8a679717701343a61ae02abe38f53eb8 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 15:55:32 +0530 Subject: [PATCH 01/16] modifed action and install.sh for selfhost --- .github/workflows/build-branch.yml | 2 +- deploy/selfhost/install.sh | 107 +++++++++++++++++++++++++---- 2 files changed, 96 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 1e06c1bd319..2b201afbc1a 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -314,7 +314,7 @@ jobs: buildx-endpoint: ${{ needs.branch_build_setup.outputs.gh_buildx_endpoint }} attach_assets_to_build: - if: ${{ needs.branch_build_setup.outputs.build_type == 'Build' }} + if: ${{ needs.branch_build_setup.outputs.build_type == 'Release' }} name: Attach Assets to Build runs-on: ubuntu-20.04 needs: [branch_build_setup] diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index 08cd4d9169e..768d8c9525e 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -4,9 +4,11 @@ BRANCH=${BRANCH:-master} SCRIPT_DIR=$PWD SERVICE_FOLDER=plane-app PLANE_INSTALL_DIR=$PWD/$SERVICE_FOLDER -export APP_RELEASE="stable" +export APP_RELEASE=stable export DOCKERHUB_USER=makeplane export PULL_POLICY=${PULL_POLICY:-if_not_present} +export RELEASE_DOWNLOAD_URL="https://github.com/makeplane/plane/releases/download" +export FALLBACK_DOWNLOAD_URL="https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/selfhost" CPU_ARCH=$(uname -m) OS_NAME=$(uname) @@ -16,13 +18,6 @@ mkdir -p $PLANE_INSTALL_DIR/archive DOCKER_FILE_PATH=$PLANE_INSTALL_DIR/docker-compose.yaml DOCKER_ENV_PATH=$PLANE_INSTALL_DIR/plane.env -SED_PREFIX=() -if [ "$OS_NAME" == "Darwin" ]; then - SED_PREFIX=("-i" "") -else - SED_PREFIX=("-i") -fi - function print_header() { clear @@ -59,7 +54,26 @@ function spinner() { printf " \b\b\b\b" >&2 } +function checkLatestRelease(){ + echo "Checking for the latest release..." >&2 + local latest_release=$(curl -s https://api.github.com/repos/makeplane/plane/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g') + if [ -z "$latest_release" ]; then + echo "Failed to check for the latest release. Exiting..." >&2 + exit 1 + fi + + echo $latest_release +} + function initialize(){ + if [ -z "$APP_RELEASE" ]; then + export APP_RELEASE=stable + fi + + if [ "$APP_RELEASE" == "stable" ]; then + export APP_RELEASE=$(checkLatestRelease) + fi + printf "Please wait while we check the availability of Docker images for the selected release ($APP_RELEASE) with ${UPPER_CPU_ARCH} support." >&2 if [ "$CUSTOM_BUILD" == "true" ]; then @@ -130,8 +144,12 @@ function updateEnvFile() { echo "$key=$value" >> "$file" return else - # if key exists, update the value - sed "${SED_PREFIX[@]}" "s/^$key=.*/$key=$value/g" "$file" + if [ "$OS_NAME" == "Darwin" ]; then + value=$(echo "$value" | sed 's/|/\\|/g') + sed -i '' "s|^$key=.*|$key=$value|g" "$file" + else + sed -i "s/^$key=.*/$key=$value/g" "$file" + fi fi else echo "File not found: $file" @@ -232,8 +250,49 @@ function download() { mv $PLANE_INSTALL_DIR/docker-compose.yaml $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml fi - 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) - 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) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)) + BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') + STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + + if [ "$STATUS" -eq 200 ]; then + echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml + else + # Fallback to download from the raw github url + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)) + BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') + STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + + if [ "$STATUS" -eq 200 ]; then + echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml + else + echo "Failed to download docker-compose.yml. HTTP Status: $STATUS" + echo "URL: $RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml" + mv $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml $PLANE_INSTALL_DIR/docker-compose.yaml + exit 1 + fi + fi + + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)) + BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') + STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + + if [ "$STATUS" -eq 200 ]; then + echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env + else + # Fallback to download from the raw github url + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)) + BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') + STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + + if [ "$STATUS" -eq 200 ]; then + echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env + else + echo "Failed to download variables.env. HTTP Status: $STATUS" + echo "URL: $RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env" + mv $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml $PLANE_INSTALL_DIR/docker-compose.yaml + exit 1 + fi + fi if [ -f "$DOCKER_ENV_PATH" ]; then @@ -335,6 +394,30 @@ function restartServices() { startServices } function upgrade() { + local latest_release=$(checkLatestRelease) + + echo "Latest release: $latest_release" + echo "Current release: $APP_RELEASE" + + if [ "$latest_release" == "$APP_RELEASE" ]; then + echo "You are already using the latest release" + exit 0 + fi + + # Check for confirmation to upgrade + echo "Do you want to upgrade to the latest release ($latest_release)?" + read -p "Continue? [y/N]: " confirm + + if [[ ! "$confirm" =~ ^[Yy]$ ]]; then + echo "Exiting..." + exit 0 + fi + + export APP_RELEASE=$latest_release + + echo "Upgrading Plane to the latest release..." + echo "" + echo "***** STOPPING SERVICES ****" stopServices From 8e05f2831dd00597b58eb701ac88775f19880a96 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 17:44:13 +0530 Subject: [PATCH 02/16] updated selfhost readme and install.sh --- deploy/selfhost/README.md | 2 +- deploy/selfhost/install.sh | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/deploy/selfhost/README.md b/deploy/selfhost/README.md index d93d85ca14d..ccd8bf328ce 100644 --- a/deploy/selfhost/README.md +++ b/deploy/selfhost/README.md @@ -62,7 +62,7 @@ mkdir plane-selfhost cd plane-selfhost -curl -fsSL -o setup.sh https://raw.githubusercontent.com/makeplane/plane/master/deploy/selfhost/install.sh +curl -fsSL -o setup.sh https://github.com/makeplane/plane/releases/latest/download/setup.sh chmod +x setup.sh ``` diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index 768d8c9525e..736b7de67bb 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -7,8 +7,9 @@ PLANE_INSTALL_DIR=$PWD/$SERVICE_FOLDER export APP_RELEASE=stable export DOCKERHUB_USER=makeplane export PULL_POLICY=${PULL_POLICY:-if_not_present} -export RELEASE_DOWNLOAD_URL="https://github.com/makeplane/plane/releases/download" -export FALLBACK_DOWNLOAD_URL="https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/selfhost" +export GH_REPO=makeplane/plane +export RELEASE_DOWNLOAD_URL="https://github.com/$GH_REPO/releases/download" +export FALLBACK_DOWNLOAD_URL="https://raw.githubusercontent.com/$GH_REPO/$BRANCH/deploy/selfhost" CPU_ARCH=$(uname -m) OS_NAME=$(uname) @@ -56,7 +57,7 @@ function spinner() { function checkLatestRelease(){ echo "Checking for the latest release..." >&2 - local latest_release=$(curl -s https://api.github.com/repos/makeplane/plane/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g') + local latest_release=$(curl -s https://api.github.com/repos/$GH_REPO/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g') if [ -z "$latest_release" ]; then echo "Failed to check for the latest release. Exiting..." >&2 exit 1 @@ -200,7 +201,7 @@ function buildYourOwnImage(){ local PLANE_TEMP_CODE_DIR=~/tmp/plane rm -rf $PLANE_TEMP_CODE_DIR mkdir -p $PLANE_TEMP_CODE_DIR - REPO=https://github.com/makeplane/plane.git + REPO=https://github.com/$GH_REPO.git git clone "$REPO" "$PLANE_TEMP_CODE_DIR" --branch "$BRANCH" --single-branch --depth 1 cp "$PLANE_TEMP_CODE_DIR/deploy/selfhost/build.yml" "$PLANE_TEMP_CODE_DIR/build.yml" @@ -222,6 +223,10 @@ function install() { echo "Begin Installing Plane" echo "" + if [ "$APP_RELEASE" == "stable" ]; then + export APP_RELEASE=$(checkLatestRelease) + fi + local build_image=$(initialize) if [ "$build_image" == "build" ]; then From 9b0a7216d4c5462090c1c0d249925cc743d17360 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 17:50:06 +0530 Subject: [PATCH 03/16] fixes --- deploy/selfhost/install.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index 736b7de67bb..d9d0aecce50 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -67,14 +67,6 @@ function checkLatestRelease(){ } function initialize(){ - if [ -z "$APP_RELEASE" ]; then - export APP_RELEASE=stable - fi - - if [ "$APP_RELEASE" == "stable" ]; then - export APP_RELEASE=$(checkLatestRelease) - fi - printf "Please wait while we check the availability of Docker images for the selected release ($APP_RELEASE) with ${UPPER_CPU_ARCH} support." >&2 if [ "$CUSTOM_BUILD" == "true" ]; then @@ -401,14 +393,18 @@ function restartServices() { function upgrade() { local latest_release=$(checkLatestRelease) - echo "Latest release: $latest_release" + echo "" echo "Current release: $APP_RELEASE" if [ "$latest_release" == "$APP_RELEASE" ]; then + echo "" echo "You are already using the latest release" exit 0 fi + echo "Latest release: $latest_release" + echo "" + # Check for confirmation to upgrade echo "Do you want to upgrade to the latest release ($latest_release)?" read -p "Continue? [y/N]: " confirm From c4167805fd27dbc9b286811fe8c2bd3c6ba13f5f Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 17:59:08 +0530 Subject: [PATCH 04/16] changes suggested by code-rabbit --- deploy/selfhost/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index d9d0aecce50..1c2208cab7c 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -247,7 +247,7 @@ function download() { mv $PLANE_INSTALL_DIR/docker-compose.yaml $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml fi - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -255,7 +255,7 @@ function download() { echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml else # Fallback to download from the raw github url - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -269,7 +269,7 @@ function download() { fi fi - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -277,7 +277,7 @@ function download() { echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env else # Fallback to download from the raw github url - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') From 3301767e75ec0d9b5597a0fc9f851be5009b1d01 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Thu, 5 Dec 2024 15:12:37 +0530 Subject: [PATCH 05/16] chore: updated powered by (#6160) --- space/app/issues/[anchor]/client-layout.tsx | 15 +++++++++------ space/app/views/[anchor]/layout.tsx | 3 ++- space/app/views/[anchor]/page.tsx | 9 ++++++++- space/core/components/account/user-logged-in.tsx | 2 ++ space/core/components/views/auth.tsx | 2 ++ space/core/lib/instance-provider.tsx | 9 ++------- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/space/app/issues/[anchor]/client-layout.tsx b/space/app/issues/[anchor]/client-layout.tsx index b100e57c6f5..0e24ab55163 100644 --- a/space/app/issues/[anchor]/client-layout.tsx +++ b/space/app/issues/[anchor]/client-layout.tsx @@ -3,7 +3,7 @@ import { observer } from "mobx-react"; import useSWR from "swr"; // components -import { LogoSpinner } from "@/components/common"; +import { LogoSpinner, PoweredBy } from "@/components/common"; import { IssuesNavbarRoot } from "@/components/issues"; import { SomethingWentWrongError } from "@/components/issues/issue-layouts/error"; // hooks @@ -44,11 +44,14 @@ export const IssuesClientLayout = observer((props: Props) => { if (error) return ; return ( -
-
- + <> +
+
+ +
+
{children}
-
{children}
-
+ + ); }); diff --git a/space/app/views/[anchor]/layout.tsx b/space/app/views/[anchor]/layout.tsx index 6f286efe2e8..57b2971c4c3 100644 --- a/space/app/views/[anchor]/layout.tsx +++ b/space/app/views/[anchor]/layout.tsx @@ -3,7 +3,7 @@ import { observer } from "mobx-react"; import useSWR from "swr"; // components -import { LogoSpinner } from "@/components/common"; +import { LogoSpinner, PoweredBy } from "@/components/common"; import { SomethingWentWrongError } from "@/components/issues/issue-layouts/error"; // hooks import { usePublish, usePublishList } from "@/hooks/store"; @@ -50,6 +50,7 @@ const IssuesLayout = observer((props: Props) => {
{children}
+ ); }); diff --git a/space/app/views/[anchor]/page.tsx b/space/app/views/[anchor]/page.tsx index 21bb5a96574..1efd95a5337 100644 --- a/space/app/views/[anchor]/page.tsx +++ b/space/app/views/[anchor]/page.tsx @@ -2,6 +2,8 @@ import { observer } from "mobx-react"; import { useSearchParams } from "next/navigation"; +// components +import { PoweredBy } from "@/components/common"; // hooks import { usePublish } from "@/hooks/store"; // plane-web @@ -24,7 +26,12 @@ const IssuesPage = observer((props: Props) => { if (!publishSettings) return null; - return ; + return ( + <> + + + + ); }); export default IssuesPage; diff --git a/space/core/components/account/user-logged-in.tsx b/space/core/components/account/user-logged-in.tsx index 4bedc459643..0993ade9208 100644 --- a/space/core/components/account/user-logged-in.tsx +++ b/space/core/components/account/user-logged-in.tsx @@ -4,6 +4,7 @@ import { observer } from "mobx-react"; import Image from "next/image"; import { useTheme } from "next-themes"; // components +import { PoweredBy } from "@/components/common"; import { UserAvatar } from "@/components/issues"; // hooks import { useUser } from "@/hooks/store"; @@ -45,6 +46,7 @@ export const UserLoggedIn = observer(() => {

+ ); }); diff --git a/space/core/components/views/auth.tsx b/space/core/components/views/auth.tsx index d9dbbb3bc40..39d830a92a2 100644 --- a/space/core/components/views/auth.tsx +++ b/space/core/components/views/auth.tsx @@ -7,6 +7,7 @@ import { useTheme } from "next-themes"; import { SPACE_BASE_PATH } from "@plane/constants"; // components import { AuthRoot } from "@/components/account"; +import { PoweredBy } from "@/components/common"; // images import PlaneBackgroundPatternDark from "@/public/auth/background-pattern-dark.svg"; import PlaneBackgroundPattern from "@/public/auth/background-pattern.svg"; @@ -40,6 +41,7 @@ export const AuthView = observer(() => { + ); }); diff --git a/space/core/lib/instance-provider.tsx b/space/core/lib/instance-provider.tsx index a09e5f9a6c4..06056364f37 100644 --- a/space/core/lib/instance-provider.tsx +++ b/space/core/lib/instance-provider.tsx @@ -8,7 +8,7 @@ import { useTheme } from "next-themes"; import useSWR from "swr"; import { SPACE_BASE_PATH } from "@plane/constants"; // components -import { LogoSpinner, PoweredBy } from "@/components/common"; +import { LogoSpinner } from "@/components/common"; import { InstanceFailureView } from "@/components/instance"; // hooks import { useInstance, useUser } from "@/hooks/store"; @@ -68,10 +68,5 @@ export const InstanceProvider = observer(({ children }: { children: ReactNode }) ); } - return ( - <> - {children} - - - ); + return children; }); From 0faf16f602c613bd5f1fecb7f9328814c5d537df Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Thu, 5 Dec 2024 15:26:15 +0530 Subject: [PATCH 06/16] improvement: update fetch map during workspace-level module fetch to reduce redundant API calls (#6159) --- web/core/store/module.store.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/core/store/module.store.ts b/web/core/store/module.store.ts index f7a99a5c431..23f2af67205 100644 --- a/web/core/store/module.store.ts +++ b/web/core/store/module.store.ts @@ -39,7 +39,7 @@ export interface IModuleStore { updateModuleDistribution: (distributionUpdates: DistributionUpdates, moduleId: string) => void; fetchWorkspaceModules: (workspaceSlug: string) => Promise; fetchModules: (workspaceSlug: string, projectId: string) => Promise; - fetchModulesSlim: (workspaceSlug: string, projectId: string) => Promise + fetchModulesSlim: (workspaceSlug: string, projectId: string) => Promise; fetchArchivedModules: (workspaceSlug: string, projectId: string) => Promise; fetchArchivedModuleDetails: (workspaceSlug: string, projectId: string, moduleId: string) => Promise; fetchModuleDetails: (workspaceSlug: string, projectId: string, moduleId: string) => Promise; @@ -253,6 +253,11 @@ export class ModulesStore implements IModuleStore { response.forEach((module) => { set(this.moduleMap, [module.id], { ...this.moduleMap[module.id], ...module }); }); + // check for all unique project ids and update the fetchedMap + const uniqueProjectIds = new Set(response.map((module) => module.project_id)); + uniqueProjectIds.forEach((projectId) => { + set(this.fetchedMap, projectId, true); + }); }); return response; }); From d376c24cf5751c3a2bb57c43ad1371d88471ebdf Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Thu, 5 Dec 2024 15:26:35 +0530 Subject: [PATCH 07/16] fix: remove unwanted states fetching logic to avoid multiple API calls. (#6158) --- web/core/components/dropdowns/state.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/web/core/components/dropdowns/state.tsx b/web/core/components/dropdowns/state.tsx index 8cd4cdf4826..86d8d80521c 100644 --- a/web/core/components/dropdowns/state.tsx +++ b/web/core/components/dropdowns/state.tsx @@ -1,6 +1,6 @@ "use client"; -import { ReactNode, useEffect, useRef, useState } from "react"; +import { ReactNode, useRef, useState } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import { usePopper } from "react-popper"; @@ -125,11 +125,6 @@ export const StateDropdown: React.FC = observer((props) => { setQuery, }); - useEffect(() => { - if (projectId) onOpen(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [projectId]); - const dropdownOnChange = (val: string) => { onChange(val); handleClose(); From dd920611c67bc164258a5a1c3e8bb09f2ccb5263 Mon Sep 17 00:00:00 2001 From: rahulramesha <71900764+rahulramesha@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:37:55 +0530 Subject: [PATCH 08/16] chore remove unnecessary CTA (#6161) --- web/ce/components/workflow/state-item-child.tsx | 6 +++++- web/core/constants/state.ts | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/web/ce/components/workflow/state-item-child.tsx b/web/ce/components/workflow/state-item-child.tsx index aa94b52815c..2c07fd9ff00 100644 --- a/web/ce/components/workflow/state-item-child.tsx +++ b/web/ce/components/workflow/state-item-child.tsx @@ -4,6 +4,8 @@ import { observer } from "mobx-react"; import { IState } from "@plane/types"; // components import { StateItemTitle } from "@/components/project-states/state-item-title"; +// constants +import { DISPLAY_WORKFLOW_PRO_CTA } from "@/constants/state"; // import { AddStateTransition } from "./add-state-transition"; @@ -29,7 +31,9 @@ export const StateItemChild = observer((props: StateItemChildProps) => { disabled={disabled} state={state} /> - + {DISPLAY_WORKFLOW_PRO_CTA && ( + + )} ); }); diff --git a/web/core/constants/state.ts b/web/core/constants/state.ts index b35951046b2..24d10cf5669 100644 --- a/web/core/constants/state.ts +++ b/web/core/constants/state.ts @@ -47,3 +47,5 @@ export const PENDING_STATE_GROUPS = [ STATE_GROUPS.started.key, STATE_GROUPS.cancelled.key, ]; + +export const DISPLAY_WORKFLOW_PRO_CTA = false; From b6b8abb1861afd59ec8e0e6b15b2176ab1971cf8 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Thu, 5 Dec 2024 16:51:20 +0530 Subject: [PATCH 09/16] fix: build branch workflow upload artifacts --- .github/workflows/build-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 2b201afbc1a..627c782f998 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -315,7 +315,7 @@ jobs: attach_assets_to_build: if: ${{ needs.branch_build_setup.outputs.build_type == 'Release' }} - name: Attach Assets to Build + name: Attach Assets to Release runs-on: ubuntu-20.04 needs: [branch_build_setup] steps: From 9b5949e9b35b6a794a3c095520137215f9247c36 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 17:50:06 +0530 Subject: [PATCH 10/16] fixes --- deploy/selfhost/install.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index 736b7de67bb..d9d0aecce50 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -67,14 +67,6 @@ function checkLatestRelease(){ } function initialize(){ - if [ -z "$APP_RELEASE" ]; then - export APP_RELEASE=stable - fi - - if [ "$APP_RELEASE" == "stable" ]; then - export APP_RELEASE=$(checkLatestRelease) - fi - printf "Please wait while we check the availability of Docker images for the selected release ($APP_RELEASE) with ${UPPER_CPU_ARCH} support." >&2 if [ "$CUSTOM_BUILD" == "true" ]; then @@ -401,14 +393,18 @@ function restartServices() { function upgrade() { local latest_release=$(checkLatestRelease) - echo "Latest release: $latest_release" + echo "" echo "Current release: $APP_RELEASE" if [ "$latest_release" == "$APP_RELEASE" ]; then + echo "" echo "You are already using the latest release" exit 0 fi + echo "Latest release: $latest_release" + echo "" + # Check for confirmation to upgrade echo "Do you want to upgrade to the latest release ($latest_release)?" read -p "Continue? [y/N]: " confirm From da3d867c5202448fc1c8c254ca22e7d1d8942856 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 17:59:08 +0530 Subject: [PATCH 11/16] changes suggested by code-rabbit --- deploy/selfhost/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index d9d0aecce50..1c2208cab7c 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -247,7 +247,7 @@ function download() { mv $PLANE_INSTALL_DIR/docker-compose.yaml $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml fi - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -255,7 +255,7 @@ function download() { echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml else # Fallback to download from the raw github url - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -269,7 +269,7 @@ function download() { fi fi - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -277,7 +277,7 @@ function download() { echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env else # Fallback to download from the raw github url - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') From 99ff0e6ba9383e94496c65005428daa48b9bbb80 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 15:55:32 +0530 Subject: [PATCH 12/16] modifed action and install.sh for selfhost --- .github/workflows/build-branch.yml | 2 +- deploy/selfhost/install.sh | 107 +++++++++++++++++++++++++---- 2 files changed, 96 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 627c782f998..2b201afbc1a 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -315,7 +315,7 @@ jobs: attach_assets_to_build: if: ${{ needs.branch_build_setup.outputs.build_type == 'Release' }} - name: Attach Assets to Release + name: Attach Assets to Build runs-on: ubuntu-20.04 needs: [branch_build_setup] steps: diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index 08cd4d9169e..768d8c9525e 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -4,9 +4,11 @@ BRANCH=${BRANCH:-master} SCRIPT_DIR=$PWD SERVICE_FOLDER=plane-app PLANE_INSTALL_DIR=$PWD/$SERVICE_FOLDER -export APP_RELEASE="stable" +export APP_RELEASE=stable export DOCKERHUB_USER=makeplane export PULL_POLICY=${PULL_POLICY:-if_not_present} +export RELEASE_DOWNLOAD_URL="https://github.com/makeplane/plane/releases/download" +export FALLBACK_DOWNLOAD_URL="https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/selfhost" CPU_ARCH=$(uname -m) OS_NAME=$(uname) @@ -16,13 +18,6 @@ mkdir -p $PLANE_INSTALL_DIR/archive DOCKER_FILE_PATH=$PLANE_INSTALL_DIR/docker-compose.yaml DOCKER_ENV_PATH=$PLANE_INSTALL_DIR/plane.env -SED_PREFIX=() -if [ "$OS_NAME" == "Darwin" ]; then - SED_PREFIX=("-i" "") -else - SED_PREFIX=("-i") -fi - function print_header() { clear @@ -59,7 +54,26 @@ function spinner() { printf " \b\b\b\b" >&2 } +function checkLatestRelease(){ + echo "Checking for the latest release..." >&2 + local latest_release=$(curl -s https://api.github.com/repos/makeplane/plane/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g') + if [ -z "$latest_release" ]; then + echo "Failed to check for the latest release. Exiting..." >&2 + exit 1 + fi + + echo $latest_release +} + function initialize(){ + if [ -z "$APP_RELEASE" ]; then + export APP_RELEASE=stable + fi + + if [ "$APP_RELEASE" == "stable" ]; then + export APP_RELEASE=$(checkLatestRelease) + fi + printf "Please wait while we check the availability of Docker images for the selected release ($APP_RELEASE) with ${UPPER_CPU_ARCH} support." >&2 if [ "$CUSTOM_BUILD" == "true" ]; then @@ -130,8 +144,12 @@ function updateEnvFile() { echo "$key=$value" >> "$file" return else - # if key exists, update the value - sed "${SED_PREFIX[@]}" "s/^$key=.*/$key=$value/g" "$file" + if [ "$OS_NAME" == "Darwin" ]; then + value=$(echo "$value" | sed 's/|/\\|/g') + sed -i '' "s|^$key=.*|$key=$value|g" "$file" + else + sed -i "s/^$key=.*/$key=$value/g" "$file" + fi fi else echo "File not found: $file" @@ -232,8 +250,49 @@ function download() { mv $PLANE_INSTALL_DIR/docker-compose.yaml $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml fi - 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) - 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) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)) + BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') + STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + + if [ "$STATUS" -eq 200 ]; then + echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml + else + # Fallback to download from the raw github url + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)) + BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') + STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + + if [ "$STATUS" -eq 200 ]; then + echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml + else + echo "Failed to download docker-compose.yml. HTTP Status: $STATUS" + echo "URL: $RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml" + mv $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml $PLANE_INSTALL_DIR/docker-compose.yaml + exit 1 + fi + fi + + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)) + BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') + STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + + if [ "$STATUS" -eq 200 ]; then + echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env + else + # Fallback to download from the raw github url + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)) + BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') + STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') + + if [ "$STATUS" -eq 200 ]; then + echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env + else + echo "Failed to download variables.env. HTTP Status: $STATUS" + echo "URL: $RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env" + mv $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml $PLANE_INSTALL_DIR/docker-compose.yaml + exit 1 + fi + fi if [ -f "$DOCKER_ENV_PATH" ]; then @@ -335,6 +394,30 @@ function restartServices() { startServices } function upgrade() { + local latest_release=$(checkLatestRelease) + + echo "Latest release: $latest_release" + echo "Current release: $APP_RELEASE" + + if [ "$latest_release" == "$APP_RELEASE" ]; then + echo "You are already using the latest release" + exit 0 + fi + + # Check for confirmation to upgrade + echo "Do you want to upgrade to the latest release ($latest_release)?" + read -p "Continue? [y/N]: " confirm + + if [[ ! "$confirm" =~ ^[Yy]$ ]]; then + echo "Exiting..." + exit 0 + fi + + export APP_RELEASE=$latest_release + + echo "Upgrading Plane to the latest release..." + echo "" + echo "***** STOPPING SERVICES ****" stopServices From 9dfcc77b2a864a12a71cb50e1f82f6a0530f2291 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 17:44:13 +0530 Subject: [PATCH 13/16] updated selfhost readme and install.sh --- deploy/selfhost/README.md | 2 +- deploy/selfhost/install.sh | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/deploy/selfhost/README.md b/deploy/selfhost/README.md index d93d85ca14d..ccd8bf328ce 100644 --- a/deploy/selfhost/README.md +++ b/deploy/selfhost/README.md @@ -62,7 +62,7 @@ mkdir plane-selfhost cd plane-selfhost -curl -fsSL -o setup.sh https://raw.githubusercontent.com/makeplane/plane/master/deploy/selfhost/install.sh +curl -fsSL -o setup.sh https://github.com/makeplane/plane/releases/latest/download/setup.sh chmod +x setup.sh ``` diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index 768d8c9525e..736b7de67bb 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -7,8 +7,9 @@ PLANE_INSTALL_DIR=$PWD/$SERVICE_FOLDER export APP_RELEASE=stable export DOCKERHUB_USER=makeplane export PULL_POLICY=${PULL_POLICY:-if_not_present} -export RELEASE_DOWNLOAD_URL="https://github.com/makeplane/plane/releases/download" -export FALLBACK_DOWNLOAD_URL="https://raw.githubusercontent.com/makeplane/plane/$BRANCH/deploy/selfhost" +export GH_REPO=makeplane/plane +export RELEASE_DOWNLOAD_URL="https://github.com/$GH_REPO/releases/download" +export FALLBACK_DOWNLOAD_URL="https://raw.githubusercontent.com/$GH_REPO/$BRANCH/deploy/selfhost" CPU_ARCH=$(uname -m) OS_NAME=$(uname) @@ -56,7 +57,7 @@ function spinner() { function checkLatestRelease(){ echo "Checking for the latest release..." >&2 - local latest_release=$(curl -s https://api.github.com/repos/makeplane/plane/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g') + local latest_release=$(curl -s https://api.github.com/repos/$GH_REPO/releases/latest | grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g') if [ -z "$latest_release" ]; then echo "Failed to check for the latest release. Exiting..." >&2 exit 1 @@ -200,7 +201,7 @@ function buildYourOwnImage(){ local PLANE_TEMP_CODE_DIR=~/tmp/plane rm -rf $PLANE_TEMP_CODE_DIR mkdir -p $PLANE_TEMP_CODE_DIR - REPO=https://github.com/makeplane/plane.git + REPO=https://github.com/$GH_REPO.git git clone "$REPO" "$PLANE_TEMP_CODE_DIR" --branch "$BRANCH" --single-branch --depth 1 cp "$PLANE_TEMP_CODE_DIR/deploy/selfhost/build.yml" "$PLANE_TEMP_CODE_DIR/build.yml" @@ -222,6 +223,10 @@ function install() { echo "Begin Installing Plane" echo "" + if [ "$APP_RELEASE" == "stable" ]; then + export APP_RELEASE=$(checkLatestRelease) + fi + local build_image=$(initialize) if [ "$build_image" == "build" ]; then From 1ca40f3002f658cfad8a89b6416936685fe49839 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Thu, 5 Dec 2024 16:51:20 +0530 Subject: [PATCH 14/16] fix: build branch workflow upload artifacts --- .github/workflows/build-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-branch.yml b/.github/workflows/build-branch.yml index 2b201afbc1a..627c782f998 100644 --- a/.github/workflows/build-branch.yml +++ b/.github/workflows/build-branch.yml @@ -315,7 +315,7 @@ jobs: attach_assets_to_build: if: ${{ needs.branch_build_setup.outputs.build_type == 'Release' }} - name: Attach Assets to Build + name: Attach Assets to Release runs-on: ubuntu-20.04 needs: [branch_build_setup] steps: From 771aac18f3124b05b68e078bdc2691fd3a08efcc Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 17:50:06 +0530 Subject: [PATCH 15/16] fixes --- deploy/selfhost/install.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index 736b7de67bb..d9d0aecce50 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -67,14 +67,6 @@ function checkLatestRelease(){ } function initialize(){ - if [ -z "$APP_RELEASE" ]; then - export APP_RELEASE=stable - fi - - if [ "$APP_RELEASE" == "stable" ]; then - export APP_RELEASE=$(checkLatestRelease) - fi - printf "Please wait while we check the availability of Docker images for the selected release ($APP_RELEASE) with ${UPPER_CPU_ARCH} support." >&2 if [ "$CUSTOM_BUILD" == "true" ]; then @@ -401,14 +393,18 @@ function restartServices() { function upgrade() { local latest_release=$(checkLatestRelease) - echo "Latest release: $latest_release" + echo "" echo "Current release: $APP_RELEASE" if [ "$latest_release" == "$APP_RELEASE" ]; then + echo "" echo "You are already using the latest release" exit 0 fi + echo "Latest release: $latest_release" + echo "" + # Check for confirmation to upgrade echo "Do you want to upgrade to the latest release ($latest_release)?" read -p "Continue? [y/N]: " confirm From 19a1ac719a71cf804763f83dd7181fe7adc9ba13 Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Thu, 5 Dec 2024 18:16:35 +0530 Subject: [PATCH 16/16] changes suggested by code-rabbit --- deploy/selfhost/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index d9d0aecce50..1c2208cab7c 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -247,7 +247,7 @@ function download() { mv $PLANE_INSTALL_DIR/docker-compose.yaml $PLANE_INSTALL_DIR/archive/$TS.docker-compose.yaml fi - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/docker-compose.yml?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -255,7 +255,7 @@ function download() { echo "$BODY" > $PLANE_INSTALL_DIR/docker-compose.yaml else # Fallback to download from the raw github url - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/docker-compose.yml?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -269,7 +269,7 @@ function download() { fi fi - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$RELEASE_DOWNLOAD_URL/$APP_RELEASE/variables.env?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') @@ -277,7 +277,7 @@ function download() { echo "$BODY" > $PLANE_INSTALL_DIR/variables-upgrade.env else # Fallback to download from the raw github url - RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" $FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)) + RESPONSE=$(curl -H 'Cache-Control: no-cache, no-store' -s -w "HTTPSTATUS:%{http_code}" "$FALLBACK_DOWNLOAD_URL/variables.env?$(date +%s)") BODY=$(echo "$RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g') STATUS=$(echo "$RESPONSE" | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')