Browse Source

Merge pull request #1021 from porter-dev/master

Current cluster fix -> staging
abelanger5 4 years ago
parent
commit
dd87769bb9

+ 4 - 12
.github/workflows/release.yaml

@@ -27,11 +27,8 @@ jobs:
         run: |
         run: |
           cat >./dashboard/.env <<EOL
           cat >./dashboard/.env <<EOL
           NODE_ENV=production
           NODE_ENV=production
-          API_SERVER=dashboard.getporter.dev
-          FULLSTORY_ORG_ID=${{secrets.FULLSTORY_ORG_ID}}
-          DISCORD_KEY=${{secrets.DISCORD_KEY}}
-          DISCORD_CID=${{secrets.DISCORD_CID}}
-          FEEDBACK_ENDPOINT=${{secrets.FEEDBACK_ENDPOINT}}
+          APPLICATION_CHART_REPO_URL=https://charts.getporter.dev
+          ADDON_CHART_REPO_URL=https://chart-addons.getporter.dev
           EOL
           EOL
 
 
           cat ./dashboard/.env
           cat ./dashboard/.env
@@ -62,13 +59,8 @@ jobs:
         run: |
         run: |
           cat >./dashboard/.env <<EOL
           cat >./dashboard/.env <<EOL
           NODE_ENV=production
           NODE_ENV=production
-          API_SERVER=dashboard.getporter.dev
-          FULLSTORY_ORG_ID=${{secrets.FULLSTORY_ORG_ID}}
-          DISCORD_KEY=${{secrets.DISCORD_KEY}}
-          DISCORD_CID=${{secrets.DISCORD_CID}}
-          FEEDBACK_ENDPOINT=${{secrets.FEEDBACK_ENDPOINT}}
-          POSTHOG_API_KEY=${{secrets.POSTHOG_API_KEY}}
-          POSTHOG_HOST=${{secrets.POSTHOG_HOST}}
+          APPLICATION_CHART_REPO_URL=https://charts.getporter.dev
+          ADDON_CHART_REPO_URL=https://chart-addons.getporter.dev
           EOL
           EOL
       - name: Build and zip static folder
       - name: Build and zip static folder
         run: |
         run: |

+ 11 - 1
dashboard/src/components/porter-form/PorterFormContextProvider.tsx

@@ -132,7 +132,17 @@ export const PorterFormContextProvider: React.FC<Props> = (props) => {
         })
         })
       )
       )
     );
     );
-    return ret;
+    return {
+      ...ret,
+      ...{
+        "currentCluster.service.is_gcp":
+          context.currentCluster?.service == "gke",
+        "currentCluster.service.is_aws":
+          context.currentCluster?.service == "eks",
+        "currentCluster.service.is_do":
+          context.currentCluster?.service == "doks",
+      },
+    };
   };
   };
 
 
   const getInitialValidation = (data: PorterFormData) => {
   const getInitialValidation = (data: PorterFormData) => {

+ 2 - 1
internal/integrations/ci/actions/actions.go

@@ -29,6 +29,7 @@ type GithubActions struct {
 
 
 	GithubConf           *oauth2.Config // one of these will let us authenticate
 	GithubConf           *oauth2.Config // one of these will let us authenticate
 	GithubAppID          int64
 	GithubAppID          int64
+	GithubAppSecretPath  string
 	GithubInstallationID uint
 	GithubInstallationID uint
 
 
 	WebhookToken string
 	WebhookToken string
@@ -229,7 +230,7 @@ func (g *GithubActions) getClient() (*github.Client, error) {
 		http.DefaultTransport,
 		http.DefaultTransport,
 		g.GithubAppID,
 		g.GithubAppID,
 		int64(g.GithubInstallationID),
 		int64(g.GithubInstallationID),
-		"/porter/docker/github_app_private_key.pem")
+		g.GithubAppSecretPath)
 
 
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err

+ 1 - 0
server/api/deploy_handler.go

@@ -375,6 +375,7 @@ func (app *App) HandleUninstallTemplate(w http.ResponseWriter, r *http.Request)
 					ServerURL:              app.ServerConf.ServerURL,
 					ServerURL:              app.ServerConf.ServerURL,
 					GithubOAuthIntegration: gr,
 					GithubOAuthIntegration: gr,
 					GithubAppID:            app.GithubAppConf.AppID,
 					GithubAppID:            app.GithubAppConf.AppID,
+					GithubAppSecretPath:    app.GithubAppConf.SecretPath,
 					GithubInstallationID:   gitAction.GithubInstallationID,
 					GithubInstallationID:   gitAction.GithubInstallationID,
 					GitRepoName:            repoSplit[1],
 					GitRepoName:            repoSplit[1],
 					GitRepoOwner:           repoSplit[0],
 					GitRepoOwner:           repoSplit[0],

+ 1 - 0
server/api/git_action_handler.go

@@ -159,6 +159,7 @@ func (app *App) createGitActionFromForm(
 		ServerURL:              app.ServerConf.ServerURL,
 		ServerURL:              app.ServerConf.ServerURL,
 		GithubOAuthIntegration: nil,
 		GithubOAuthIntegration: nil,
 		GithubAppID:            app.GithubAppConf.AppID,
 		GithubAppID:            app.GithubAppConf.AppID,
+		GithubAppSecretPath:    app.GithubAppConf.SecretPath,
 		GithubInstallationID:   form.GitRepoID,
 		GithubInstallationID:   form.GitRepoID,
 		GitRepoName:            repoSplit[1],
 		GitRepoName:            repoSplit[1],
 		GitRepoOwner:           repoSplit[0],
 		GitRepoOwner:           repoSplit[0],

+ 1 - 1
server/api/git_repo_handler.go

@@ -501,7 +501,7 @@ func (app *App) githubAppClientFromRequest(r *http.Request) (*github.Client, err
 		http.DefaultTransport,
 		http.DefaultTransport,
 		app.GithubAppConf.AppID,
 		app.GithubAppConf.AppID,
 		int64(installationID),
 		int64(installationID),
-		"/porter/docker/github_app_private_key.pem")
+		app.GithubAppConf.SecretPath)
 
 
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err

+ 2 - 0
server/api/release_handler.go

@@ -1102,6 +1102,7 @@ func (app *App) HandleUpgradeRelease(w http.ResponseWriter, r *http.Request) {
 					GithubOAuthIntegration: gr,
 					GithubOAuthIntegration: gr,
 					GithubInstallationID:   gitAction.GithubInstallationID,
 					GithubInstallationID:   gitAction.GithubInstallationID,
 					GithubAppID:            app.GithubAppConf.AppID,
 					GithubAppID:            app.GithubAppConf.AppID,
+					GithubAppSecretPath:    app.GithubAppConf.SecretPath,
 					GitRepoName:            repoSplit[1],
 					GitRepoName:            repoSplit[1],
 					GitRepoOwner:           repoSplit[0],
 					GitRepoOwner:           repoSplit[0],
 					Repo:                   *app.Repo,
 					Repo:                   *app.Repo,
@@ -1517,6 +1518,7 @@ func (app *App) HandleRollbackRelease(w http.ResponseWriter, r *http.Request) {
 					GithubOAuthIntegration: gr,
 					GithubOAuthIntegration: gr,
 					GithubInstallationID:   gitAction.GithubInstallationID,
 					GithubInstallationID:   gitAction.GithubInstallationID,
 					GithubAppID:            app.GithubAppConf.AppID,
 					GithubAppID:            app.GithubAppConf.AppID,
+					GithubAppSecretPath:    app.GithubAppConf.SecretPath,
 					GitRepoName:            repoSplit[1],
 					GitRepoName:            repoSplit[1],
 					GitRepoOwner:           repoSplit[0],
 					GitRepoOwner:           repoSplit[0],
 					Repo:                   *app.Repo,
 					Repo:                   *app.Repo,