-
Notifications
You must be signed in to change notification settings - Fork 0
/
reinstall-plugin
64 lines (49 loc) · 1.13 KB
/
reinstall-plugin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# quick & dirty hack
SRCBASE=~/src/penelope
SRCINDICO=$SRCBASE/indico
SRCPLUGINS=$SRCBASE/indico-plugins
# =============================================================================
f_parse_opts(){
# quick & dirty hack
PLUGIN=$1
}
f_update_src(){
cd $SRCPLUGINS
git pull
}
f_venv() {
source ~/.venv/bin/activate
}
f_build_wheel(){
cd $SRCINDICO
if [ ! -d dist ]; then
mkdir dist
fi
python ./bin/maintenance/build-wheel.py plugin ../indico-plugins/$PLUGIN --add-version-suffix
}
f_get_wheel(){
WHEEL=`ls -tr $SRCINDICO/dist/*${PLUGIN}* | tail -1`
echo $WHEEL
}
f_deploy(){
pip install $WHEEL
}
# =============================================================================
f_run_step(){
# execute function
$1
# evaluate the return code
rc=$?
if [ $rc -ne 0 ]; then
echo "something went wrong. Aborting."
exit $rc
fi
}
# =============================================================================
f_parse_opts $@
f_run_step f_update_src
f_run_step f_venv
f_run_step f_build_wheel
f_run_step f_get_wheel
f_run_step f_deploy