Skip to content

Commit 377aaaa

Browse files
committed
eho changed to savanna
1 parent 9905c7e commit 377aaaa

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

lib/savanna

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# lib/eho
2+
# Functions to control the configuration and operation of the EHO service
3+
# <do not include this template file in ``stack.sh``!>
4+
5+
# ``stack.sh`` calls the entry points in this order:
6+
#
7+
# install_svanna
8+
# configure_savanna
9+
# init_savanna
10+
# start_savanna
11+
# stop_savanna
12+
# cleanup_savanna
13+
14+
# Save trace setting
15+
XTRACE=$(set +o | grep xtrace)
16+
set +o xtrace
17+
18+
source $TOP_DIR/openrc
19+
20+
# Defaults
21+
# --------
22+
23+
# <define global variables here that belong to this project>
24+
25+
# Set up default directories
26+
SAVANNA_DIR=$DEST/savanna
27+
28+
if [[ -d $SAVANNA_DIR/bin ]]; then
29+
SAVANNA_BIN_DIR=$SAVANNA_DIR/bin
30+
else
31+
SAVANNA_BIN_DIR=$(get_python_exec_prefix)
32+
fi
33+
34+
# Entry Points
35+
# ------------
36+
37+
function cleanup_savanna() {
38+
echo "SAVANNA has been cleaned"
39+
}
40+
41+
function configure_savanna() {
42+
setup_develop $SAVANNA_DIR
43+
44+
# configure eho to use mysql installation
45+
46+
echo "
47+
[DEFAULT]
48+
allow_cluster_ops=true
49+
50+
os_auth_host=127.0.0.1
51+
os_admin_password=$OS_PASSWORD
52+
53+
[cluster_node]
54+
55+
[sqlalchemy]
56+
57+
" > $SAVANNA_DIR/etc/savanna/savanna.conf
58+
}
59+
60+
function init_savanna() {
61+
echo "init savanna"
62+
$SAVANNA_BIN_DIR/savanna-manage --config-file $SAVANNA_DIR/etc/savanna/savanna.conf reset-db --with-gen-templates
63+
}
64+
65+
function install_savanna() {
66+
git_clone $SAVANNA_REPO $SAVANNA_DIR $SAVANNA_BRANCH $SAVANNA_TAG
67+
}
68+
69+
function start_savanna() {
70+
screen_it savanna "cd $SAVANNA_DIR && $SAVANNA_BIN_DIR/savanna-api --config-file $SAVANNA_DIR/etc/savanna/savanna.conf"
71+
}
72+
73+
function stop_savanna() {
74+
for serv in savanna; do
75+
screen -S $SCREEN_NAME -p $serv -X kill
76+
done
77+
}
78+
79+
# Restore xtrace
80+
$XTRACE

0 commit comments

Comments
 (0)