Allow injection of Spoke version
and update some version numbers!
This commit is contained in:
parent
293e39f72c
commit
cbd9995458
6
.github/workflows/terraform.yml
vendored
6
.github/workflows/terraform.yml
vendored
@ -9,15 +9,15 @@ jobs:
|
|||||||
- name: fmt
|
- name: fmt
|
||||||
uses: hashicorp/terraform-github-actions@master
|
uses: hashicorp/terraform-github-actions@master
|
||||||
with:
|
with:
|
||||||
tf_actions_version: 0.12.20
|
tf_actions_version: 0.12.21
|
||||||
tf_actions_subcommand: fmt
|
tf_actions_subcommand: fmt
|
||||||
- name: init
|
- name: init
|
||||||
uses: hashicorp/terraform-github-actions@master
|
uses: hashicorp/terraform-github-actions@master
|
||||||
with:
|
with:
|
||||||
tf_actions_version: 0.12.20
|
tf_actions_version: 0.12.21
|
||||||
tf_actions_subcommand: init
|
tf_actions_subcommand: init
|
||||||
- name: validate
|
- name: validate
|
||||||
uses: hashicorp/terraform-github-actions@master
|
uses: hashicorp/terraform-github-actions@master
|
||||||
with:
|
with:
|
||||||
tf_actions_version: 0.12.20
|
tf_actions_version: 0.12.21
|
||||||
tf_actions_subcommand: validate
|
tf_actions_subcommand: validate
|
||||||
|
@ -71,6 +71,7 @@ module "digitalocean_spoke" {
|
|||||||
| region | Region in which all resources will be provisioned | `string` | `"nyc1"` | no |
|
| region | Region in which all resources will be provisioned | `string` | `"nyc1"` | no |
|
||||||
| resource\_prefix | Prefix prepended to resource names | `string` | `"spoke-"` | no |
|
| resource\_prefix | Prefix prepended to resource names | `string` | `"spoke-"` | no |
|
||||||
| server\_name | Server name used in nginx config | `string` | n/a | yes |
|
| server\_name | Server name used in nginx config | `string` | n/a | yes |
|
||||||
|
| spoke\_version | Git ref of MoveOnOrg/Spoke to deploy | `string` | `"v5.2"` | no |
|
||||||
| ssh\_keys | List of ssh public keys to pass to droplet provisioning | `list(string)` | n/a | yes |
|
| ssh\_keys | List of ssh public keys to pass to droplet provisioning | `list(string)` | n/a | yes |
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
7
main.tf
7
main.tf
@ -102,6 +102,12 @@ variable "region" {
|
|||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "spoke_version" {
|
||||||
|
description = "Git ref of MoveOnOrg/Spoke to deploy"
|
||||||
|
default = "v5.2"
|
||||||
|
type = "string"
|
||||||
|
}
|
||||||
|
|
||||||
variable "ssh_keys" {
|
variable "ssh_keys" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of ssh public keys to pass to droplet provisioning"
|
description = "List of ssh public keys to pass to droplet provisioning"
|
||||||
@ -206,6 +212,7 @@ locals {
|
|||||||
PORT = var.port,
|
PORT = var.port,
|
||||||
REDIS_URL = "redis://127.0.0.1:6379/0",
|
REDIS_URL = "redis://127.0.0.1:6379/0",
|
||||||
SESSION_SECRET = random_string.session_secret.result,
|
SESSION_SECRET = random_string.session_secret.result,
|
||||||
|
TERRAFORM_SPOKE_VERSION = var.spoke_version,
|
||||||
}, var.env)
|
}, var.env)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,12 +96,17 @@ _run_system1() {
|
|||||||
_run_spoke0() {
|
_run_spoke0() {
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
|
set -o allexport
|
||||||
|
source /tmp/app.env
|
||||||
|
set +o allexport
|
||||||
|
|
||||||
git --version
|
git --version
|
||||||
if [[ ! -d /home/spoke/app/.git ]]; then
|
if [[ ! -d /home/spoke/app/.git ]]; then
|
||||||
git clone https://github.com/MoveOnOrg/Spoke.git /home/spoke/app
|
git clone https://github.com/MoveOnOrg/Spoke.git /home/spoke/app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /home/spoke/app
|
cd /home/spoke/app
|
||||||
git checkout -qf 'v5.1'
|
git checkout -qf "${TERRAFORM_SPOKE_VERSION}"
|
||||||
|
|
||||||
cp -v /tmp/spoke-app-run /home/spoke/spoke-app-run
|
cp -v /tmp/spoke-app-run /home/spoke/spoke-app-run
|
||||||
chmod +x /home/spoke/spoke-app-run
|
chmod +x /home/spoke/spoke-app-run
|
||||||
@ -122,10 +127,6 @@ _run_spoke0() {
|
|||||||
cp -v /tmp/app.env /home/spoke/app/.env
|
cp -v /tmp/app.env /home/spoke/app/.env
|
||||||
sha1sum /home/spoke/app/.env
|
sha1sum /home/spoke/app/.env
|
||||||
|
|
||||||
set -o allexport
|
|
||||||
source /home/spoke/app/.env
|
|
||||||
set +o allexport
|
|
||||||
|
|
||||||
yarn --version
|
yarn --version
|
||||||
yarn install --ignore-scripts --non-interactive --frozen-lockfile
|
yarn install --ignore-scripts --non-interactive --frozen-lockfile
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user