Merge branch 'release/0.0.3'
This commit is contained in:
5
.env.cec-prd
Normal file
5
.env.cec-prd
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
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_UPLOAD_SERVICE_URL=https://gw.cec-prd.fiskerinc.com/ota_update
|
||||||
|
REACT_APP_AUTH_CALLBACK_URL=https://ota-admin.cec-prd.fiskerinc.com
|
||||||
|
REACT_APP_SUPERSET_URL=https://superset.cec-prd.fiskerinc.com/superset/dashboard/9/?native_filters_key=mfJ1VjGTcLUKz7gQs_DgClZhjcdNucYMrPruNibcyDnhkDwdHbAumBRVTpA5tFH_
|
||||||
47
.github/workflows/deploy.yml
vendored
47
.github/workflows/deploy.yml
vendored
@@ -5,6 +5,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
- "release/**"
|
- "release/**"
|
||||||
- "hotfix/**"
|
- "hotfix/**"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
SLACK_CHANNEL: "#cloud-builds"
|
SLACK_CHANNEL: "#cloud-builds"
|
||||||
@@ -19,13 +20,13 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
build-env: ${{ steps.set-env.outputs.build-env }}
|
build-env: ${{ steps.set-env.outputs.ENVIRONMENT }}
|
||||||
steps:
|
steps:
|
||||||
- name: Slack Notification
|
- name: Slack Notification
|
||||||
uses: rtCamp/action-slack-notify@v2
|
uses: rtCamp/action-slack-notify@v2
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Azure Login
|
- name: Azure Login
|
||||||
uses: azure/login@v1
|
uses: azure/login@v1
|
||||||
@@ -55,13 +56,13 @@ jobs:
|
|||||||
ENVIRONMENT=dev;;
|
ENVIRONMENT=dev;;
|
||||||
esac
|
esac
|
||||||
echo "ENVIRONMENT=${ENVIRONMENT}" >> $GITHUB_ENV
|
echo "ENVIRONMENT=${ENVIRONMENT}" >> $GITHUB_ENV
|
||||||
echo "::set-output name=build-env::${ENVIRONMENT}"
|
echo "ENVIRONMENT=${ENVIRONMENT}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
build-args: ENVIRONMENT=${{ env.ENVIRONMENT }}
|
build-args: ENVIRONMENT=${{ env.ENVIRONMENT }}
|
||||||
@@ -70,12 +71,26 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
- name: Build and push new prod
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
build-args: ENVIRONMENT=cec-${{ env.ENVIRONMENT }}
|
||||||
|
push: true
|
||||||
|
tags: ${{ env.REGISTRY }}/${{ env.PROJECT }}:${{ env.TAG }}-cec-${{ env.ENVIRONMENT }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: [self-hosted, azure]
|
runs-on: [self-hosted, azure]
|
||||||
env:
|
env:
|
||||||
ENVIRONMENT: ${{ needs.build.outputs.build-env }}
|
ENVIRONMENT: ${{ needs.build.outputs.build-env }}
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: rtCamp/action-slack-notify@v2
|
- uses: rtCamp/action-slack-notify@v2
|
||||||
env:
|
env:
|
||||||
MSG_MINIMAL: true
|
MSG_MINIMAL: true
|
||||||
@@ -90,16 +105,32 @@ jobs:
|
|||||||
--set image.tag=$TAG-$ENVIRONMENT \
|
--set image.tag=$TAG-$ENVIRONMENT \
|
||||||
--wait -i -f k8s/values-$ENVIRONMENT.yaml $PROJECT k8s/
|
--wait -i -f k8s/values-$ENVIRONMENT.yaml $PROJECT k8s/
|
||||||
|
|
||||||
- name: Notify if success
|
- name: Notify deploy
|
||||||
if: ${{ success() }}
|
|
||||||
uses: rtCamp/action-slack-notify@v2
|
uses: rtCamp/action-slack-notify@v2
|
||||||
env:
|
env:
|
||||||
MSG_MINIMAL: true
|
MSG_MINIMAL: true
|
||||||
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to ${{ env.ENVIRONMENT }}! :gopher_party:"
|
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to ${{ env.ENVIRONMENT }}! :gopher_party:"
|
||||||
|
|
||||||
|
- name: Deploy new prod
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
run: |-
|
||||||
|
helm upgrade \
|
||||||
|
--kube-context cec-$ENVIRONMENT-cluster-1 \
|
||||||
|
--set image.registry=$REGISTRY \
|
||||||
|
--set image.name=$PROJECT \
|
||||||
|
--set image.tag=$TAG-cec-$ENVIRONMENT \
|
||||||
|
--wait -i -f k8s/values-cec-$ENVIRONMENT.yaml $PROJECT k8s/
|
||||||
|
|
||||||
|
- name: Notify deploy new
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
uses: rtCamp/action-slack-notify@v2
|
||||||
|
env:
|
||||||
|
MSG_MINIMAL: true
|
||||||
|
SLACK_MESSAGE: "Successfully deployed ${{ env.PROJECT }} to cec-${{ env.ENVIRONMENT }}! :gopher_party:"
|
||||||
|
|
||||||
- name: Notify if failure
|
- name: Notify if failure
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
uses: rtCamp/action-slack-notify@v2
|
uses: rtCamp/action-slack-notify@v2
|
||||||
env:
|
env:
|
||||||
SLACK_COLOR: ${{ job.status }}
|
SLACK_COLOR: ${{ job.status }}
|
||||||
SLACK_MESSAGE: "Something failed! :this-is-fine:"
|
SLACK_MESSAGE: "Failed to deploy ${{ env.PROJECT }} to ${{ env.ENVIRONMENT }}! :this-is-fine:"
|
||||||
|
|||||||
12
k8s/values-cec-prd.yaml
Normal file
12
k8s/values-cec-prd.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
ingress:
|
||||||
|
hostname: ota-admin.cec-prd.fiskerinc.com
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 250m
|
||||||
|
memory: 256Mi
|
||||||
|
|
||||||
|
replicas: 3
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
"build:dev": "env-cmd -f .env.dev react-scripts build",
|
"build:dev": "env-cmd -f .env.dev react-scripts build",
|
||||||
"build:stg": "env-cmd -f .env.stg react-scripts build",
|
"build:stg": "env-cmd -f .env.stg react-scripts build",
|
||||||
"build:prd": "env-cmd -f .env.prd react-scripts build",
|
"build:prd": "env-cmd -f .env.prd react-scripts build",
|
||||||
|
"build:cec-prd": "env-cmd -f .env.cec-prd 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:debug": "react-scripts --inspect-brk test --runInBand --no-cache",
|
||||||
|
|||||||
Reference in New Issue
Block a user