Skip to content

Commit

Permalink
docs: add CI/CD documentation (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLicense authored Mar 14, 2024
1 parent dfdf27b commit d53bf67
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/app/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "App",
"position": 20,
"position": 30,
"collapsed": false
}
Binary file added docs/assets/cd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/ci-cd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions docs/ci-cd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
sidebar_position: 50
---

# CI/CD

At a high level, the VOL application's CI/CD pipeline can be visualised as follows:

![CI/CD](./assets/ci-cd.png)

## Continuous Integration (CI)

:::note

Only parts of the application that have changed are updated during continuous integration.

:::

The CI workflow is triggered by a `pull_request` to the default branch (`main`). The workflow is responsible for building, testing the application & infrastructure, and running Terraform plans on the infrastructure.

**Workflow**: [.github/workflows/ci.yaml](https://github.com/dvsa/vol-app/blob/main/.github/workflows/ci.yaml).

Various tools run on CI to ensure the quality of the codebase:

### ![](./assets/languages/php.svg) PHP

#### Testing

- [PHPUnit](https://github.com/sebastianbergmann/phpunit)

#### Linting

- [PHPStan](https://github.com/phpstan/phpstan)
- [Psalm](https://github.com/vimeo/psalm)
- [PHP_CodeSniffer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)

#### Security

- [Snyk](https://snyk.io/)

### ![](./assets/languages/docker.svg) Docker

#### Linting

- [Hadolint](https://github.com/hadolint/hadolint)

#### Testing

- Docker build (`docker build`)

#### Security

- [Trivy](https://github.com/aquasecurity/trivy)
- [Checkov](https://github.com/bridgecrewio/checkov)

### ![](./assets/languages/terraform.svg) Terraform

#### Linting

- [TFLint](https://github.com/terraform-linters/tflint)
- Terraform format (`terraform fmt`)

#### Testing

- Terraform validate (`terraform validate`)
- Terraform plan (`terraform plan`)

#### Security

- [Snyk](https://snyk.io/)
- [Trivy](https://github.com/aquasecurity/trivy)
- [Checkov](https://github.com/bridgecrewio/checkov)

## Continuous Deployment (CD)

The CD workflow is triggered by a successful merge to the default branch (`main`). The workflow is responsible for building and deploying the application through to the production environment.

**Workflow**: [.github/workflows/cd.yaml](https://github.com/dvsa/vol-app/blob/main/.github/workflows/cd.yaml).

![CD workflow](./assets/cd.png)
2 changes: 1 addition & 1 deletion docs/infrastructure/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Infra",
"position": 30,
"position": 40,
"collapsed": false
}
5 changes: 5 additions & 0 deletions docs/infrastructure/docker/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Docker",
"position": 10,
"collapsed": false
}
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/infrastructure/terraform/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Terraform",
"position": 20,
"collapsed": false
}
1 change: 1 addition & 0 deletions docs/infrastructure/terraform/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Overview

0 comments on commit d53bf67

Please sign in to comment.