Skip to content

Commit

Permalink
update dev instructions, remove git-branch, and product
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbo committed Jul 28, 2023
1 parent 30de704 commit 94f5dc8
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 76 deletions.
18 changes: 9 additions & 9 deletions .cloudgov/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ applications:
services:
- app-((env))-uaa-client
- federalist-((env))-rds
- ((product))-((env))-env
- pages-((env))-env
- pages-((env))-redis
- ((product))-((env))-proxy
- ((product))-((env))-domain
- pages-((env))-proxy
- pages-((env))-domain
- federalist-((env))-uev-key
- federalist-deploy-user
- federalist-site-wide-error
Expand All @@ -47,17 +47,17 @@ applications:
UAA_HOST: ((uaa_host))
NEW_RELIC_APP_NAME: ((new_relic_app_name))
PROXY_DOMAIN: ((proxy_domain))
PRODUCT: ((product))
PRODUCT: pages
CF_CDN_SPACE_NAME: ((cf_cdn_space_name))
CF_DOMAIN_WITH_CDN_PLAN_GUID: 440cce96-8989-428b-a60e-91c1393bf3f2
NEW_RELIC_ERROR_COLLECTOR_ENABLED: false
- name: ((product))-admin((env_postfix))
- name: pages-admin((env_postfix))
buildpack: staticfile_buildpack
path: ../admin-client
instances: 2
routes:
- route: admin.((domain))
- name: ((product))-queues-ui((env_postfix))
- name: pages-queues-ui((env_postfix))
buildpack: nodejs_buildpack
command: yarn start-bull-board:cg
disk_quota: 2G
Expand All @@ -67,8 +67,8 @@ applications:
- route: queues.((domain))
services:
- app-((env))-uaa-client
- ((product))-((env))-redis
- ((product))-((env))-env
- pages-((env))-redis
- pages-((env))-env
env:
ADMIN_GITHUB_ORGANIZATION: 18F
ADMIN_GITHUB_TEAM: federalist-admins
Expand All @@ -79,4 +79,4 @@ applications:
NPM_CONFIG_PRODUCTION: true
NODE_MODULES_CACHE: false
UAA_LOGIN_HOST: ((uaa_login_host))
PRODUCT: ((product))
PRODUCT: pages
23 changes: 14 additions & 9 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ To analyze the contents of the front end JavaScript bundle, visit http://127.0.0
### Deployment
[TBD] add flow information for release PR
#### Environment Variables
Here `<environment>` refers the value set for the `APP_ENV` environment variable (ie: `production` or `staging`.
Expand Down Expand Up @@ -163,7 +165,7 @@ To deploy to CloudFoundry submit the following:
`cf push federalistapp --strategy rolling --vars-file "./.cloudgov/vars/${CF_SPACE}.yml" -f ./cloudgov/manifest.yml`

### Continuous Integration
We are in the process of migrating from CircleCI to an internal instance of Concourse CI, starting with our staging environment. To use Concourse, one must have appropriate permissions in UAA as administered by the cloud.gov operators. Access to Concourse also requires using the GSA VPN.
Our continuous integration pipeline is run on Concourse CI. To use Concourse, one must have appropriate permissions in UAA as administered by the cloud.gov operators. Access to Concourse also requires using the GSA VPN.

1. To get started install and authenticate with the `fly` CLI:
- `brew install --cask fly`
Expand All @@ -172,26 +174,29 @@ We are in the process of migrating from CircleCI to an internal instance of Conc
2. Update local credential files (see ci/vars/example.yml)

#### CI deployments
This repository contains two distinct deployment pipelines in concourse:
- [__Core__](./ci/pipeline.yml)
This repository contains three distinct deployment pipelines for the core application and one for metrics:
- [__Core Production__](./ci/pipeline-production.yml)
- [__Core Staging__](./ci/pipeline-staging.yml)
- [__Core Dev__](./ci/pipeline-dev.yml)
- [__Metrics__](./apps/metrics/ci/pipeline.yml)

__Core__ deploys the Pages app/api, the admin app, and the queues app. __Metrics__ deploys concourse tasks to check our app/infrastructure health.
__Core [Env]__ deploys the Pages app/api, the admin app, and the queues app for a given environment. __Metrics__ deploys concourse tasks to check our app/infrastructure health.

__*&#8595; NOTICE &#8595;*__

> __Core Dev__ deploys the Pages app/api, the admin app, and the queues app when a PR is created into the `staging` branch. This uses a unique pipeline file: [./ci/pipeline-dev.yml](./ci/pipeline-dev.yml)
> __Core Production__ deploys the Pages app/api, the admin app, and the queues app when a new tag is added to the `main` branch. This uses a unique pipeline file: [./ci/pipeline-production.yml](./ci/pipeline-production.yml). This pipeline is also responsible for creating and updating our release PRs.

> __Core Staging__ deploys the Pages app/api, the admin app, and the queues app when a new commit is added to the `main` branch. This uses a unique pipeline file: [./ci/pipeline-staging.yml](./ci/pipeline-staging.yml)

> __Core Dev__ deploys the Pages app/api, the admin app, and the queues app when a PR is created into the `main` branch. This uses a unique pipeline file: [./ci/pipeline-dev.yml](./ci/pipeline-dev.yml)

#### Core deployment
##### Pipeline instance variables
Three instances of the pipeline are set for the `pages dev`, `pages staging` and `pages production` environments. Instance variables are used to fill in Concourse pipeline parameter variables bearing the same name as the instance variable. See more on [Concourse vars](https://concourse-ci.org/vars.html). Each instance of the pipeline has three instance variables associated to it: `deploy-env`, `git-branch`. `product`
Three instances of the pipeline are set for the `pages dev`, `pages staging` and `pages production` environments. Instance variables are used to fill in Concourse pipeline parameter variables bearing the same name as the instance variable. See more on [Concourse vars](https://concourse-ci.org/vars.html). Each instance of the pipeline has one instance variables associated to it: `deploy-env`.

|Instance Variable|Pages Dev|Pages Staging|Pages Production|
--- | --- | ---| ---|
|**`deploy-env`**|`dev`|`staging`|`production`|
|**`git-branch`**|`staging`|`staging`|`main`|
|**`product`**|`pages`|`pages`|`pages`|

##### Pipeline credentials
Concourse CI integrates directly with [Credhub](https://docs.cloudfoundry.org/credhub/) to provide access to credentials/secrets at job runtime. When a job is started, Concourse will resolve the parameters within the pipeline with the latest credentials using the double parentheses notation (ie. `((<credential-name>))`). See more about the [credentials lookup rules](https://concourse-ci.org/credhub-credential-manager.html#credential-lookup-rules).
Expand All @@ -202,7 +207,7 @@ Some credentials in this pipeline are "compound" credentials that use the pipeli
--- | --- | --- |
|**`((deploy-env))-cf-username`**|The deployment environments CloudFoundry deployer username based on the instanced pipeline|:white_check_mark:|
|**`((deploy-env))-cf-username`**|The deployment environments CloudFoundry deployer password based on the instanced pipeline|:white_check_mark:|
|**`((deploy-env))-((product))-domain`**|The deployment envinronment and product(Pages|Federalist) specific domain for the app|:white_check_mark:|
|**`((deploy-env))-pages-domain`**|The deployment envinronment specific domain for the app|:white_check_mark:|
|**`((slack-channel))`**| Slack channel | :x:|
|**`((slack-username))`**| Slack username | :x:|
|**`((slack-icon-url))`**| Slack icon url | :x:|
Expand Down
5 changes: 2 additions & 3 deletions apps/metrics/ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ jobs:
file: src-metrics/apps/metrics/ci/pipeline.yml
instance_vars:
deploy-env: ((deploy-env))
git-branch: ((git-branch))

############################
# RESOURCES
Expand All @@ -245,7 +244,7 @@ resources:
source:
repository: ((pages-repository-path))
access_token: ((gh-access-token))
base_branch: ((git-branch))
base_branch: main
disable_forks: true
ignore_drafts: false

Expand All @@ -254,7 +253,7 @@ resources:
icon: github
source:
uri: ((git-base-url))/((pages-repository-path))
branch: ((git-branch))
branch: main
commit_verification_keys: ((cloud-gov-pages-gpg-keys))

- name: slack
Expand Down
24 changes: 11 additions & 13 deletions ci/pipeline-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test-admin-client: &test-admin-client
file: src/ci/partials/build-admin-client.yml
image: node
params:
API_URL: https://((((deploy-env))-((product))-domain))
API_URL: https://((((deploy-env))-pages-domain))
NODE_ENV: development

############################
Expand All @@ -65,7 +65,7 @@ jobs:
file: src/ci/partials/build-api.yml
image: node
params:
APP_HOSTNAME: https://((((deploy-env))-((product))-domain))
APP_HOSTNAME: https://((((deploy-env))-pages-domain))

- task: deploy-api
file: src/ci/partials/deploy.yml
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
params:
text: |
:x: FAILED: to migrate database for pages ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"&vars.git-branch="((git-branch))"&vars.product="((product))"|View build details>
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
Expand All @@ -110,7 +110,7 @@ jobs:
params:
text: |
:x: FAILED: api deployment on pages ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"&vars.git-branch="((git-branch))"&vars.product="((product))"|View build details>
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
Expand All @@ -120,7 +120,7 @@ jobs:
params:
text: |
:white_check_mark: SUCCESS: Successfully deployed api on pages ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"&vars.git-branch="((git-branch))"&vars.product="((product))"|View build details>
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
Expand All @@ -138,7 +138,7 @@ jobs:
file: src/ci/partials/configure-nginx.yml
image: cf-image
params:
API_DOMAIN: ((((deploy-env))-((product))-domain))
API_DOMAIN: ((((deploy-env))-pages-domain))

- task: deploy-admin-client
file: src/ci/partials/deploy.yml
Expand All @@ -164,7 +164,7 @@ jobs:
params:
text: |
:x: FAILED: admin client deployment on pages ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"&vars.git-branch="((git-branch))"&vars.product="((product))"|View build details>
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
Expand All @@ -175,7 +175,7 @@ jobs:
params:
text: |
:white_check_mark: SUCCESS: Successfully deployed admin client on pages ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"&vars.git-branch="((git-branch))"&vars.product="((product))"|View build details>
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:
params:
text: |
:x: FAILED: pages queues UI deployment on pages ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"&vars.git-branch="((git-branch))"&vars.product="((product))"|View build details>
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
Expand All @@ -220,7 +220,7 @@ jobs:
params:
text: |
:white_check_mark: SUCCESS: Successfully deployed pages queues UI on pages ((deploy-env))
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"&vars.git-branch="((git-branch))"&vars.product="((product))"|View build details>
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME?vars.deploy-env="((deploy-env))"|View build details>
channel: ((slack-channel))
username: ((slack-username))
icon_url: ((slack-icon-url))
Expand Down Expand Up @@ -255,8 +255,6 @@ jobs:
file: src/ci/pipeline-dev.yml
instance_vars:
deploy-env: ((deploy-env))
git-branch: ((git-branch))
product: ((product))

############################
# RESOURCES
Expand All @@ -269,7 +267,7 @@ resources:
source:
repository: ((pages-repository-path))
access_token: ((gh-access-token))
base_branch: ((git-branch))
base_branch: main
disable_forks: true
ignore_drafts: false

Expand Down
Loading

0 comments on commit 94f5dc8

Please sign in to comment.