Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/martibosch/another-doge-test
Test terraform setup for cookiecutter-django-doge.
https://github.com/martibosch/another-doge-test
Last synced: 4 days ago
JSON representation
Test terraform setup for cookiecutter-django-doge.
- Host: GitHub
- URL: https://github.com/martibosch/another-doge-test
- Owner: martibosch
- Created: 2022-07-22T16:29:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-25T08:38:06.000Z (over 2 years ago)
- Last Synced: 2024-06-11T16:30:15.241Z (7 months ago)
- Language: HCL
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Staging/production deployment
### First-time setup
#### 1. Create a GitHub repository and push the initial commit
#### 2. Initialize terraform
From the `terraform` directory, initalize terraform with the following command, which should only be run once (unless the provider/module versions change):
```bash
cd terraform
terraform init
```#### 3. Import the repository into terraform state
```bash
terraform import -var-file=staging.tfvars module.base.github_repository.repo another-doge-test
```#### 4. Plan and apply
Plan the changes:
```bash
terraform plan -var-file=staging.tfvars
```review them, and apply:
```bash
terraform apply -var-file=staging.tfvars
```#### 5. Provide environment secrets
##### Staging
Go to the "Settings" tab in the repository, then "Environments" on the left menu, and there go to "New environment" and name it `staging`. From the page of the created environment, go to "Add secret" and create a secret named `DROPLET_IPV4` with the IP address of the droplet created by `terraform apply`, which can be obtained as in `terraform output droplet_ipv4` (remember to ommit the quotes when providing the secret value).
#### 6. Branch protection rules
The following branch protection rules must be set in GitHub.
* `Require a pull request before merging`
* `Require status checks to pass before merging` with `Require branches to be up to date before merging`
* optional `Require linear history`### Deployment
The actual deployment strategy follows a git-ops workflow.