build cups using docker
This commit is contained in:
parent
a1bd97bd4c
commit
3080193830
@ -1,5 +1,55 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||||
|
WORKING_DIR=`pwd`
|
||||||
|
CREATE_DEFAULT_MOCHAFILE=0
|
||||||
|
|
||||||
WEB_EXE=../../mocha-python/mocha-python/src/mocha-python/mocha-web.py
|
if [ $CREATE_DEFAULT_MOCHAFILE -eq 1 ]; then
|
||||||
|
|
||||||
|
if [ ! -f $WORKING_DIR/Mochafile ]; then
|
||||||
|
echo "warning: Mochafile not found, a default one will be generated"
|
||||||
|
echo "mocha:
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
tenants:
|
||||||
|
- name: super
|
||||||
|
" > Mochafile
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
# WEB_EXE=$CURDIR/../../mocha-python/mocha-python/src/mocha-python/mocha-web.py
|
||||||
|
# python3 $WEB_EXE ${1+"$@"}
|
||||||
|
|
||||||
|
|
||||||
|
cd $SCRIPT_DIR/../../../mocha-suv
|
||||||
|
source ./docker-run --export-vars --enable-ssh
|
||||||
|
|
||||||
|
echo "new MOCHA SUV name: $MOCHA_NEW_SUV_NAME"
|
||||||
|
|
||||||
|
cd $WORKING_DIR
|
||||||
|
|
||||||
|
if [ -f Mochafile ]; then
|
||||||
|
|
||||||
|
# ZIP the contents of the working directory into a CUP
|
||||||
|
# zip -r Mochafile.cup *
|
||||||
|
yaml2json Mochafile > Mochafile.json
|
||||||
|
|
||||||
|
Q=$?
|
||||||
|
if [ $Q -ne 0 ]; then
|
||||||
|
|
||||||
|
exit $Q
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f Mochafile.json ]; then
|
||||||
|
|
||||||
|
# Upload the resulting CUP to the running SUV
|
||||||
|
sshpass -p $MOCHA_NEW_SUV_PASSWORD_WEBMASTER scp -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ./Mochafile.json webmaster@$MOCHA_NEW_SUV_NAME.privatesuv.com:/var/mocha/uploads/Mochafile.json
|
||||||
|
|
||||||
|
docker container exec $MOCHA_NEW_SUV_NAME mochactl reload
|
||||||
|
rm Mochafile.json
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
python3 $WEB_EXE ${1+"$@"}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user