Skip to content

Commit

Permalink
Merge branch 'develop' into spike/2536-cat4-prototyping
Browse files Browse the repository at this point in the history
  • Loading branch information
raftmsohani authored Jan 24, 2024
2 parents 239cb3d + 92b0a69 commit 101bc88
Show file tree
Hide file tree
Showing 222 changed files with 28,503 additions and 2,349 deletions.
2 changes: 1 addition & 1 deletion .circleci/base_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
node: circleci/node@4.7.0
node: circleci/node@5.1.0
terraform: circleci/[email protected]
jq: circleci/[email protected]

Expand Down
3 changes: 3 additions & 0 deletions .circleci/build-and-test/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
"PATH=$PATH:/home/zap/.local/bin &&
pip install wait-for-it &&
wait-for-it --service http://web:8080 --timeout 180 -- echo \"Django is ready\""
- run:
name: apply the migrations
command: cd tdrs-backend; docker-compose exec web bash -c "python manage.py makemigrations; python manage.py migrate"
- run:
name: Remove existing cypress test users
command: cd tdrs-backend; docker-compose exec web python manage.py delete_cypress_users -usernames [email protected] [email protected]
Expand Down
52 changes: 29 additions & 23 deletions .circleci/deployment/commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,40 @@
backend-appname: <<parameters.backend-appname>>
frontend-appname: <<parameters.frontend-appname>>
cf-space: <<parameters.cf-space>>
- deploy-clamav:
backend-appname: <<parameters.backend-appname>>
cf-org: <<parameters.cf-org>>
cf-space: <<parameters.cf-space>>
- deploy-frontend:
environment: <<parameters.environment>>
backend-appname: <<parameters.backend-appname>>
frontend-appname: <<parameters.frontend-appname>>
cf-space: <<parameters.cf-space>>

clamav-cloud-dot-gov:
parameters:
backend-appname:
default: tdp-backend
type: string
cf-password:
default: CF_PASSWORD_DEV
type: env_var_name
cf-org:
default: CF_ORG
type: env_var_name
cf-space:
default: tanf-dev
type: string
cf-username:
default: CF_USERNAME_DEV
type: env_var_name
steps:
- checkout
- sudo-check
- cf-check
- login-cloud-dot-gov:
cf-password: <<parameters.cf-password>>
cf-org: <<parameters.cf-org>>
cf-space: <<parameters.cf-space>>
cf-username: <<parameters.cf-username>>
- deploy-clamav

deploy-backend:
parameters:
backend-appname:
Expand All @@ -71,30 +95,12 @@
<<parameters.cf-space>>
deploy-clamav:
parameters:
backend-appname:
default: tdp-backend
type: string
cf-org:
default: CF_ORG
type: env_var_name
cf-space:
default: tanf-dev
type: string
steps:
- run:
name: Deploy ClamAV REST application
command: |
cf push clamav-rest -f tdrs-backend/manifest.clamav.yml \
--var cf-space=<<parameters.cf-space>> \
- run:
name: Enable internal route between backend and clamav-rest app
command: |
cf add-network-policy <<parameters.backend-appname>> clamav-rest \
-s <<parameters.cf-space>> \
-o ${<<parameters.cf-org>>} \
--protocol tcp \
--port 9000
--var cf-space=tanf-prod
deploy-frontend:
parameters:
Expand Down
25 changes: 12 additions & 13 deletions .circleci/deployment/jobs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# jobs:
deploy-dev:
executor: docker-executor
parameters:
target_env:
type: string
executor: docker-executor
working_directory: ~/tdp-deploy
steps:
- deploy-cloud-dot-gov:
Expand Down Expand Up @@ -33,26 +33,16 @@
cf-username: CF_USERNAME_STAGING

deploy-infrastructure-dev:
executor: terraform/default
working_directory: ~/tdp-deploy
parameters:
target_env:
type: string
steps:
- deploy-infrastructure:
cf-app: << parameters.target_env >>

deploy-infrastructure-staging:
executor: terraform/default
working_directory: ~/tdp-deploy
steps:
- deploy-infrastructure:
cf-password: CF_PASSWORD_STAGING
cf-username: CF_USERNAME_STAGING
cf-space: tanf-staging
tf-path: ./terraform/staging
cf-app: << parameters.target_env >>

deploy-infrastructure-develop:
deploy-infrastructure-staging:
executor: terraform/default
working_directory: ~/tdp-deploy
steps:
Expand Down Expand Up @@ -151,3 +141,12 @@
cf-password: CF_PASSWORD_PROD
cf-space: tanf-prod
cf-username: CF_USERNAME_PROD
prod-deploy-clamav:
executor: docker-executor
working_directory: ~/tdp-deploy
steps:
- clamav-cloud-dot-gov:
backend-appname: tdp-backend-prod
cf-password: CF_PASSWORD_PROD
cf-space: tanf-prod
cf-username: CF_USERNAME_PROD
115 changes: 59 additions & 56 deletions .circleci/deployment/workflows.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,51 @@
#workflows:
dev-deployment:
deployment:
when:
<< pipeline.parameters.run_dev_deployment >>
and:
- or:
- equal: [ master, << pipeline.git.branch >> ]
- equal: [ main, << pipeline.git.branch >> ]
- equal: [ develop, << pipeline.git.branch >> ]
- << pipeline.parameters.run_dev_deployment >>
- not: << pipeline.parameters.run_nightly_owasp_scan >>

jobs:
- deploy-project-updates-site:
filters:
branches:
only:
- develop
- deploy-infrastructure-dev:
target_env: << pipeline.parameters.target_env >>
- enable-versioning:
requires:
- deploy-infrastructure-dev
filters:
branches:
ignore:
- develop
- main
- master
- deploy-dev:
target_env: << pipeline.parameters.target_env >>
requires:
- deploy-infrastructure-dev

staging-deployment:
unless:
or:
- << pipeline.parameters.run_dev_deployment >>
- << pipeline.parameters.run_nightly_owasp_scan >>
jobs:
- deploy-project-updates-site:
- deploy-infrastructure-staging:
filters:
branches:
only:
- develop
- deploy-infrastructure-develop:
- main
- deploy-infrastructure-production:
filters:
branches:
only:
- master
- enable-versioning:
requires:
- deploy-infrastructure-dev
filters:
branches:
ignore:
- develop
- main
- master
- enable-versioning:
requires:
- deploy-infrastructure-develop
- deploy-infrastructure-staging
target_env: develop
cf-password: CF_PASSWORD_STAGING
cf-username: CF_USERNAME_STAGING
Expand All @@ -46,81 +54,76 @@
branches:
only:
- develop
- deploy-develop:
- enable-versioning:
requires:
- deploy-infrastructure-develop
- deploy-infrastructure-staging
target_env: staging
cf-password: CF_PASSWORD_STAGING
cf-username: CF_USERNAME_STAGING
cf-space: tanf-staging
filters:
branches:
only:
- develop
- test-deployment-e2e:
- main
- enable-versioning:
requires:
- deploy-develop
- deploy-infrastructure-production
target_env: prod
cf-password: CF_PASSWORD_PROD
cf-username: CF_USERNAME_PROD
cf-space: tanf-prod
filters:
branches:
only:
- develop
- make_erd: # from ../util folder
- master
- prod-deploy-clamav:
requires:
- deploy-infrastructure-production
filters:
branches:
only:
- develop
- deploy-infrastructure-staging:
- master
- deploy-dev:
target_env: << pipeline.parameters.target_env >>
requires:
- deploy-infrastructure-dev
filters:
branches:
only:
ignore:
- develop
- main
- enable-versioning:
- master
- deploy-develop:
requires:
- deploy-infrastructure-staging
target_env: staging
cf-password: CF_PASSWORD_STAGING
cf-username: CF_USERNAME_STAGING
cf-space: tanf-staging
filters:
branches:
only:
- main
- develop
- deploy-staging:
requires:
- deploy-infrastructure-staging
filters:
branches:
only:
- main

production-deployment:
unless:
or:
- << pipeline.parameters.run_dev_deployment >>
- << pipeline.parameters.run_nightly_owasp_scan >>
jobs:
- deploy-infrastructure-production:
filters:
branches:
only:
- master
- enable-versioning:
- deploy-production:
requires:
- deploy-infrastructure-production
target_env: prod
cf-password: CF_PASSWORD_PROD
cf-username: CF_USERNAME_PROD
cf-space: tanf-prod
filters:
branches:
only:
- master
- deploy-production:
- test-deployment-e2e:
requires:
- deploy-infrastructure-production
- deploy-develop
filters:
branches:
only:
- master
- develop
- make_erd: # from ../util folder
filters:
branches:
only:
- develop
- master

5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@
*.jpg binary
*.gif binary
*.pdf binary

# Annoying product-updates zip files
product-updates/knowledge-center/FTANF_2009.zip binary eol=lf
product-updates/knowledge-center/SSPMOE_2009.zip binary eol=lf
product-updates/knowledge-center/ftanf.zip binary eol=lf
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/spike.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Spike issue template
about: Template for spike issues
title: 'Spike - '
labels: spike
assignees: ''

---

**Description:**
_Provide a brief background and justification for this issue_

**Open Questions:**
_Please include any questions, possible solutions or decisions that should be explored during work_

- _Open Question 1_
- _Open Question 2_


**Deliverable(s):**
_Create a list of recommendations or proofs of concept to be achieved to complete this issue_

- [ ] _Outcome 1_
- [ ] _Outcome 2_
- [ ] _Outcome 3_

**Supporting Documentation:**
_Please include any relevant log snippets/files/screen shots_

- _Doc 1_
- _Doc 2_

Loading

0 comments on commit 101bc88

Please sign in to comment.