-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tracking pull request to merge release-1.10.0 to main (#270)
* update to 1.10.0 * itvr-404-417-405 (#274) * feat: new text on rebate form (#273) * First github action (#278) * itvr-419--approval-email-changes (#276) * itvr-419--approval-email-changes * itvr-419--add-constants-file * remove superuser and permissions for BA (#275) * remove superuser and permissions for BA * remove comments * Add dispatch (#279) * sync BCDK version with app version (#281) * add timeout (#282) * add inputs (#283) * Gha try inputs 1.10.0 (#284) * itvr-425-409-email-flags-and-approval-email-change (#280) * itvr-425-409-email-flags-and-approval-email-change * fix typo * add env to branch * update release branch name * itvr-422--dob-inputs-change (#277) * change-version-number-and-remove-run-once-code (#287) * update-readme (#288) * Add manual approval step (#285) * split test and prod deployment * update timeout and open deployment * add Tim * itvr-438--fix-cra-upload-error (#299) Co-authored-by: tim738745 <[email protected]> Co-authored-by: Alex Zorkin <[email protected]> Co-authored-by: vibhiquartech <[email protected]>
- Loading branch information
1 parent
8ae77b7
commit e97d996
Showing
25 changed files
with
583 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
## For each release, the value of workflow name, branches and PR_NUMBER need to be adjusted accordingly | ||
|
||
name: CI/CD ITVR release-1.10.0 | ||
|
||
on: | ||
push: | ||
branches: [ release-1.10.0 ] | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
env: | ||
## The pull request number of the Tracking pull request to merge the release branch to main | ||
PR_NUMBER: 270 | ||
RELEASE_NAME: release-1.10.0 | ||
|
||
jobs: | ||
|
||
## This is the CI job | ||
build: | ||
|
||
name: Build ITVR on Openshift | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
|
||
## it will checkout to /home/runner/work/itvr/itvr | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
## Log in to Openshift with a token of service account | ||
- name: Log in to Openshift | ||
uses: redhat-actions/oc-login@v1 | ||
with: | ||
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
insecure_skip_tls_verify: true | ||
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools | ||
|
||
## Run build on Openshift | ||
- name: Run build | ||
run: | | ||
cd .pipeline | ||
npm install | ||
npm run build -- --pr=${{ env.PR_NUMBER }} --env=build | ||
deploy-on-test: | ||
|
||
name: Deploy ITVR on Test Environment | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 240 | ||
needs: build | ||
|
||
steps: | ||
|
||
## it will checkout to /home/runner/work/itvr/itvr | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/oc-login@v1 | ||
with: | ||
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
insecure_skip_tls_verify: true | ||
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools | ||
|
||
- name: Ask for approval for ITVR Test deployment | ||
uses: trstringer/[email protected] | ||
with: | ||
secret: ${{ github.TOKEN }} | ||
approvers: AlexZorkin,emi-hi,tim738745,vibhiquartech,kuanfandevops | ||
minimum-approvals: 1 | ||
issue-title: "ITVR ${{ env.RELEASE_NAME }} Test Deployment" | ||
timeout-minutes: 240 | ||
|
||
- name: Run BCDK deployment on ITVR Test environment | ||
run: | | ||
cd .pipeline | ||
echo "Deploying ITVR ${{ env.RELEASE_NAME }} on Test" | ||
npm install | ||
npm run deploy -- --pr=${{ env.PR_NUMBER }} --env=test | ||
deploy-on-prod: | ||
|
||
name: Deploy ITVR on Prod Environment | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 2880 | ||
needs: deploy-on-test | ||
|
||
steps: | ||
|
||
## it will checkout to /home/runner/work/itvr/itvr | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/oc-login@v1 | ||
with: | ||
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | ||
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | ||
insecure_skip_tls_verify: true | ||
namespace: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools | ||
|
||
- name: Ask for approval for ITVR Prod deployment | ||
uses: trstringer/[email protected] | ||
with: | ||
secret: ${{ github.TOKEN }} | ||
approvers: AlexZorkin,kuanfandevops,tim738745 | ||
minimum-approvals: 2 | ||
issue-title: "ITVR ${{ env.RELEASE_NAME }} Prod Deployment" | ||
timeout-minutes: 2880 | ||
|
||
- name: Run BCDK deployment on ITVR Test environment | ||
run: | | ||
cd .pipeline | ||
echo "Deploying ITVR ${{ env.RELEASE_NAME }} on Prod" | ||
npm install | ||
npm run deploy -- --pr=${{ env.PR_NUMBER }} --env=prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from enum import Enum | ||
|
||
# for each income tested maximum rebate ($4000, $2000, $1000), there are different rebate levels for certain ZEV types and lease terms | ||
class FOUR_THOUSAND_REBATE(Enum): | ||
ZEV_MAX = 4000 | ||
ZEV_MID = 2688 | ||
ZEV_MIN = 1332 | ||
PHEV_MAX = 2000 | ||
PHEV_MID = 1334 | ||
PHEV_MIN = 666 | ||
|
||
|
||
class TWO_THOUSAND_REBATE(Enum): | ||
ZEV_MAX = 2000 | ||
ZEV_MID = 1334 | ||
ZEV_MIN = 666 | ||
PHEV_MAX = 1000 | ||
PHEV_MID = 667 | ||
PHEV_MIN = 333 | ||
|
||
|
||
class ONE_THOUSAND_REBATE(Enum): | ||
ZEV_MAX = 1000 | ||
ZEV_MID = 667 | ||
ZEV_MIN = 333 | ||
PHEV_MAX = 500 | ||
PHEV_MID = 334 | ||
PHEV_MIN = 167 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# django_q hooks | ||
|
||
|
||
from api.models.go_electric_rebate_application import GoElectricRebateApplication | ||
|
||
|
||
def set_email_status(task): | ||
func = task.func | ||
application_id = task.args[1] | ||
email_successful = task.success | ||
if func == "api.tasks.send_individual_confirm": | ||
GoElectricRebateApplication.objects.filter(pk=application_id).update( | ||
confirmation_email_success=email_successful | ||
) | ||
elif task.func == "api.tasks.send_spouse_initial_message": | ||
GoElectricRebateApplication.objects.filter(pk=application_id).update( | ||
spouse_email_success=email_successful | ||
) |
18 changes: 18 additions & 0 deletions
18
django/api/migrations/0011_goelectricrebateapplication_approval_email_sent.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.0.1 on 2022-08-25 17:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0010_alter_cancellablegoelectricrebateapplication_options_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='goelectricrebateapplication', | ||
name='approval_email_sent', | ||
field=models.BooleanField(null=True), | ||
), | ||
] |
39 changes: 39 additions & 0 deletions
39
django/api/migrations/0012_goelectricrebateapplicationwithfailedemail_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Generated by Django 4.0.1 on 2022-09-06 17:52 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0011_goelectricrebateapplication_approval_email_sent'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='GoElectricRebateApplicationWithFailedEmail', | ||
fields=[ | ||
], | ||
options={ | ||
'ordering': ['-created'], | ||
'proxy': True, | ||
'indexes': [], | ||
'constraints': [], | ||
}, | ||
bases=('api.goelectricrebateapplication',), | ||
), | ||
migrations.RemoveField( | ||
model_name='goelectricrebateapplication', | ||
name='approval_email_sent', | ||
), | ||
migrations.AddField( | ||
model_name='goelectricrebateapplication', | ||
name='confirmation_email_success', | ||
field=models.BooleanField(null=True), | ||
), | ||
migrations.AddField( | ||
model_name='goelectricrebateapplication', | ||
name='spouse_email_success', | ||
field=models.BooleanField(null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.