diff --git a/docker/Dockerfile b/docker/Dockerfile index 5847778bd..db0ad6176 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -78,6 +78,7 @@ RUN apt-get install -qy \ libxml2-dev \ libxslt-dev \ libz-dev \ + libffi-dev \ locales \ make \ man \ diff --git a/docker/build b/docker/build index 3c89a4368..79dcd8bad 100755 --- a/docker/build +++ b/docker/build @@ -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 \ No newline at end of file diff --git a/docker/docker-init.sh b/docker/docker-init.sh index 5d9b5d008..390e74377 100644 --- a/docker/docker-init.sh +++ b/docker/docker-init.sh @@ -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 diff --git a/docker/run b/docker/run index a6593c0b4..7bc276658 100755 --- a/docker/run +++ b/docker/run @@ -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