Skip to content

Commit

Permalink
fix: backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmerrell committed Feb 23, 2024
1 parent 88a0776 commit 239d8fd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/project/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ func startProject(networkVolumeId string) error {
projectPathUuidDev := path.Join(projectPathUuid, "dev")
projectPathUuidProd := path.Join(projectPathUuid, "prod")
remoteProjectPath := path.Join(projectPathUuidDev, projectName)
var fastAPIPort int
if strings.Contains(projectConfig.Get("ports").(string), "8080/http") && !strings.Contains(projectConfig.Get("ports").(string), "7270/http") {
fastAPIPort = 8080
} else {
fastAPIPort = 7270
}

fmt.Printf("Checking remote project folder: %s on Pod %s\n", remoteProjectPath, projectPodId)
sshConn.RunCommands([]string{fmt.Sprintf("mkdir -p %s %s", remoteProjectPath, projectPathUuidProd)})
//rsync project files
Expand Down Expand Up @@ -354,7 +361,7 @@ func startProject(networkVolumeId string) error {
launchApiServer := fmt.Sprintf(`
#!/bin/bash
if [ -z "${BASE_RELEASE_VERSION}" ]; then
API_PORT=7270
API_PORT=%d
else
API_PORT=7271
fi
Expand Down Expand Up @@ -492,7 +499,7 @@ func startProject(networkVolumeId string) error {
}
monitor_and_restart
`, venvPath, projectPathUuidDev, projectName, archivedVenvPath, handlerPath, pipReqPath)
`, fastAPIPort, venvPath, projectPathUuidDev, projectName, archivedVenvPath, handlerPath, pipReqPath)
fmt.Println()
fmt.Println("Starting project endpoint...")
sshConn.RunCommand(launchApiServer)
Expand Down

0 comments on commit 239d8fd

Please sign in to comment.