Skip to content
Snippets Groups Projects
Commit a6469135 authored by Arie Peterson's avatar Arie Peterson
Browse files

Move control container invocation to separate script

parent b7c5d2e7
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,27 @@ else
host=$1
fi
prepareNode()
{
ssh "root@${host}" "bash -s" -- "$host" <prepare-node.sh
}
getControl()
{
ssh "root@${host}" "bash -s" -- <get-control.sh
scp "./control-shell.sh" "root@${host}:/oas/bin/control-shell.sh"
}
setup()
{
ssh -t "root@${host}" "CONTROL=bootstrap /bin/bash --init-file /oas/bin/control-shell.sh"
}
if [ -z "$2" ]
then
ssh "root@${host}" "bash -s" -- "$host" <prepare-node.sh
prepareNode
getControl
setup
else
$2
fi
ssh "root@${host}" "bash -s" -- <get-control.sh
#!/bin/bash
if [ "$CONTROL" == "bootstrap" ]
then
echo "Bootstrapping cluster..."
command="/control/bin/control setup"
else
echo "Starting control shell..."
command="/bin/bash --init-file /control/.bashrc"
fi
docker run --rm -it \
-v /oas:/oas \
-v /oas/local/control:/control/local \
--name oas-control \
docker.greenhost.net/openappstack/control \
$command
......@@ -8,9 +8,4 @@ else
host=$1
fi
ssh -t "root@${host}" "docker run --rm -it \
-v /oas:/oas \
-v /oas/local/control:/control/local \
--name oas-control \
docker.greenhost.net/openappstack/control \
/bin/bash"
ssh -t "root@${host}" "/oas/bin/control-shell.sh"
......@@ -4,7 +4,7 @@ hostname=$(hostname)
configDir="/oas/config"
sshKeyFile="${configDir}/ssh_key"
mkdir -p "/oas/local/control"
mkdir -p "/oas/local/control" "/oas/bin"
# Set up ssh access from local control container.
if ! [ -f "$sshKeyFile" ]
......
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