Various docker environment fixes.

- Legacy-Id: 17026
This commit is contained in:
Henrik Levkowetz 2019-11-16 05:08:34 +00:00
parent 98dc8e99f3
commit f18be77bb8
4 changed files with 19 additions and 9 deletions

View file

@ -78,6 +78,7 @@ RUN apt-get install -qy \
libxml2-dev \
libxslt-dev \
libz-dev \
libffi-dev \
locales \
make \
man \

View file

@ -76,12 +76,13 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
# Option parsing
# Options
shortopts=ht:vV
longopts=help,tag=,verbose,version
shortopts=hlt:vV
longopts=help,local,tag=,verbose,version
# Default values
BRANCH=$(svn log -v ^/tags -l 2 | grep 'A /tags/[1-9]' | awk '{print $2}')
TAG=${BRANCH##*/}
LOCAL=""
if [ "$(uname)" = "Linux" ]; then
args=$(getopt -o "$shortopts" --long "$longopts" -n '$program' -- $SV "$@")
@ -99,6 +100,7 @@ fi
while true ; do
case "$1" in
-h| --help) usage; exit;; # Show this help, then exit
-l| --local) LOCAL=1;; # Don't upload
-t| --tag) TAG=$2; shift;; # Use this docker image tag, instead of the latest svn tags name
-v| --verbose) VERBOSE=1;; # Be more talkative
-V| --version) version; exit;; # Show program version, then exit
@ -124,5 +126,7 @@ fi
docker rmi -f ietf/datatracker-environment:trunk || true
docker build -t ietf/datatracker-environment:$TAG docker/
docker tag $(docker images -q ietf/datatracker-environment | head -n 1) ietf/datatracker-environment:latest
docker push ietf/datatracker-environment:latest
docker push ietf/datatracker-environment:$TAG
if [ -z "$LOCAL" ]; then
docker push ietf/datatracker-environment:latest
docker push ietf/datatracker-environment:$TAG
fi

View file

@ -105,10 +105,9 @@ if ! python -c "import django"; then
pip install -r /usr/local/share/datatracker/requirements3.txt
fi
if [ ! -f $VIRTDIR/lib/site-python/settings_local.py ]; then
if [ ! -f $CWD/ietf/settings_local.py ]; then
echo "Setting up a default settings_local.py ..."
mkdir -p $VIRTDIR/lib/site-python/
cp /usr/local/share/datatracker/settings_local.py $VIRTDIR/lib/site-python/
cp /usr/local/share/datatracker/settings_local.py /home/$USER/$CWD/ietf/settings_local.py
fi
for sub in test/id/ test/staging/ test/archive/ test/rfc test/media test/wiki/ietf; do
@ -143,6 +142,7 @@ for sub in \
if [ ! -d "$dir" ]; then
echo "Creating dir $dir"
mkdir -p "$dir";
chown "$USER" "$dir"
fi
done
@ -161,6 +161,8 @@ chmod -R g+w /usr/local/lib/ # so we can patch libs if needed
cd "/home/$USER/$CWD" || cd "/home/$USER/"
export LANG=en_GB.UTF-8
echo "Done!"
su $USER
su -p $USER

View file

@ -82,7 +82,6 @@ MYSQLDIR=$parent/data/mysql
FILEDIR=$parent/../data/
PORT=8000
REPO="ietf/datatracker-environment"
TAG=$(basename $(svn info $parent | grep ^URL | awk '{print $2}'))
DBURL=https://www.ietf.org/lib/dt/sprint/ietf_utf8.bin.tar.bz2
WHO=$(whoami)
WHOUID=$(id -u $WHO)
@ -120,6 +119,10 @@ while true ; do
shift
done
if [ -z "$TAG" ]; then
TAG=$(basename $(svn info $parent | grep ^URL | awk '{print $2}'))
fi
# ----------------------------------------------------------------------
# The program itself