2
0
Эх сурвалжийг харах

Merge pull request #927 from porter-dev/master

Old GH deployment fix -> staging
abelanger5 4 жил өмнө
parent
commit
dde312f4ce

+ 4 - 1
internal/models/gitrepo.go

@@ -62,7 +62,10 @@ type GitActionConfig struct {
 	ImageRepoURI string `json:"image_repo_uri"`
 
 	// The git installation ID
-	GithubInstallationID uint `json:"git_repo_id"`
+	GithubInstallationID uint `json:"git_installation_id"`
+
+	// The git repo ID (legacy field)
+	GitRepoID uint `json:"git_repo_id"`
 
 	// The path to the dockerfile in the git repo
 	DockerfilePath string `json:"dockerfile_path"`

+ 1 - 1
server/api/deploy_handler.go

@@ -352,7 +352,7 @@ func (app *App) HandleUninstallTemplate(w http.ResponseWriter, r *http.Request)
 
 				yaml.Unmarshal(rawValues, cEnv)
 
-				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GithubInstallationID)
+				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GitRepoID)
 
 				if err != nil {
 					if err != gorm.ErrRecordNotFound {

+ 2 - 2
server/api/release_handler.go

@@ -1028,7 +1028,7 @@ func (app *App) HandleUpgradeRelease(w http.ResponseWriter, r *http.Request) {
 
 				yaml.Unmarshal([]byte(form.Values), cEnv)
 
-				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GithubInstallationID)
+				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GitRepoID)
 
 				if err != nil {
 					if err != gorm.ErrRecordNotFound {
@@ -1408,7 +1408,7 @@ func (app *App) HandleRollbackRelease(w http.ResponseWriter, r *http.Request) {
 
 				yaml.Unmarshal(rawValues, cEnv)
 
-				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GithubInstallationID)
+				gr, err := app.Repo.GitRepo.ReadGitRepo(gitAction.GitRepoID)
 
 				if err != nil {
 					if err != gorm.ErrRecordNotFound {