Przeglądaj źródła

Merge branch 'master' into unblock-neon-sandbox

Feroze Mohideen 2 lat temu
rodzic
commit
1b879f3d24

+ 23 - 19
.github/workflows/install_script.yml

@@ -1,25 +1,29 @@
-"on":
+name: Deploy to install-script
+on:
   push:
     tags:
-      - production
-name: Deploy Install Script to Production
+    - production
 jobs:
   porter-deploy:
     runs-on: ubuntu-latest
     steps:
-      - name: Checkout code
-        uses: actions/checkout@v3
-      - name: Set Github tag
-        id: vars
-        run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
-      - name: Update Porter App
-        timeout-minutes: 20
-        uses: porter-dev/porter-update-action@v0.1.0
-        with:
-          app: install-script
-          cluster: "9"
-          host: https://dashboard.internal-tools.porter.run
-          namespace: default
-          project: "5"
-          tag: ${{ steps.vars.outputs.sha_short }}
-          token: ${{ secrets.PORTER_TOKEN_5 }}
+    - name: Checkout code
+      uses: actions/checkout@v3
+    - name: Set Github tag
+      id: vars
+      run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
+    - name: Setup porter
+      uses: porter-dev/setup-porter@v0.1.0
+    - name: Deploy stack
+      timeout-minutes: 30
+      run: exec porter apply
+      env:
+        PORTER_CLUSTER: "9"
+        PORTER_DEPLOYMENT_TARGET_ID: b0fec389-99d5-4ca5-9012-002b410248b3
+        PORTER_HOST: https://dashboard.internal-tools.porter.run
+        PORTER_PR_NUMBER: ${{ github.event.number }}
+        PORTER_PROJECT: "5"
+        PORTER_REPO_NAME: ${{ github.event.repository.name }}
+        PORTER_STACK_NAME: install-script
+        PORTER_TAG: ${{ steps.vars.outputs.sha_short }}
+        PORTER_TOKEN: ${{ secrets.PORTER_STACK_5_9 }}

+ 1 - 1
dashboard/src/lib/addons/template.ts

@@ -284,6 +284,6 @@ export const SUPPORTED_ADDON_TEMPLATES: Array<AddonTemplate<ClientAddonType>> =
     ADDON_TEMPLATE_DATADOG,
     ADDON_TEMPLATE_MEZMO,
     ADDON_TEMPLATE_METABASE,
-    ADDON_TEMPLATE_NEWRELIC,
+    // ADDON_TEMPLATE_NEWRELIC,
     ADDON_TEMPLATE_TAILSCALE,
   ];

+ 1 - 0
dashboard/src/main/home/Home.tsx

@@ -64,6 +64,7 @@ import CreateClusterForm from "./infrastructure-dashboard/forms/CreateClusterFor
 import Integrations from "./integrations/Integrations";
 import LaunchWrapper from "./launch/LaunchWrapper";
 import ModalHandler from "./ModalHandler";
+import BillingModal from "./modals/BillingModal";
 import Navbar from "./navbar/Navbar";
 import { NewProjectFC } from "./new-project/NewProject";
 import Onboarding from "./onboarding/Onboarding";

+ 33 - 30
dashboard/src/main/home/modals/BillingModal.tsx

@@ -6,8 +6,8 @@ import Link from "components/porter/Link";
 import Modal from "components/porter/Modal";
 import Spacer from "components/porter/Spacer";
 import Text from "components/porter/Text";
-import { usePublishableKey } from "lib/hooks/useStripe";
 import { useIntercom } from "lib/hooks/useIntercom";
+import { usePublishableKey } from "lib/hooks/useStripe";
 
 import { Context } from "shared/Context";
 
@@ -76,23 +76,28 @@ const BillingModal = ({
           </Text>
         ) : (
           <Text color="helper">
-            {trialExpired
-              ? (
-                <div>
-                  Your applications will continue to run but you will not be able to access your project until you link a payment method.
-                  {" "}
-                  <Text style={{ cursor: "pointer" }} onClick={() => showIntercomWithMessage({
-                    message: "I have already redeemed my startup deal.",
-                    delaySeconds: 0,
-                  })}>
-                    Already redeemed your startup deal?
-                  </Text>
-                  <Spacer y={0.5} />
-                  {"For more details on the current costs and usage of this project, visit the "}
-                  <Link to="/project-settings?selected_tab=billing">billing page.</Link>
-                </div>
-              )
-              : "Link a payment method to your Porter project."}
+            {trialExpired ? (
+              <div>
+                Your applications will continue to run but you will not be able
+                to access your project until you link a payment method.{" "}
+                <Text
+                  style={{ cursor: "pointer" }}
+                  onClick={() =>
+                    showIntercomWithMessage({
+                      message: "I have already redeemed my startup deal.",
+                      delaySeconds: 0,
+                    })
+                  }
+                >
+                  Already redeemed your startup deal?
+                </Text>
+                {/* <Spacer y={0.5} /> */}
+                {/* {"For more details on the current costs and usage of this project, visit the "}
+                  <Link to="/project-settings?selected_tab=billing">billing page.</Link> */}
+              </div>
+            ) : (
+              "Link a payment method to your Porter project."
+            )}
             <Spacer y={0.5} />
             {`You can learn more about our pricing under "For Businesses" `}
             <Link target="_blank" to="https://porter.run/pricing">
@@ -101,19 +106,17 @@ const BillingModal = ({
           </Text>
         )}
         <Spacer y={1} />
-        {
-          publishableKey ? (
-            <Elements
-              stripe={stripePromise || null}
-              options={options}
-              appearance={appearance}
-            >
-              <PaymentSetupForm onCreate={onCreate}></PaymentSetupForm>
-            </Elements>
-          ) : null
-        }
+        {publishableKey ? (
+          <Elements
+            stripe={stripePromise || null}
+            options={options}
+            appearance={appearance}
+          >
+            <PaymentSetupForm onCreate={onCreate}></PaymentSetupForm>
+          </Elements>
+        ) : null}
       </div>
-    </Modal >
+    </Modal>
   );
 };
 

+ 9 - 9
dashboard/src/main/home/project-settings/ProjectSettings.tsx

@@ -96,15 +96,15 @@ function ProjectSettings(props: any) {
         });
       }
 
-      if (
-        currentProject?.billing_enabled &&
-        currentProject?.metronome_enabled
-      ) {
-        tabOpts.push({
-          value: "usage",
-          label: "Usage",
-        });
-      }
+      // if (
+      //   currentProject?.billing_enabled &&
+      //   currentProject?.metronome_enabled
+      // ) {
+      //   tabOpts.push({
+      //     value: "usage",
+      //     label: "Usage",
+      //   });
+      // }
 
       tabOpts.push({
         value: "additional-settings",