瀏覽代碼

[POR-1001] Fix procfile subfolder support (#2832)

* [POR-1001] Fix procfile subfolder support

* Fix trailing /

---------

Co-authored-by: Soham Dessai <sohamdessai@Sohams-MacBook-Pro.local>
Co-authored-by: Soham Dessai <sohamdessai@sohams-mbp.mynetworksettings.com>
sdess09 3 年之前
父節點
當前提交
20b77fef58
共有 1 個文件被更改,包括 16 次插入3 次删除
  1. 16 3
      dashboard/src/components/repo-selector/ActionDetails.tsx

+ 16 - 3
dashboard/src/components/repo-selector/ActionDetails.tsx

@@ -32,6 +32,7 @@ const ActionDetails: React.FC<PropsType> = (props) => {
     branch,
     dockerfilePath,
     folderPath,
+    procfilePath,
     selectedRegistry,
     setDockerfilePath,
     setFolderPath,
@@ -137,14 +138,26 @@ const ActionDetails: React.FC<PropsType> = (props) => {
         />
       )}
       <InputRow
-        // Currently there is a bug which is failing to detect the correct application folder root path. As a hotfix, we are enabling the user to manually set the application folder path.
         disabled={false}
         label={dockerfilePath ? "Docker build context" : "Application folder"}
         type="text"
         width="100%"
-        setValue={(value) => typeof value === "string" && setFolderPath(value)}
-        value={folderPath}
+        setValue={(value) =>
+          typeof value === "string" && dockerfilePath
+            ? setFolderPath(value)
+            : typeof value === "string" && setProcfilePath(value)
+        }
+        value={
+          dockerfilePath
+            ? folderPath
+            : procfilePath
+            ? procfilePath.replace(/\/Procfile.*$/, "") === "."
+              ? "./"
+              : procfilePath.replace(/\/Procfile.*$/, "")
+            : folderPath
+        }
       />
+
       {renderRegistrySection()}
       {!dockerfilePath && (
         <>