Skip to content

Commit f18be77

Browse files
committed
Various docker environment fixes.
- Legacy-Id: 17026
1 parent 98dc8e9 commit f18be77

4 files changed

Lines changed: 19 additions & 9 deletions

File tree

docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ RUN apt-get install -qy \
7878
libxml2-dev \
7979
libxslt-dev \
8080
libz-dev \
81+
libffi-dev \
8182
locales \
8283
make \
8384
man \

docker/build

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
7676
# Option parsing
7777

7878
# Options
79-
shortopts=ht:vV
80-
longopts=help,tag=,verbose,version
79+
shortopts=hlt:vV
80+
longopts=help,local,tag=,verbose,version
8181

8282
# Default values
8383
BRANCH=$(svn log -v ^/tags -l 2 | grep 'A /tags/[1-9]' | awk '{print $2}')
8484
TAG=${BRANCH##*/}
85+
LOCAL=""
8586

8687
if [ "$(uname)" = "Linux" ]; then
8788
args=$(getopt -o "$shortopts" --long "$longopts" -n '$program' -- $SV "$@")
@@ -99,6 +100,7 @@ fi
99100
while true ; do
100101
case "$1" in
101102
-h| --help) usage; exit;; # Show this help, then exit
103+
-l| --local) LOCAL=1;; # Don't upload
102104
-t| --tag) TAG=$2; shift;; # Use this docker image tag, instead of the latest svn tags name
103105
-v| --verbose) VERBOSE=1;; # Be more talkative
104106
-V| --version) version; exit;; # Show program version, then exit
@@ -124,5 +126,7 @@ fi
124126
docker rmi -f ietf/datatracker-environment:trunk || true
125127
docker build -t ietf/datatracker-environment:$TAG docker/
126128
docker tag $(docker images -q ietf/datatracker-environment | head -n 1) ietf/datatracker-environment:latest
127-
docker push ietf/datatracker-environment:latest
128-
docker push ietf/datatracker-environment:$TAG
129+
if [ -z "$LOCAL" ]; then
130+
docker push ietf/datatracker-environment:latest
131+
docker push ietf/datatracker-environment:$TAG
132+
fi

docker/docker-init.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,9 @@ if ! python -c "import django"; then
105105
pip install -r /usr/local/share/datatracker/requirements3.txt
106106
fi
107107

108-
if [ ! -f $VIRTDIR/lib/site-python/settings_local.py ]; then
108+
if [ ! -f $CWD/ietf/settings_local.py ]; then
109109
echo "Setting up a default settings_local.py ..."
110-
mkdir -p $VIRTDIR/lib/site-python/
111-
cp /usr/local/share/datatracker/settings_local.py $VIRTDIR/lib/site-python/
110+
cp /usr/local/share/datatracker/settings_local.py /home/$USER/$CWD/ietf/settings_local.py
112111
fi
113112

114113
for sub in test/id/ test/staging/ test/archive/ test/rfc test/media test/wiki/ietf; do
@@ -143,6 +142,7 @@ for sub in \
143142
if [ ! -d "$dir" ]; then
144143
echo "Creating dir $dir"
145144
mkdir -p "$dir";
145+
chown "$USER" "$dir"
146146
fi
147147
done
148148

@@ -161,6 +161,8 @@ chmod -R g+w /usr/local/lib/ # so we can patch libs if needed
161161

162162
cd "/home/$USER/$CWD" || cd "/home/$USER/"
163163

164+
export LANG=en_GB.UTF-8
165+
164166
echo "Done!"
165167

166-
su $USER
168+
su -p $USER

docker/run

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ MYSQLDIR=$parent/data/mysql
8282
FILEDIR=$parent/../data/
8383
PORT=8000
8484
REPO="ietf/datatracker-environment"
85-
TAG=$(basename $(svn info $parent | grep ^URL | awk '{print $2}'))
8685
DBURL=https://www.ietf.org/lib/dt/sprint/ietf_utf8.bin.tar.bz2
8786
WHO=$(whoami)
8887
WHOUID=$(id -u $WHO)
@@ -120,6 +119,10 @@ while true ; do
120119
shift
121120
done
122121

122+
if [ -z "$TAG" ]; then
123+
TAG=$(basename $(svn info $parent | grep ^URL | awk '{print $2}'))
124+
fi
125+
123126
# ----------------------------------------------------------------------
124127
# The program itself
125128

0 commit comments

Comments
 (0)