-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
88 additions
and
52 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,25 @@ | ||
#!/bin/bash | ||
DOCS_ROOT=dist/docs/ | ||
REPO_NAME="ooni/backend" | ||
COMMIT_HASH=$(git rev-parse --short HEAD) | ||
|
||
mkdir -p $DOCS_ROOT | ||
|
||
strip_title() { | ||
# Since the title is already present in the frontmatter, we need to remove | ||
# it to avoid duplicate titles | ||
local infile="$1" | ||
cat $infile | awk 'BEGIN{p=1} /^#/{if(p){p=0; next}} {print}' | ||
} | ||
|
||
cat <<EOF>$DOCS_ROOT/00-index.md | ||
--- | ||
# Do not edit! This file is automatically generated | ||
# to edit go to: https://github.com/$REPO_NAME/edit/master/README.md | ||
# version: $REPO_NAME:$COMMIT_HASH | ||
title: My Documentation Title | ||
description: My Documentation Description | ||
slug: mydocs | ||
--- | ||
EOF | ||
strip_title README.md >> $DOCS_ROOT/00-index.md |
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,3 @@ | ||
### Quickstart | ||
|
||
- Install [ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) |
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,25 @@ | ||
#!/bin/bash | ||
DOCS_ROOT=dist/docs/ | ||
REPO_NAME="ooni/devops" | ||
COMMIT_HASH=$(git rev-parse --short HEAD) | ||
|
||
mkdir -p $DOCS_ROOT | ||
|
||
strip_title() { | ||
# Since the title is already present in the frontmatter, we need to remove | ||
# it to avoid duplicate titles | ||
local infile="$1" | ||
cat $infile | awk 'BEGIN{p=1} /^#/{if(p){p=0; next}} {print}' | ||
} | ||
|
||
cat <<EOF>$DOCS_ROOT/00-index.md | ||
--- | ||
# Do not edit! This file is automatically generated | ||
# to edit go to: https://github.com/$REPO_NAME/edit/master/README.md | ||
# version: $REPO_NAME:$COMMIT_HASH | ||
title: OONI Devops | ||
description: OONI Devops | ||
slug: devops | ||
--- | ||
EOF | ||
strip_title README.md >> $DOCS_ROOT/00-index.md |
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,35 @@ | ||
# Terraform | ||
|
||
Terraform is used for managing the OONI infrastructure as code. | ||
|
||
## Quickstart | ||
|
||
1. Install [terraform](https://developer.hashicorp.com/terraform/install) | ||
2. Setup AWS credentials by making your ~/.aws/credentials look like this: | ||
|
||
``` | ||
[oonidevops_user] | ||
aws_access_key_id = XXXX | ||
aws_secret_access_key = YYYY | ||
role_arn = arn:aws:iam::OONI_ORG_ID:role/oonidevops | ||
``` | ||
|
||
Where you replace OONI_ORG_ID with the ID of the ORG you are deploying to (dev, | ||
test or prod). | ||
|
||
3. Run `terrafrom plan` to check the plan | ||
4. Run `terraform apply` to apply the plan | ||
|
||
Once you have applied a plan the changes to the terraform config should be | ||
pushed to the `main` branch immediately so that we minimize the change of other | ||
people applying stale configurations. | ||
|
||
### Notes | ||
|
||
https://www.terraform-best-practices.com/naming | ||
|
||
Sometimes it's useful to specify a target like this: | ||
|
||
``` | ||
terraform apply -target=module.ooniapi_frontend.aws_lb_listener_rule.oonidataapi_rule | ||
``` |