From 817aa3e0fc846d2b7cab4e795e349ecaf3b2a405 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Sat, 12 Feb 2022 10:14:44 -0800 Subject: [PATCH] Rename some scripts --- Makefile | 7 +++---- doc/selfhosting.md | 10 +++++----- packer/{provision-web.bash => provision.bash} | 0 packer/web.pkr.hcl | 6 +++--- 4 files changed, 11 insertions(+), 12 deletions(-) rename packer/{provision-web.bash => provision.bash} (100%) diff --git a/Makefile b/Makefile index 4237bdb..c165b03 100644 --- a/Makefile +++ b/Makefile @@ -287,11 +287,10 @@ fmt: fmt-c fmt-go fmt-python fmt-terraform fmt-web # Format all code ### Infrastructure -packer-web: supervisor # Build and publish a new webserver AMI - tools/packer-build-web.bash +packer: supervisor # Build and publish a new webserver AMI + tools/packer-build.bash + -packer-ci: # Build and publish a new CI AMI - tools/packer-build-ci.bash ### Miscellaneous diff --git a/doc/selfhosting.md b/doc/selfhosting.md index f39f507..78f7df1 100644 --- a/doc/selfhosting.md +++ b/doc/selfhosting.md @@ -111,8 +111,8 @@ API. Generate one randomly with `pwgen -s 30 1`. ## Build web AMI You'll want to run `set -a; . .env` to load in the new variables from -`.env`. Now run `make packer-web`. This will take up to 10 minutes to -build a timestamped AMI with a name like `riju-web-20210711223158`. +`.env`. Now run `make packer`. This will take up to 10 minutes to +build a timestamped AMI with a name like `riju-20210711223158`. ## Create local configuration (part 2 of 3) @@ -120,7 +120,7 @@ Add to `.env` the following contents: ``` # Terraform -AMI_NAME=riju-web-20210711223158 +AMI_NAME=riju-20210711223158 AWS_REGION=us-west-1 DOMAIN=your.domain S3_BUCKET=yourname-riju @@ -129,7 +129,7 @@ S3_CONFIG_PATH=config.json ### AMI\_NAME -This is the AMI name from `make packer-web`. +This is the AMI name from `make packer`. ### AWS\_REGION @@ -169,7 +169,7 @@ infrastructure. follow these steps:* 1. Update `.env` and make sure it is sourced (`set -a; . .env`). -2. Run `make packer-web` and get the name of the new AMI. +2. Run `make packer` and get the name of the new AMI. 3. Update it in `.env` under `AMI_NAME` and make sure the update is sourced (`set -a; . .env`). 4. Run `terraform apply`. diff --git a/packer/provision-web.bash b/packer/provision.bash similarity index 100% rename from packer/provision-web.bash rename to packer/provision.bash diff --git a/packer/web.pkr.hcl b/packer/web.pkr.hcl index 0eced82..9244348 100644 --- a/packer/web.pkr.hcl +++ b/packer/web.pkr.hcl @@ -63,7 +63,7 @@ locals { } source "amazon-ebs" "ubuntu" { - ami_name = "riju-web-${local.timestamp}" + ami_name = "riju-${local.timestamp}" instance_type = "t3.small" source_ami = "${data.amazon-ami.ubuntu.id}" ssh_username = "ubuntu" @@ -80,7 +80,7 @@ source "amazon-ebs" "ubuntu" { tag { key = "Name" - value = "riju-web-${local.timestamp}" + value = "riju-${local.timestamp}" } } @@ -155,6 +155,6 @@ build { "SENTRY_DSN=${var.sentry_dsn}", "SUPERVISOR_ACCESS_TOKEN=${var.supervisor_access_token}", ] - script = "provision-web.bash" + script = "provision.bash" } }