Skip to content

Commit

Permalink
Merge pull request #684 from gravitl/saas-dev
Browse files Browse the repository at this point in the history
Saas dev -> saas staging
  • Loading branch information
Aceix authored Jul 31, 2024
2 parents 5ca0131 + b5cc8b6 commit 81e918c
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 754 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/saas-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ jobs:
run: kubectl set image deployment netmaker-ui netmaker-ui=${{ github.repository_owner }}/netmaker-ui-saas:${{ env.TAG }} -n accounts

- name: Set Intercom vars
run: kubectl set env deployment netmaker-ui INTERCOM_APP_ID=al371us8 -n accounts
run: |
kubectl set env deployment netmaker-ui INTERCOM_APP_ID=al371us8 -n accounts
kubectl set env deployment netmaker-ui PUBLIC_POSTHOG_HOST=${{ secrets.REACT_APP_PUBLIC_POSTHOG_DEV_KEY }} -n accounts
kubectl set env deployment netmaker-ui PUBLIC_POSTHOG_KEY=${{ secrets.REACT_APP_PUBLIC_POSTHOG_HOST }} -n accounts
- name: Deploy to k8s cluster
run: kubectl rollout restart deploy netmaker-ui -n accounts
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/saas-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ jobs:
run: kubectl set image deployment netmaker-ui netmaker-ui=${{ github.repository_owner }}/netmaker-ui-saas:${{ env.TAG }} -n accounts

- name: Set Intercom vars
run: kubectl set env deployment netmaker-ui INTERCOM_APP_ID=al371us8 -n accounts

run: |
kubectl set env deployment netmaker-ui INTERCOM_APP_ID=al371us8 -n accounts
kubectl set env deployment netmaker-ui PUBLIC_POSTHOG_HOST=${{ secrets.REACT_APP_PUBLIC_POSTHOG_KEY }} -n accounts
kubectl set env deployment netmaker-ui PUBLIC_POSTHOG_KEY=${{ secrets.REACT_APP_PUBLIC_POSTHOG_HOST }} -n accounts
- name: Deploy to k8s cluster
run: kubectl rollout restart deploy netmaker-ui -n accounts

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/saas-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ jobs:
run: kubectl set image deployment netmaker-ui netmaker-ui=${{ github.repository_owner }}/netmaker-ui-saas:${{ env.TAG }} -n accounts

- name: Set Intercom vars
run: kubectl set env deployment netmaker-ui INTERCOM_APP_ID=al371us8 -n accounts
run: |
kubectl set env deployment netmaker-ui INTERCOM_APP_ID=al371us8 -n accounts
kubectl set env deployment netmaker-ui PUBLIC_POSTHOG_HOST=${{ secrets.REACT_APP_PUBLIC_POSTHOG_DEV_KEY }} -n accounts
kubectl set env deployment netmaker-ui PUBLIC_POSTHOG_KEY=${{ secrets.REACT_APP_PUBLIC_POSTHOG_HOST }} -n accounts
- name: Deploy to k8s cluster
run: kubectl rollout restart deploy netmaker-ui -n accounts
Expand Down
14 changes: 14 additions & 0 deletions generate-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,26 @@ if [ -z "${INTERCOM_APP_ID:-}" ]; then
INTERCOM_APP_ID=""
fi

# ensure it is empty string if not set
if [ -z "${PUBLIC_POSTHOG_HOST:-}" ]; then
PUBLIC_POSTHOG_HOST=""
fi

# ensure it is empty string if not set
if [ -z "${PUBLIC_POSTHOG_KEY:-}" ]; then
PUBLIC_POSTHOG_KEY=""
fi

cat >/usr/share/nginx/html/nmui-config.js <<EOF
window.NMUI_AMUI_URL='$AMUI_URL';
window.NMUI_BACKEND_URL='$BACKEND_URL';
window.NMUI_INTERCOM_APP_ID='$INTERCOM_APP_ID';
window.NMUI_PUBLIC_POSTHOG_HOST='$PUBLIC_POSTHOG_HOST';
window.NMUI_PUBLIC_POSTHOG_KEY='$PUBLIC_POSTHOG_KEY';
EOF

echo ">>>> NMUI_AMUI_URL set to: $AMUI_URL <<<<<"
echo ">>>> NMUI_BACKEND_URL set to: $BACKEND_URL <<<<<"
echo ">>>> NMUI_INTERCOM_APP_ID set to: $INTERCOM_APP_ID <<<<<"
echo ">>>> NMUI_PUBLIC_POSTHOG_HOST set to: $PUBLIC_POSTHOG_HOST <<<<<"
echo ">>>> NMUI_PUBLIC_POSTHOG_KEY set to: ***** <<<<<"
Loading

0 comments on commit 81e918c

Please sign in to comment.