Clean up for mini: remove other envs, add devbox/direnv

This commit is contained in:
Chris Rai
2026-01-13 21:24:46 -05:00
parent 33da34151d
commit d2c361de4a
23 changed files with 40 additions and 1010 deletions

View File

@@ -1,23 +0,0 @@
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cec-euprd.fiskerinc.com
REACT_APP_AUTH_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/compute_auth
REACT_APP_CERT_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/certificate
REACT_APP_ENV=cec-euprd
REACT_APP_MAGNA_PROVIDER=Magna
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
REACT_APP_OTA_SERVICE_URL=https://gw.cec-euprd.fiskerinc.com/ota_update
REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_32.dll
REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll
REACT_APP_SUPERSET_URL=https://superset.cec-euprd.fiskerinc.com
REACT_APP_ROLE_CREATE=e92f2b3e-1b80-42e5-9483-8ae648224dc6
REACT_APP_ROLE_READ_ONLY=ae5123e3-7a6a-4ca9-947b-a0f184f82cbd
REACT_APP_ROLE_DELETE=bfd1cccc-213a-4f31-b3d1-6e685976aec8
REACT_APP_ROLE_GENERATE_CERTIFICATE=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc
REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69
REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8
REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f
REACT_APP_ROLE_CAR_DIAGNOSTIC=2914e67f-fb85-4b78-b79d-656f4f37faa1
REACT_APP_ROLE_UPDATE_DEPLOY=e4af2c4c-6c5e-4784-9097-7c18e776d7b6
REACT_APP_ECCKEY_ENV=
REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":49.8327,"lng":9.8816,"zoom":4.5}
REACT_APP_ENABLE_DEBUGMASK=1
REACT_APP_SHOW_AFTERSALES_EU_CERT_BUTTON=0

View File

@@ -1,23 +0,0 @@
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cec-prd.fiskerinc.com
REACT_APP_AUTH_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/compute_auth
REACT_APP_CERT_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/certificate
REACT_APP_ENV=cec-prd
REACT_APP_MAGNA_PROVIDER=Magna
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
REACT_APP_OTA_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/ota_update
REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_32.dll
REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll
REACT_APP_SUPERSET_URL=https://superset.cec-prd.fiskerinc.com
REACT_APP_ROLE_CREATE=e92f2b3e-1b80-42e5-9483-8ae648224dc6
REACT_APP_ROLE_READ_ONLY=ae5123e3-7a6a-4ca9-947b-a0f184f82cbd
REACT_APP_ROLE_DELETE=bfd1cccc-213a-4f31-b3d1-6e685976aec8
REACT_APP_ROLE_GENERATE_CERTIFICATE=9af2d8c0-c26d-4d6d-bbd1-ac53cbd37ebc
REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69
REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8
REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f
REACT_APP_ROLE_CAR_DIAGNOSTIC=2914e67f-fb85-4b78-b79d-656f4f37faa1
REACT_APP_ROLE_UPDATE_DEPLOY=e4af2c4c-6c5e-4784-9097-7c18e776d7b6
REACT_APP_ECCKEY_ENV=
REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5}
REACT_APP_ENABLE_DEBUGMASK=1
REACT_APP_SHOW_AFTERSALES_EU_CERT_BUTTON=1

View File

@@ -1,23 +0,0 @@
REACT_APP_AUTH_CALLBACK_URL=https://dev-ota-admin.cloud.fiskerinc.com
REACT_APP_AUTH_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/compute_auth
REACT_APP_CERT_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/certificate
REACT_APP_ENV=dev
REACT_APP_MAGNA_PROVIDER=Magna
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
REACT_APP_OTA_SERVICE_URL=https://dev-gw.cloud.fiskerinc.com/ota_update
REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_32.dll
REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll
REACT_APP_SUPERSET_URL=https://dev-superset.cloud.fiskerinc.com
REACT_APP_ROLE_CREATE=efcc3025-e2d8-4212-8227-805c7be39d2c
REACT_APP_ROLE_READ_ONLY=a729bbd4-2038-4649-9127-16782bb1e701
REACT_APP_ROLE_DELETE=8f78dce7-f5f9-4033-a10c-c9c7408bfcfe
REACT_APP_ROLE_GENERATE_CERTIFICATE=746f34b0-9ba0-4b5d-8d84-0256a9c8e390
REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69
REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8
REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f
REACT_APP_ROLE_CAR_DIAGNOSTIC=2914e67f-fb85-4b78-b79d-656f4f37faa1
REACT_APP_ROLE_UPDATE_DEPLOY=3590ec3f-1c05-428b-81a4-40b00baf83de
REACT_APP_ECCKEY_ENV=stage,prod
REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5}
REACT_APP_ENABLE_DEBUGMASK=1
REACT_APP_SHOW_AFTERSALES_EU_CERT_BUTTON=1

View File

@@ -1,23 +0,0 @@
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cloud.fiskerinc.com
REACT_APP_AUTH_SERVICE_URL=https://gw.cloud.fiskerinc.com/compute_auth
REACT_APP_CERT_SERVICE_URL=https://gw.cloud.fiskerinc.com/certificate
REACT_APP_ENV=prd
REACT_APP_MAGNA_PROVIDER=Magna
REACT_APP_MAGNA_GROUP_ID=68273225-9da4-4fa7-aea5-38e16ec471fe
REACT_APP_OTA_SERVICE_URL=https://gw.cloud.fiskerinc.com/ota_update
REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_32.dll
REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll
REACT_APP_SUPERSET_URL=https://superset.cloud.fiskerinc.com
REACT_APP_ROLE_CREATE=efcc3025-e2d8-4212-8227-805c7be39d2c
REACT_APP_ROLE_READ_ONLY=a729bbd4-2038-4649-9127-16782bb1e701
REACT_APP_ROLE_DELETE=8f78dce7-f5f9-4033-a10c-c9c7408bfcfe
REACT_APP_ROLE_GENERATE_CERTIFICATE=746f34b0-9ba0-4b5d-8d84-0256a9c8e390
REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69
REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8
REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f
REACT_APP_ROLE_CAR_DIAGNOSTIC=2914e67f-fb85-4b78-b79d-656f4f37faa1
REACT_APP_ROLE_UPDATE_DEPLOY=e4af2c4c-6c5e-4784-9097-7c18e776d7b6
REACT_APP_ECCKEY_ENV=stage
REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5}
REACT_APP_ENABLE_DEBUGMASK=1
REACT_APP_SHOW_AFTERSALES_EU_CERT_BUTTON=0

View File

@@ -1,22 +0,0 @@
REACT_APP_AUTH_CALLBACK_URL=http://localhost:3000
REACT_APP_AUTH_SERVICE_URL=http://localhost/compute_auth
REACT_APP_CERT_SERVICE_URL=http://localhost/certificate
REACT_APP_ENV=local
REACT_APP_MAGNA_PROVIDER=DISABLED
REACT_APP_MAGNA_GROUP_ID=DISABLED
REACT_APP_OTA_SERVICE_URL=http://localhost/ota_update
REACT_APP_SECURITY_DLL_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_32.dll
REACT_APP_SECURITY_DLL_64_URL=https://assets.fiskerdps.com/cloud-supplier/fisker_security_64.dll
REACT_APP_SUPERSET_URL=https://dev-superset.cloud.fiskerinc.com
REACT_APP_ROLE_CREATE=efcc3025-e2d8-4212-8227-805c7be39d2c
REACT_APP_ROLE_READ_ONLY=a729bbd4-2038-4649-9127-16782bb1e701
REACT_APP_ROLE_DELETE=8f78dce7-f5f9-4033-a10c-c9c7408bfcfe
REACT_APP_ROLE_GENERATE_CERTIFICATE=746f34b0-9ba0-4b5d-8d84-0256a9c8e390
REACT_APP_ROLE_MANUFACTURE=3412e11a-a2d1-4355-be3e-ef9aa5065b69
REACT_APP_ROLE_SUPPLIER_APPROVER=a6c9805e-80b2-42b2-bfbb-9df52e5504d8
REACT_APP_ROLE_MANIFEST_MIGRATION=42798c8a-9fa7-4fb4-82c0-9582cabe364f
REACT_APP_ROLE_CAR_DIAGNOSTIC=2914e67f-fb85-4b78-b79d-656f4f37faa1
REACT_APP_ROLE_UPDATE_DEPLOY=3590ec3f-1c05-428b-81a4-40b00baf83de
REACT_APP_ECCKEY_ENV=dev,stage,prod
REACT_APP_HOME_MAP_DEFAULT_LOCATION={"lat":37.0902,"lng":-95.7129,"zoom":4.5}
REACT_APP_SHOW_AFTERSALES_EU_CERT_BUTTON=0

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use devbox

7
.github/CODEOWNERS vendored
View File

@@ -1,7 +0,0 @@
# default codeowners
* @Fisker-Inc/cloud
# devops
.github @Fisker-Inc/devops @Fisker-Inc/cloud
k8s @Fisker-Inc/devops @Fisker-Inc/cloud
Dockerfile @Fisker-Inc/devops @Fisker-Inc/cloud

View File

@@ -1,38 +0,0 @@
name: Blackduck Intelligent Scan
on:
schedule:
# run scans twice a month
- cron: '0 2 1,15 * *'
jobs:
blackduck:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm install
- run: npm run build
- name: Run Synopsys Detect INTELLIGENT
run: |
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) \
--blackduck.url=${{ secrets.BLACKDUCK_URL }} \
--blackduck.api.token=${{ secrets.BLACKDUCK_API_KEY }} \
--blackduck.trust.cert=true \
--detect.project.version.update=true \
--detect.project.name='ota-admin-portal' \
--detect.excluded.directories='node_modules' \
--detect.project.version.name=$GITHUB_REF_NAME \
--detect.blackduck.scan.mode="INTELLIGENT" \
--detect.detector.search.depth=3 \
--detect.detector.search.continue=true \
--detect.npm.include.dev.dependencies=false
# --detect.policy.check.fail.on.severities=ALL,NONE,UNSPECIFIED,TRIVIAL,MINOR,MAJOR,CRITICAL,BLOCKER - Use it if you want to fail the build on a certain severity type
# --detect.detector.search.continue=true - If true, the bom tool search will continue to look for nested bom tools of the same type to the maximum search depth

View File

@@ -1,41 +0,0 @@
name: Blackduck Rapid scan
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
jobs:
blackduck:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm install
- run: npm run build
- name: Run Synopsys Detect RAPID
run: |
bash <(curl -s -L https://detect.synopsys.com/detect9.sh) \
--blackduck.url=${{ secrets.BLACKDUCK_URL }} \
--blackduck.api.token=${{ secrets.BLACKDUCK_API_KEY }} \
--blackduck.trust.cert=true \
--detect.project.version.update=true \
--detect.project.name='ota-admin-portal' \
--detect.excluded.directories='node_modules' \
--detect.project.version.name=$GITHUB_REF_NAME \
--detect.blackduck.scan.mode="RAPID" \
--detect.detector.search.depth=3 \
--detect.detector.search.continue=true \
--detect.npm.include.dev.dependencies=false
# --detect.detector.search.continue=true - If true, the bom tool search will continue to look for nested bom tools of the same type to the maximum search depth

View File

@@ -1,135 +0,0 @@
name: OTA Admin Portal v2 Deploy - On Demand
on:
workflow_dispatch:
inputs:
environment:
description: "Environment"
required: true
type: choice
options:
- dev
- preprod
- cec-prd
- cec-euprd
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL: "#cloud-builds"
SLACK_FOOTER: ""
SLACK_USERNAME: GitHub Actions
SLACK_ICON: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
JFROG_NPMRC: ${{ secrets.JFROG_NPMRC }}
TAG: ${{ github.sha }}
PROJECT: ota-admin-portal-v2
REGISTRY: fiskercloud.azurecr.io
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
- name: Checkout
uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID_DEV }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_DEV }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }}
- name: ACR Login
run: |
az acr login --name ${{ env.REGISTRY }}
- name: JFrog Auth
run: echo ${JFROG_NPMRC} | base64 -d > .npmrc
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
build-args: ENVIRONMENT=${{ inputs.environment }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.PROJECT }}:${{ env.TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify if failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to build ${{ env.PROJECT }} in ${{ inputs.environment }}! :this-is-fine:"
deploy:
needs: build
runs-on: arc-azure-${{ inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Notify deploy
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Deploying ${{ env.PROJECT }} to ${{ inputs.environment }}... :partydeploy:"
- name: Set env
run: |
case ${{ inputs.environment }} in
dev)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_DEV }};;
preprod)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_PREPROD }};;
cec-prd)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_CEC_PRD }};;
cec-euprd)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_CEC_EUPRD }};;
*)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_DEV }};;
esac
echo "KUBECONFIG=${KUBECONFIG}" >> $GITHUB_ENV
- name: Deploy to env
id: deploy
uses: koslib/helm-eks-action@v1.28.0
env:
KUBE_CONFIG_DATA: ${{ env.KUBECONFIG }}
with:
command: |
helm upgrade \
--atomic \
--create-namespace \
--namespace default \
--set image.registry=$REGISTRY \
--set image.name=$PROJECT \
--set image.tag=$TAG \
--wait -i -f k8s/values-${{ inputs.environment }}.yaml $PROJECT k8s/
- name: Deploy Response
run: echo "Response was ${{ steps.deploy.outputs.response }}"
- name: Notify deploy failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to deploy ${{ env.PROJECT }} on ${{ inputs.environment }}! :this-is-fine:"
- name: Notify deploy success
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to ${{ inputs.environment }}! :gopher_party:"

View File

@@ -1,131 +0,0 @@
name: OTA Portal Deploy - On Demand
on:
workflow_dispatch:
inputs:
environment:
description: "Environment"
required: true
type: choice
options:
- dev
- preprod
- cec-prd
- cec-euprd
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL: "#cloud-builds"
SLACK_FOOTER: ""
SLACK_USERNAME: GitHub Actions
SLACK_ICON: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
TAG: ${{ github.sha }}
PROJECT: ota-admin-portal
REGISTRY: fiskercloud.azurecr.io
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
- name: Checkout
uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID_DEV }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_DEV }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }}
- name: ACR Login
run: |
az acr login --name ${{ env.REGISTRY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
build-args: ENVIRONMENT=${{ inputs.environment }}
push: true
tags: ${{ env.REGISTRY }}/${{ env.PROJECT }}:${{ env.TAG }}-${{ inputs.environment }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify if failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to build ${{ env.PROJECT }} in ${{ inputs.environment }}! :this-is-fine:"
deploy:
needs: build
runs-on: arc-azure-${{ inputs.environment }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Notify deploy
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Deploying ${{ env.PROJECT }} to ${{ inputs.environment }}... :partydeploy:"
- name: Set env
run: |
case ${{ inputs.environment }} in
dev)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_DEV }};;
preprod)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_PREPROD }};;
cec-prd)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_CEC_PRD }};;
cec-euprd)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_CEC_EUPRD }};;
*)
KUBECONFIG=${{ secrets.KUBECONFIG_AZURE_DEV }};;
esac
echo "KUBECONFIG=${KUBECONFIG}" >> $GITHUB_ENV
- name: Deploy to env
id: deploy
uses: koslib/helm-eks-action@v1.28.0
env:
KUBE_CONFIG_DATA: ${{ env.KUBECONFIG }}
with:
command: |
helm upgrade \
--atomic \
--create-namespace \
--namespace default \
--set image.registry=$REGISTRY \
--set image.name=$PROJECT \
--set image.tag=$TAG-${{ inputs.environment }} \
--wait -i -f k8s/values-${{ inputs.environment }}.yaml $PROJECT k8s/
- name: Deploy Response
run: echo "Response was ${{ steps.deploy.outputs.response }}"
- name: Notify deploy failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to deploy ${{ env.PROJECT }} to ${{ inputs.environment }}! :this-is-fine:"
- name: Notify deploy success
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to ${{ inputs.environment }}! :gopher_party:"

View File

@@ -1,371 +0,0 @@
name: OTA Portal Deploy
on:
push:
branches:
- main
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL: "#cloud-builds"
SLACK_FOOTER: ""
SLACK_USERNAME: GitHub Actions
SLACK_ICON: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
TAG: ${{ github.sha }}
PROJECT: ota-admin-portal
REGISTRY: fiskercloud.azurecr.io
permissions:
id-token: write
contents: read
jobs:
build-dev:
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
- name: Checkout
uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID_DEV }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_DEV }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }}
- name: ACR Login
run: |
az acr login --name ${{ env.REGISTRY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push DEV
uses: docker/build-push-action@v5
with:
context: .
build-args: ENVIRONMENT=dev
push: true
tags: ${{ env.REGISTRY }}/${{ env.PROJECT }}:${{ env.TAG }}-dev
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify if failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to build ${{ env.PROJECT }} dev! :this-is-fine:"
deploy-dev:
needs: [build-dev]
runs-on: [ arc-azure-dev ]
environment: dev
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Notify deploy
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Deploying ${{ env.PROJECT }} to dev... :partydeploy:"
- name: Deploy to dev
id: deploy
uses: koslib/helm-eks-action@v1.28.0
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG_AZURE_DEV }}
with:
command: |
helm upgrade \
--atomic \
--create-namespace \
--namespace default \
--set image.registry=$REGISTRY \
--set image.name=$PROJECT \
--set image.tag=$TAG-dev \
--wait -i -f k8s/values-dev.yaml $PROJECT k8s/
- name: Deploy Response
run: echo "Response was ${{ steps.deploy.outputs.response }}"
- name: Notify deploy failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to deploy ${{ env.PROJECT }} on dev! :this-is-fine:"
- name: Notify deploy success
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to dev! :gopher_party:"
build-preprod:
runs-on: ubuntu-latest
needs: [deploy-dev]
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
- name: Checkout
uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID_DEV }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_DEV }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }}
- name: ACR Login
run: |
az acr login --name ${{ env.REGISTRY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push PREPROD
uses: docker/build-push-action@v5
with:
context: .
build-args: ENVIRONMENT=preprod
push: true
tags: ${{ env.REGISTRY }}/${{ env.PROJECT }}:${{ env.TAG }}-prd
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify if failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to build ${{ env.PROJECT }} preprod! :this-is-fine:"
deploy-preprod:
needs: [deploy-dev, build-preprod]
runs-on: [ arc-azure-preprod ]
environment: preprod
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Notify deploy
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Deploying ${{ env.PROJECT }} to preprod... :partydeploy:"
- name: Deploy to preprod
id: deploy
uses: koslib/helm-eks-action@v1.28.0
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG_AZURE_PREPROD }}
with:
command: |
helm upgrade \
--atomic \
--create-namespace \
--namespace default \
--set image.registry=$REGISTRY \
--set image.name=$PROJECT \
--set image.tag=$TAG-prd \
--wait -i -f k8s/values-preprod.yaml $PROJECT k8s/
- name: Deploy Response
run: echo "Response was ${{ steps.deploy.outputs.response }}"
- name: Notify deploy failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to deploy ${{ env.PROJECT }} on preprod! :this-is-fine:"
- name: Notify deploy success
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to preprod! :gopher_party:"
build-cec-prd:
runs-on: ubuntu-latest
needs: [deploy-dev, deploy-preprod]
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
- name: Checkout
uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID_DEV }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_DEV }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }}
- name: ACR Login
run: |
az acr login --name ${{ env.REGISTRY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push CEC-PRD
uses: docker/build-push-action@v5
with:
context: .
build-args: ENVIRONMENT=cec-prd
push: true
tags: ${{ env.REGISTRY }}/${{ env.PROJECT }}:${{ env.TAG }}-cec-prd
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify if failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to build ${{ env.PROJECT }} cec-prd! :this-is-fine:"
deploy-cec-prd:
needs: [deploy-dev, deploy-preprod, build-cec-prd]
runs-on: [ arc-azure-cec-prd ]
environment: prd
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Notify deploy
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Deploying ${{ env.PROJECT }} to cec-prd... :partydeploy:"
- name: Deploy to cec-prd
id: deploy
uses: koslib/helm-eks-action@v1.28.0
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG_AZURE_CEC_PRD }}
with:
command: |
helm upgrade \
--atomic \
--create-namespace \
--namespace default \
--set image.registry=$REGISTRY \
--set image.name=$PROJECT \
--set image.tag=$TAG-cec-prd \
--wait -i -f k8s/values-cec-prd.yaml $PROJECT k8s/
- name: Deploy Response
run: echo "Response was ${{ steps.deploy.outputs.response }}"
- name: Notify deploy failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to deploy ${{ env.PROJECT }} on cec-prd! :this-is-fine:"
- name: Notify deploy success
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to cec-prd! :gopher_party:"
build-cec-euprd:
runs-on: ubuntu-latest
needs: [deploy-dev, deploy-preprod]
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
- name: Checkout
uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID_DEV }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_DEV }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_DEV }}
- name: ACR Login
run: |
az acr login --name ${{ env.REGISTRY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push CEC-EUPRD
uses: docker/build-push-action@v5
with:
context: .
build-args: ENVIRONMENT=cec-euprd
push: true
tags: ${{ env.REGISTRY }}/${{ env.PROJECT }}:${{ env.TAG }}-cec-euprd
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Notify if failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to build ${{ env.PROJECT }} cec-euprd! :this-is-fine:"
deploy-cec-euprd:
needs: [deploy-dev, deploy-preprod, build-cec-euprd]
runs-on: [ arc-azure-cec-euprd ]
environment: prd
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Notify deploy
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Deploying ${{ env.PROJECT }} to cec-euprd... :partydeploy:"
- name: Deploy to cec-euprd
id: deploy
uses: koslib/helm-eks-action@v1.28.0
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBECONFIG_AZURE_CEC_EUPRD }}
with:
command: |
helm upgrade \
--atomic \
--create-namespace \
--namespace default \
--set image.registry=$REGISTRY \
--set image.name=$PROJECT \
--set image.tag=$TAG-cec-euprd \
--wait -i -f k8s/values-cec-euprd.yaml $PROJECT k8s/
- name: Deploy Response
run: echo "Response was ${{ steps.deploy.outputs.response }}"
- name: Notify deploy failure
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed to deploy ${{ env.PROJECT }} on cec-euprd! :this-is-fine:"
- name: Notify deploy success
uses: rtCamp/action-slack-notify@v2
env:
MSG_MINIMAL: true
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to cec-euprd! :gopher_party:"

View File

@@ -1,12 +0,0 @@
name: Pull Request Jira Check
on:
pull_request:
branches:
- main
types: [opened, edited, synchronize, reopened]
jobs:
prcheck:
uses: Fisker-Inc/github-actions/.github/workflows/pr.yml@v1.0.16

View File

@@ -1,35 +0,0 @@
name: Node.js CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- run: npm install
- run: npm run build --if-present
- run: npm test -- --coverage --coverageDirectory='coverage' --watchAll=false
env:
CI: true
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@@ -1,69 +1,38 @@
# Fisker Admin Portal # OTA Admin Portal
Front-end web application for administrating services. Front-end web application for OTA administration.
# Setup ## Setup
Running locally ```bash
# Install dependencies
npm install
1. Install Node 16 # Run locally
2. Run `npm install` npm start
3. Copy .env.template to .env and edit the service urls for authentication and api services # Access at http://localhost:3000
4. Run `./run.sh` from the terminal ```
5. Access portal at localhost:3000
Running Docker container ## Build & Deploy
1. Copy .env.template to .env and edit the service urls for authentication and api services ```bash
2. Build the image `docker build --build-arg ENVIRONMENT=local -t fiskerinc/portal .` # Build for mini environment
3. Start the container `docker run -p 3000:80 fiskerinc/portal` npm run build
4. Access portal at localhost:3000
## Available Scripts # Build Docker image
docker build --build-arg ENVIRONMENT=mini -t gitea.mini.cloud.fiskerinc.com/admin/ota-admin-portal:latest .
In the project directory, you can run: # Push to Gitea registry
docker push gitea.mini.cloud.fiskerinc.com/admin/ota-admin-portal:latest
```
### `npm start` ## Environment
Runs the app in the development mode.\ - `.env.local` - Local development
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - `.env.mini` - Mini cluster (Mac Mini)
The page will reload if you make edits.\ ## Deployment
You will also see any lint errors in the console.
### `npm test` Deployed via ArgoCD from `k8s/` helm chart with `values-mini.yaml`.
Launches the test runner in the interactive watch mode.\ URL: https://ota-admin.mini.cloud.fiskerinc.com
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `npm run build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

12
devbox.json Normal file
View File

@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/main/.schema/devbox.schema.json",
"packages": [
"nodejs_18",
"docker"
],
"shell": {
"init_hook": [
"echo 'OTA Admin Portal dev environment ready'"
]
}
}

View File

@@ -1,12 +0,0 @@
ingress:
hostname: ota-admin.cec-euprd.fiskerinc.com
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
#cpu: 250m
memory: 256Mi
replicas: 3

View File

@@ -1,12 +0,0 @@
ingress:
hostname: ota-admin.cec-prd.fiskerinc.com
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
#cpu: 250m
memory: 256Mi
replicas: 3

View File

@@ -1,12 +0,0 @@
ingress:
hostname: dev-ota-admin.cloud.fiskerinc.com
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
#cpu: 250m
memory: 256Mi
replicas: 1

View File

@@ -1,12 +0,0 @@
ingress:
hostname: ota-admin.cloud.fiskerinc.com
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
#cpu: 250m
memory: 256Mi
replicas: 3

View File

@@ -48,18 +48,10 @@
}, },
"scripts": { "scripts": {
"start": "env-cmd -f .env.local react-scripts start", "start": "env-cmd -f .env.local react-scripts start",
"build": "env-cmd -f .env.local react-scripts build", "build": "env-cmd -f .env.mini react-scripts build",
"build:dev": "env-cmd -f .env.dev react-scripts build",
"build:stg": "env-cmd -f .env.stg react-scripts build",
"build:preprod": "env-cmd -f .env.prd react-scripts build",
"build:cec-prd": "env-cmd -f .env.cec-prd react-scripts build",
"build:cec-euprd": "env-cmd -f .env.cec-euprd react-scripts build",
"build:mini": "env-cmd -f .env.mini react-scripts build",
"build:local": "env-cmd -f .env.local react-scripts build", "build:local": "env-cmd -f .env.local react-scripts build",
"test": "env-cmd -f .env.local react-scripts test --no-cache", "test": "env-cmd -f .env.local react-scripts test --no-cache",
"test:debug": "react-scripts --inspect-brk test --runInBand --no-cache", "test:coverage": "npm test -- --coverage --watchAll=false --no-cache"
"test:coverage": "npm test -- --coverage --watchAll=false --no-cache",
"eject": "react-scripts eject"
}, },
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [

6
run.sh
View File

@@ -1,6 +0,0 @@
#!/bin/bash
node -v
npm install
#cp .env.template .env
npm start

View File

@@ -1,6 +0,0 @@
sonar.projectKey=Fisker-Inc_ota-admin-portal
sonar.organization=fisker-inc
sonar.sourceEncoding=UTF-8
sonar.javascript.coveragePlugin=lcov
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.sources=src