Commit 0c3f9257 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update vz/azbyka/createbytask.sh

parent 0cc3dbbf
...@@ -103,17 +103,22 @@ services: ...@@ -103,17 +103,22 @@ services:
cap_add: cap_add:
- SYS_ADMIN - SYS_ADMIN
networks: networks:
- azbyka_biblia_default - default
# default:
# Error response from daemon: Invalid address 178.18.0.125: It does not belong to any of this network's subnets
# ipv4_address: $VEIP
networks: networks:
azbyka_biblia_default: default:
external: external:
name: azbyka_biblia_default name: azbyka_default
EOF EOF
cd composers/$AUSER cd composers/$AUSER
docker-compose create || fatal docker-compose create || fatal
cd - cd -
DOCKID=$AUSER DOCKID=$AUSER
docker start $DOCKID || fatal docker start $DOCKID || fatal
VEIP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DOCKID)
else else
if ! vzlist -a | grep " $VEIP " ; then if ! vzlist -a | grep " $VEIP " ; then
vzctl create $VEID --ostemplate=$TEMPLATE || fatal vzctl create $VEID --ostemplate=$TEMPLATE || fatal
...@@ -156,14 +161,34 @@ st() ...@@ -156,14 +161,34 @@ st()
# TODO: first time only or force? # TODO: first time only or force?
if true ; then if true ; then
st update_chrooted conf st update_chrooted conf
st epmI eepm st epm update
st epm --auto install eepm
st epm --auto upgrade st epm --auto upgrade
fi fi
# common projects (copy from base container) # common projects (copy from base container)
if [ -n "$VEIDORIG" ] ; then if [ -n "$VEIDORIG" ] ; then
if [ ! -s "apache/$AUSER.conf" ] ; then # copy nginx config from a01
if [ ! -s "/etc/nginx/sites-enabled.d/azbyka.d/$NAME.conf" ] ; then
hostserver cat /var/lib/vz/root/900/etc/nginx/sites-enabled.d/azbyka.d/$NAME.conf > /etc/nginx/sites-enabled.d/azbyka.d/$NAME.conf
hostserver cat /var/lib/vz/root/900/etc/nginx/sites-enabled.d/azbyka.d/$NAME-manual.conf > /etc/nginx/sites-enabled.d/azbyka.d/$NAME-manual.conf
[ -s /etc/nginx/sites-enabled.d/azbyka.d/$NAME-manual.conf ] || rm -f /etc/nginx/sites-enabled.d/azbyka.d/$NAME-manual.conf
hostserver cat /var/lib/vz/root/900/etc/nginx/include/static-fallback-$NAME.conf > /etc/nginx/include/static-fallback-$NAME.conf
fi
# hack
VEPORT=$(printf "%03d" $(($VEID-100)))
cat <<EOF > /etc/nginx/httpconf-enabled.d/upstream_$ACONF.conf
# for site $ADOMAIN/$NAME
upstream sites8$VEPORT {
server $VEIP;
}
EOF
if [ ! -s "apache/$ACONF.conf" ] ; then
hostserver cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/sites-enabled/$ACONF.conf > apache/$ACONF.conf hostserver cat /var/lib/vz/root/$VEIDORIG/etc/httpd2/conf/sites-enabled/$ACONF.conf > apache/$ACONF.conf
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment