Просмотр исходного кода

Merge branch 'master' of github.com:porter-dev/porter into 0.7.0-hpa-metrics

jnfrati 4 лет назад
Родитель
Сommit
cabff6aaeb

+ 5 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/SettingsSection.tsx

@@ -185,7 +185,11 @@ const SettingsSection: React.FC<PropsType> = ({
       return;
     }
 
-    const curlWebhook = `curl -X POST 'https://dashboard.getporter.dev/api/webhooks/deploy/${webhookToken}?commit=YOUR_COMMIT_HASH'`;
+    const protocol = window.location.protocol == "https:" ? "https" : "http";
+
+    const url = `${protocol}://${window.location.host}`;
+
+    const curlWebhook = `curl -X POST '${url}/api/webhooks/deploy/${webhookToken}?commit=YOUR_COMMIT_HASH'`;
 
     const isAuthorizedToCreateWebhook = isAuthorized("application", "", [
       "get",

+ 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 {