Commit 15a732c2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

improve createbytask*

parent 102e86ea
...@@ -200,16 +200,27 @@ tune_php() ...@@ -200,16 +200,27 @@ tune_php()
tune_apache2() tune_apache2()
{ {
local i
# See https://bugzilla.altlinux.org/show_bug.cgi?id=39115
local F=/etc/httpd2/conf/mods-start.d/090-etersoft-default.conf
truncate $F
for i in $A2ENMOD ; do for i in $A2ENMOD ; do
docmd a2enmod $i docmd a2enmod $i
echo "$i=yes" >>$F
done done
for i in $A2DISMOD; do for i in $A2DISMOD ; do
docmd a2dismod $i docmd a2dismod $i
echo "$i=no" >>$F
done done
F=/etc/httpd2/conf/extra-start.d/090-etersoft-default.conf
truncate $F
for i in httpd-multilang-errordoc ; do for i in httpd-multilang-errordoc ; do
docmd a2disextra $i docmd a2disextra $i
echo "$i=no" >>$F
done done
cat <<EOF > /etc/httpd2/conf/mods-available/remoteip.conf cat <<EOF > /etc/httpd2/conf/mods-available/remoteip.conf
...@@ -218,6 +229,7 @@ cat <<EOF > /etc/httpd2/conf/mods-available/remoteip.conf ...@@ -218,6 +229,7 @@ cat <<EOF > /etc/httpd2/conf/mods-available/remoteip.conf
RemoteIPInternalProxy $NGINXIP/32 RemoteIPInternalProxy $NGINXIP/32
</IfModule> </IfModule>
EOF EOF
[ -f /etc/httpd2/conf/mods-enabled/remoteip.conf ] ||
ln -sr /etc/httpd2/conf/mods-available/remoteip.conf /etc/httpd2/conf/mods-enabled/remoteip.conf ln -sr /etc/httpd2/conf/mods-available/remoteip.conf /etc/httpd2/conf/mods-enabled/remoteip.conf
cp /tmp/prepend.php /etc/httpd2/conf/include/prepend.php || fatal cp /tmp/prepend.php /etc/httpd2/conf/include/prepend.php || fatal
...@@ -286,11 +298,14 @@ EOF ...@@ -286,11 +298,14 @@ EOF
a2dissite 000-default a2dissite 000-default
a2dissite ports_all a2dissite ports_all
serv httpd2 restart || fatal serv httpd2 restart || fatal
} }
tune_apache2_mediawiki() tune_apache2_mediawiki()
{ {
local i
# Note: A2ENMOD/A2DISMOD in tune_apache2 # Note: A2ENMOD/A2DISMOD in tune_apache2
for i in mod_php7 status remoteip setenvif rewrite session include ; do for i in mod_php7 status remoteip setenvif rewrite session include ; do
docmd a2enmod $i docmd a2enmod $i
...@@ -403,3 +418,4 @@ if [ -n "$AUSERID" ] ; then ...@@ -403,3 +418,4 @@ if [ -n "$AUSERID" ] ; then
fi fi
epm clean epm clean
...@@ -10,7 +10,16 @@ tune_yandex_mirror() ...@@ -10,7 +10,16 @@ tune_yandex_mirror()
sed -i -e 's|^#\(rpm \[p8\] http://mirror.yandex.ru/altlinux p8\)|\1|' $APTSDIR/yandex.list || return sed -i -e 's|^#\(rpm \[p8\] http://mirror.yandex.ru/altlinux p8\)|\1|' $APTSDIR/yandex.list || return
} }
load_config "$1" TASKFILE="$1"
if ! echo "$TASKFILE" | grep -q ves/ ; then
TASKFILE=ves/$TASKFILE.task
[ -s $TASKFILE ] || fatal "Can't find $TASKFILE (originally $1)"
fi
load_config "$TASKFILE"
FORCE=''
[ "$2" = "--force" ] && FORCE="--force-recreate"
# TODO # TODO
# links: # links:
...@@ -58,10 +67,10 @@ EOF ...@@ -58,10 +67,10 @@ EOF
DOCKID=$ACONF DOCKID=$ACONF
#evz destroy $DOCKID #evz destroy $DOCKID
#docker-compose -f composers/docker-compose.yml -p $BASENAME create $DOCKID || fatal #docker-compose -f composers/docker-compose.yml -p $BASENAME create $DOCKID || fatal
docker-compose -f composers/docker-compose.yml -p $BASENAME up --build --no-start $DOCKID || fatal docmd docker-compose -f composers/docker-compose.yml -p $BASENAME up --build $FORCE --no-start $DOCKID || fatal
#cd - #cd -
docker start $DOCKID || fatal docmd docker start $DOCKID || fatal
#VEIP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DOCKID) #VEIP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DOCKID)
else else
if ! vzlist -a | grep " $VEIP " ; then if ! vzlist -a | grep " $VEIP " ; then
...@@ -189,6 +198,6 @@ fi ...@@ -189,6 +198,6 @@ fi
cat createbytask.int.sh | st tee /tmp/createbytask.int.sh >/dev/null cat createbytask.int.sh | st tee /tmp/createbytask.int.sh >/dev/null
st chmod 0755 /tmp/createbytask.int.sh st chmod 0755 /tmp/createbytask.int.sh
st bash /tmp/createbytask.int.sh $ATASK || fatal st bash -x /tmp/createbytask.int.sh $ATASK || fatal
st epm clean st epm clean
...@@ -6,6 +6,12 @@ fatal() ...@@ -6,6 +6,12 @@ fatal()
exit 1 exit 1
} }
docmd()
{
echo "# $*"
"$@"
}
assure() assure()
{ {
[ -n "$1" ] || fatal "empty" [ -n "$1" ] || fatal "empty"
......
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