Additions for bootstrapping gitlab.
This commit is contained in:
parent
34ae3d2fb0
commit
925ec8d349
51
broker.sh
51
broker.sh
@ -86,6 +86,7 @@ done
|
|||||||
program_root="$(\
|
program_root="$(\
|
||||||
cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd\
|
cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd\
|
||||||
)"
|
)"
|
||||||
|
self=${program_root}/broker.sh
|
||||||
stage_root="${program_root}/staging"
|
stage_root="${program_root}/staging"
|
||||||
target_root=${ADAMOCOMP_HOME:-"/"}
|
target_root=${ADAMOCOMP_HOME:-"/"}
|
||||||
config_dir=${ADAMOCOMP_CONFDIR:-"${program_root}"}
|
config_dir=${ADAMOCOMP_CONFDIR:-"${program_root}"}
|
||||||
@ -228,6 +229,14 @@ get_remote_ssh_port () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_remote_user () {
|
||||||
|
local user=$(get_data $* remote user)
|
||||||
|
if [[ -z $user ]]; then
|
||||||
|
user=$dealer
|
||||||
|
fi
|
||||||
|
echo $user
|
||||||
|
}
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Formatted printing and debug.
|
# Formatted printing and debug.
|
||||||
|
|
||||||
@ -325,6 +334,7 @@ install_environment_vars () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_npm_proxy () {
|
set_npm_proxy () {
|
||||||
|
# Not relying on this at the moment.
|
||||||
:
|
:
|
||||||
#npm config set proxy http://some.proxy:83
|
#npm config set proxy http://some.proxy:83
|
||||||
#npm config set https-proxy http://some.proxy:83
|
#npm config set https-proxy http://some.proxy:83
|
||||||
@ -1004,9 +1014,10 @@ ssh_tty_to_host () {
|
|||||||
if host_exists $host; then
|
if host_exists $host; then
|
||||||
local fqdn=$(get_remote_host $host)
|
local fqdn=$(get_remote_host $host)
|
||||||
local port=$(get_remote_ssh_port $host)
|
local port=$(get_remote_ssh_port $host)
|
||||||
|
local user=$(get_remote_user $host)
|
||||||
local cmd="$*"
|
local cmd="$*"
|
||||||
pr_vars fqdn port cmd
|
pr_vars fqdn port user cmd
|
||||||
ssh -tt -o port=${port} ${dealer}@${fqdn} "$*"
|
ssh -tt -o port=${port} ${user}@${fqdn} "$*"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1017,12 +1028,13 @@ scp_contents_to_host () {
|
|||||||
if host_exists $1; then
|
if host_exists $1; then
|
||||||
local fqdn=$(get_remote_host $host)
|
local fqdn=$(get_remote_host $host)
|
||||||
local port=$(get_remote_ssh_port $host)
|
local port=$(get_remote_ssh_port $host)
|
||||||
|
local user=$(get_remote_user $host)
|
||||||
pr_vars host fqdn port source_dir target_dir
|
pr_vars host fqdn port source_dir target_dir
|
||||||
if [[ $TESTING_MODE == "TRUE" ]]; then
|
if [[ $TESTING_MODE == "TRUE" ]]; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
scp -r -o port=${port} $source_dir/* \
|
scp -r -o port=${port} $source_dir/* \
|
||||||
"${dealer}@${fqdn}:${target_dir}/"
|
"${user}@${fqdn}:${target_dir}/"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -1034,12 +1046,13 @@ scp_to_host () {
|
|||||||
if host_exists $1; then
|
if host_exists $1; then
|
||||||
local fqdn=$(get_remote_host $host)
|
local fqdn=$(get_remote_host $host)
|
||||||
local port=$(get_remote_ssh_port $host)
|
local port=$(get_remote_ssh_port $host)
|
||||||
|
local user=$(get_remote_user $host)
|
||||||
pr_vars host fqdn port source_file target_dir
|
pr_vars host fqdn port source_file target_dir
|
||||||
if [[ $TESTING_MODE == "TRUE" ]]; then
|
if [[ $TESTING_MODE == "TRUE" ]]; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
scp -o port=${port} $source_file\
|
scp -o port=${port} $source_file\
|
||||||
"${dealer}@${fqdn}:${target_dir}/"
|
"${user}@${fqdn}:${target_dir}/"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1062,7 +1075,7 @@ download_file () {
|
|||||||
if [[ "$TESTING_MODE" == "TRUE" ]]; then
|
if [[ "$TESTING_MODE" == "TRUE" ]]; then
|
||||||
pr_vars ${fqdn_list[0]} filename
|
pr_vars ${fqdn_list[0]} filename
|
||||||
else
|
else
|
||||||
user=${dealer}
|
local user=$(get_remote_user $host)
|
||||||
pr_vars host
|
pr_vars host
|
||||||
scp -o port="${ssh_port_list[0]}" \
|
scp -o port="${ssh_port_list[0]}" \
|
||||||
"${user}@${fqdn_list[0]}:${filename}" ./
|
"${user}@${fqdn_list[0]}:${filename}" ./
|
||||||
@ -1116,6 +1129,25 @@ execute_on_nodes () {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
docker_run_from_data_on_host () {
|
||||||
|
local host=$1
|
||||||
|
shift
|
||||||
|
local dealkeypath="$*"
|
||||||
|
# env exported here since this is for bootstrapping
|
||||||
|
export_env
|
||||||
|
if construct_deal_info $dealkeypath; then
|
||||||
|
local docker_opts="$(docker_options_string $dealkeypath)"
|
||||||
|
pr_vars deal_name docker_image docker_opts
|
||||||
|
if [[ $TESTING_MODE == "TRUE" ]]; then
|
||||||
|
ssh_tty_to_host $host "echo docker run -d $docker_opts \
|
||||||
|
--name $deal_name $docker_image"
|
||||||
|
else
|
||||||
|
ssh_tty_to_host $host "docker run -d $docker_opts \
|
||||||
|
--name $deal_name $docker_image"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Local automation
|
# Local automation
|
||||||
|
|
||||||
@ -1328,13 +1360,14 @@ remote_node_bootstrap () {
|
|||||||
# Prepares nodes for dealing by installing software.
|
# Prepares nodes for dealing by installing software.
|
||||||
remote_node_init () {
|
remote_node_init () {
|
||||||
construst_cluster_info $1
|
construst_cluster_info $1
|
||||||
|
local user=$(get_remote_user $host)
|
||||||
execute_on_nodes \
|
execute_on_nodes \
|
||||||
"sudo mkdir -p $ADAMOCOMP_HOME;
|
"sudo mkdir -p $ADAMOCOMP_HOME;
|
||||||
sudo mkdir -p $ADAMOCOMP_CONFDIR;
|
sudo mkdir -p $ADAMOCOMP_CONFDIR;
|
||||||
sudo mkdir -p $GITLAB_HOME;
|
sudo mkdir -p $GITLAB_HOME;
|
||||||
sudo chown -R ${dealer}:${dealer} $ADAMOCOMP_HOME;
|
sudo chown -R ${user}:${user} $ADAMOCOMP_HOME;
|
||||||
sudo chown -R ${dealer}:${dealer} $ADAMOCOMP_CONFDIR;
|
sudo chown -R ${user}:${user} $ADAMOCOMP_CONFDIR;
|
||||||
sudo chown -R ${dealer}:${dealer} $GITLAB_HOME;
|
sudo chown -R ${user}:${user} $GITLAB_HOME;
|
||||||
ls -lhd $ADAMOCOMP_HOME;
|
ls -lhd $ADAMOCOMP_HOME;
|
||||||
ls -lhd $ADAMOCOMP_CONFDIR;
|
ls -lhd $ADAMOCOMP_CONFDIR;
|
||||||
ls -lhd $GITLAB_HOME;"
|
ls -lhd $GITLAB_HOME;"
|
||||||
@ -1480,7 +1513,7 @@ install_on_nodes () {
|
|||||||
${datatool} get "$* use_dockerfile"|jq -r '.[0]')
|
${datatool} get "$* use_dockerfile"|jq -r '.[0]')
|
||||||
|
|
||||||
if [[ "$TESTING_MODE" == "TRUE" ]]; then
|
if [[ "$TESTING_MODE" == "TRUE" ]]; then
|
||||||
pr_vars uses_dockerfile maste
|
pr_vars uses_dockerfile master
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Gating against dockerfile usage due to a bug.
|
# Gating against dockerfile usage due to a bug.
|
||||||
|
174
data.json
174
data.json
@ -46,13 +46,84 @@
|
|||||||
"2222:22"
|
"2222:22"
|
||||||
],
|
],
|
||||||
["--restart","always"],
|
["--restart","always"],
|
||||||
["--hostname","gitlab.adamo.network"]
|
["--hostname","gitlab.adamo.network"],
|
||||||
|
[
|
||||||
|
"-e",
|
||||||
|
"GITLAB_OMNIBUS_CONFIG=\"external_url 'http://gitlab.adamo.network:45000'; gitlab_rails['gitlab_shell_ssh_port'] = 22\""
|
||||||
|
]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"suggest": [
|
"suggest": [
|
||||||
"Running as a bootstrap."
|
"Running as a bootstrap."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"asciiflow": {
|
||||||
|
"repo": "apps/asciiflow.git",
|
||||||
|
"docker": {
|
||||||
|
"image": "fraoustin/asciiflow",
|
||||||
|
"options": [
|
||||||
|
[
|
||||||
|
"--publish",
|
||||||
|
"9000:80"
|
||||||
|
],
|
||||||
|
["--restart","always"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"db-postgres": {
|
||||||
|
"repo": "sys/db-postgres.git",
|
||||||
|
"docker" :{
|
||||||
|
"image": "postgres",
|
||||||
|
"options": [
|
||||||
|
["--restart","always"],
|
||||||
|
["--hostname","postgres.adamo.network"],
|
||||||
|
["-e","POSTGRES_PASSWORD=giganticmetaphor"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"adminer": {
|
||||||
|
"repo": "sys/adminer.git",
|
||||||
|
"docker": {
|
||||||
|
"image": "adminer",
|
||||||
|
"options": [
|
||||||
|
["--restart","always"],
|
||||||
|
["--hostname","adminer.adamo.network"],
|
||||||
|
[
|
||||||
|
"--publish",
|
||||||
|
"8080,8080"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"adamopad": {
|
||||||
|
"docker": {
|
||||||
|
"image": "etherpad/etherpad",
|
||||||
|
"options": [
|
||||||
|
["--restart","always"],
|
||||||
|
["--hostname","adminer.adamo.network"],
|
||||||
|
[
|
||||||
|
"--publish",
|
||||||
|
"9001,9001"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"-e",
|
||||||
|
"TITLE=Adamopad",
|
||||||
|
"DEFAULT_PAD_TEST='Adamopad for tsen-like sharings.'",
|
||||||
|
"ADMIN_PASSWORD='azxssfa'",
|
||||||
|
"PAD_OPTIONS_USE_MONOSPACE_FONT='true'",
|
||||||
|
"PAD_OPTIONS_USER_NAME='true'",
|
||||||
|
"PAD_OPTIONS_USER_COLOR='true'",
|
||||||
|
"SKIN_VARIANTS='super-dark-toolbar super-dark-editor super-dark-background'",
|
||||||
|
"DB_TYPE=postgres",
|
||||||
|
"DB_HOST=localhost",
|
||||||
|
"DB_PORT=5432",
|
||||||
|
"DB_NAME=adamopad",
|
||||||
|
"DB_USER=postgres",
|
||||||
|
"DB_PASS=giganticmetaphor"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"covid-data": {
|
"covid-data": {
|
||||||
"repo": "owid/covid-19-data/tree/master/public/data/ecdc",
|
"repo": "owid/covid-19-data/tree/master/public/data/ecdc",
|
||||||
"git_src": "https://github.com/",
|
"git_src": "https://github.com/",
|
||||||
@ -111,7 +182,7 @@
|
|||||||
"remote": {
|
"remote": {
|
||||||
"host": "internum.adamonet",
|
"host": "internum.adamonet",
|
||||||
"ports": {
|
"ports": {
|
||||||
"factorio": 49000
|
"factorio": 50002
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"local": {
|
"local": {
|
||||||
@ -127,7 +198,7 @@
|
|||||||
"remote": {
|
"remote": {
|
||||||
"host": "internum.adamonet",
|
"host": "internum.adamonet",
|
||||||
"ports": {
|
"ports": {
|
||||||
"factorio": 49001
|
"factorio": 50003
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"local": {
|
"local": {
|
||||||
@ -143,8 +214,8 @@
|
|||||||
"remote": {
|
"remote": {
|
||||||
"host": "internum.adamonet",
|
"host": "internum.adamonet",
|
||||||
"ports": {
|
"ports": {
|
||||||
"ssh": 40000,
|
"ssh": 22150,
|
||||||
"resilio-sync": 40001
|
"resilio-sync-panel": 40000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"local": {
|
"local": {
|
||||||
@ -152,53 +223,68 @@
|
|||||||
"ipv4": "192.168.6.150"
|
"ipv4": "192.168.6.150"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"syracusae": {
|
"sicilia": {
|
||||||
"remote": {
|
"syracusae": {
|
||||||
"host": "internum.adamonet",
|
"remote": {
|
||||||
"ports": {
|
"host": "internum.adamonet",
|
||||||
"ssh": 46000,
|
"ports": {
|
||||||
"http": 46005
|
"ssh": 22010,
|
||||||
|
"http": 8010
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"local": {
|
||||||
|
"host": "syracusae.internum.adamonet",
|
||||||
|
"ipv4": "192.168.6.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"local": {
|
"melita": {
|
||||||
"host": "syracusae.internum.adamonet",
|
"remote": {
|
||||||
"ipv4": "192.168.6.10"
|
"host": "internum.adamonet",
|
||||||
}
|
"ports": {
|
||||||
},
|
"ssh": 22020
|
||||||
"melita": {
|
}
|
||||||
"remote": {
|
},
|
||||||
"host": "internum.adamonet",
|
"local": {
|
||||||
"ports": {
|
"ipv4": "192.168.6.20",
|
||||||
"ssh": 46001
|
"host": "melita.internum.adamonet"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"local": {
|
"factorarium": {
|
||||||
"ipv4": "192.168.6.20",
|
"remote": {
|
||||||
"host": "melita.internum.adamonet"
|
"host": "internum.adamonet",
|
||||||
}
|
"ports": {
|
||||||
},
|
"ssh": 22101
|
||||||
"factorarium": {
|
}
|
||||||
"remote": {
|
},
|
||||||
"host": "internum.adamonet",
|
"local": {
|
||||||
"ports": {
|
"ipv4": "192.168.6.101",
|
||||||
"ssh": 46002
|
"host": "factorarium.internum.adamonet"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"local": {
|
"dockerpad": {
|
||||||
"ipv4": "192.168.6.101",
|
"remote": {
|
||||||
"host": "factorarium.internum.adamonet"
|
"host": "internum.adamonet",
|
||||||
}
|
"ports": {
|
||||||
},
|
"ssh": 22102
|
||||||
"dockerpad": {
|
}
|
||||||
"remote": {
|
},
|
||||||
"host": "internum.adamonet",
|
"local": {
|
||||||
"ports": {
|
"ipv4": "192.168.6.102",
|
||||||
"ssh": 46003
|
"host": "dockerpad.internum.adamonet"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"local": {
|
"acragas": {
|
||||||
"ipv4": "192.168.6.102",
|
"remote": {
|
||||||
"host": "dockerpad.internum.adamonet"
|
"host": "internum.adamonet",
|
||||||
|
"ports": {
|
||||||
|
"ssh": 22104
|
||||||
|
},
|
||||||
|
"user": "rancher"
|
||||||
|
},
|
||||||
|
"local": {
|
||||||
|
"ipv4": "192.168.6.104",
|
||||||
|
"host": "acragas.internum.adamonet"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user