Skip to content
Snippets Groups Projects
Commit 3e74c983 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

add a bit more commentary

parent b5d3ce64
No related branches found
No related tags found
3 merge requests!140Merge staging into production,!122Merge develop into staging,!115Continuous deployment for the grid systems
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jp
#
# Tell all servers belonging to a certain grid that they should update
# themselves to the latest configuration associated with that grid.
#
set -euxo pipefail
# Get the path to the ssh key which authorizes us to deliver this
# notification.
DEPLOY_KEY=$1
shift
# Get the name of the grid to which we're going to deliver notification. This
# corresponds to the name of one of the directories in the top-level `morph`
# directory.
GRIDNAME=$1
shift
# Tell one node to update itself.
# Tell one server to update itself.
update_one_node() {
deploy_key=$1
shift
......@@ -20,6 +30,7 @@ update_one_node() {
ssh -i "${deploy_key}" "deployment@${node}"
}
# Tell all servers belonging to one grid to update themselves.
update_grid_nodes() {
deploy_key=$1
shift
......@@ -32,9 +43,10 @@ update_grid_nodes() {
# to filter out later.
nodes=$(nix eval --json '(builtins.attrNames (import ./morph/${gridname}/grid.nix))')
# Tell every system in the network to update itself.
# Tell every server in the network to update itself.
for node in ${nodes}; do
if [ "${node}" = "network" ]; then
# This isn't a server, it's part of the morph configuration.
continue
fi
update_one_node "${deploy_key}" "${node}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment