simplify deployment script usage

This commit is contained in:
Daniel Micay 2024-06-17 18:29:28 -04:00
parent 750cd5e985
commit d103f6cdf3
3 changed files with 66 additions and 7 deletions

View File

@ -3,10 +3,18 @@
set -o errexit -o nounset -o pipefail set -o errexit -o nounset -o pipefail
. hosts.sh . hosts.sh
. deploy.sh
[[ $# -eq 1 ]] || exit 1
readonly host=$1
readonly ip=${hosts_ipv4_address[$host]}
readonly hostname=${hosts_hostname[$host]}
readonly agcount=${hosts_agcount[$host]:-4}
readonly swap=${hosts_agcount[$host]:-2048}
readonly remote=root@$ip readonly remote=root@$ip
readonly drive=$(ssh $remote '[[ -e /dev/sda ]] && echo sda || echo vda')
# check for Arch ISO # check for Arch ISO
ssh $remote '[[ $(grep IMAGE_ID /etc/os-release) = "IMAGE_ID=archlinux" ]]' || exit 5 ssh $remote '[[ $(grep IMAGE_ID /etc/os-release) = "IMAGE_ID=archlinux" ]]' || exit 5
ssh $remote '[[ $(grep IMAGE_VERSION /etc/os-release) = "IMAGE_VERSION=2024.06.01" ]]' || exit 5 ssh $remote '[[ $(grep IMAGE_VERSION /etc/os-release) = "IMAGE_VERSION=2024.06.01" ]]' || exit 5

View File

@ -1,6 +0,0 @@
readonly ip=199.195.250.78
readonly hostname=staging
readonly host=staging.grapheneos.org
readonly drive=vda
readonly agcount=4
readonly swap=2048

View File

@ -1,3 +1,60 @@
declare -Ar hosts_hostname=(
[ns1.staging.grapheneos.org]=ns1-staging
[ns1.grapheneos.org]=ns1
[0.ns2.grapheneos.org]=0-ns2
[1.ns2.grapheneos.org]=1-ns2
[2.ns2.grapheneos.org]=2-ns2
[mail.grapheneos.org]=mail
[staging.grapheneos.org]=staging
[0.grapheneos.org]=0-grapheneos
[1.grapheneos.org]=1-grapheneos
[2.grapheneos.org]=2-grapheneos
[3.grapheneos.org]=3-grapheneos
[0.grapheneos.network]=0-network
[1.grapheneos.network]=1-network
[2.grapheneos.network]=2-network
[3.grapheneos.network]=3-network
[0.releases.grapheneos.org]=0-releases
[1.releases.grapheneos.org]=1-releases
[2.releases.grapheneos.org]=2-releases
[3.releases.grapheneos.org]=3-releases
[4.releases.grapheneos.org]=4-releases
[5.releases.grapheneos.org]=5-releases
[6.releases.grapheneos.org]=6-releases
[7.releases.grapheneos.org]=7-releases
[staging.attestation.app]=staging-attestation
[attestation.app]=attestation
[matrix.grapheneos.org]=matrix
[discuss.grapheneos.org]=discuss
[grapheneos.social]=social
)
declare -Ar hosts_swap=(
[0.releases.grapheneos.org]=8192
[1.releases.grapheneos.org]=8192
[2.releases.grapheneos.org]=8192
[3.releases.grapheneos.org]=8192
[4.releases.grapheneos.org]=8192
[5.releases.grapheneos.org]=8192
[6.releases.grapheneos.org]=8192
[7.releases.grapheneos.org]=8192
[attestation.app]=4096
[matrix.grapheneos.org]=8192
[discuss.grapheneos.org]=4096
[grapheneos.social]=4096
)
declare -Ar hosts_agcount=(
[0.releases.grapheneos.org]=8
[1.releases.grapheneos.org]=8
[2.releases.grapheneos.org]=8
[3.releases.grapheneos.org]=8
[4.releases.grapheneos.org]=8
[5.releases.grapheneos.org]=8
[6.releases.grapheneos.org]=8
[7.releases.grapheneos.org]=8
)
declare -Ar hosts_reserved_ports=( declare -Ar hosts_reserved_ports=(
[0.grapheneos.network]=7275 [0.grapheneos.network]=7275
[1.grapheneos.network]=7275 [1.grapheneos.network]=7275