Skip to content

Commit a8db9e7

Browse files
committed
Updated docker/settings_local.py with new needed settings. Added a lot of quotes to docker/run in order to work better with paths containsing spaces. Touched a file during setup to be more debian compatible.
- Legacy-Id: 13703
1 parent 70de94f commit a8db9e7

4 files changed

Lines changed: 37 additions & 18 deletions

File tree

docker/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ RUN apt-get install -qy \
6565
locales \
6666
man \
6767
openssh-client \
68+
patch \
6869
procps \
6970
pv \
7071
python \
@@ -106,6 +107,9 @@ RUN rm /etc/apt/sources.list.d/mysql-apt-config.list
106107
# Update the package defs, and install the desired mysql from the mysql repo
107108
RUN apt-get update
108109
RUN apt-get install -qy mysql-community-server libmysqlclient-dev
110+
111+
# This is expected to exist by the mysql startup scripts:
112+
RUN touch /etc/mysql/debian.cnf
109113
# ------------------------------------------------------------------------------
110114

111115
# Get rid of installation files we don't need in the image, to reduce size

docker/docker-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if [ ! -f $VIRTDIR/lib/site-python/settings_local.py ]; then
100100
cp /usr/local/share/datatracker/settings_local.py $VIRTDIR/lib/site-python/
101101
fi
102102

103-
for sub in test/id/ test/staging/ test/archive/; do
103+
for sub in test/id/ test/staging/ test/archive/ test/rfc test/media; do
104104
dir="/home/$USER/$CWD/$sub"
105105
if [ ! -d "$dir" ]; then
106106
echo "Creating dir $dir"

docker/run

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -184,45 +184,45 @@ image=$(docker ps | grep "$REPO:$TAG" | awk '{ print $1 }')
184184
if [ "$image" ]; then
185185
if [ "$*" ]; then
186186
echo "Running 'cd ~/${parent#$HOME/}; $*'"
187-
docker exec -u $WHO -t $image bash -c "cd ~/${parent#$HOME/}; $*"
187+
docker exec -u "$WHO" -t $image bash -c "cd '~/${parent#$HOME/}'; $*"
188188
else
189-
docker exec -u $WHO -ti $image bash
189+
docker exec -u "$WHO" -ti $image bash
190190
fi
191191
else
192192
echo ""
193193
echo "Starting a docker container for '$TAG'."
194194

195195
if [ -n "$DOWNLOAD" ]; then
196196
(
197-
cd $(dirname $MYSQLDIR)
198-
wget -N $DBURL && tar xjf ietf_utf8.bin.tar.bz2 && chmod -R go+rwX mysql
197+
cd "$(dirname $MYSQLDIR)"
198+
wget -N "$DBURL" && tar xjf ietf_utf8.bin.tar.bz2 && chmod -R go+rwX mysql
199199
)
200200
[ -d "$MYSQLDIR" ] || die "The download seems to have failed; still no $MYSQLDIR. Giving up."
201201
else
202202
[ -d "$MYSQLDIR" ] || die "Expected $MYSQLDIR to exist, but it\ndidn't. Use '$program -d' to download and unpack the database."
203203
fi
204204

205-
if ! docker images $REPO | grep -q $TAG; then
205+
if ! docker images "$REPO" | grep -q "$TAG"; then
206206
echo "Fetching docker image '$REPO:$TAG'"
207-
if ! docker pull $REPO:$TAG; then
208-
docker pull $REPO:latest || die "Failed to pull down the '$REPO:latest' docker image"
209-
id=$(docker images $REPO | grep latest | awk '{print $3}')
207+
if ! docker pull "$REPO:$TAG"; then
208+
docker pull "$REPO:latest" || die "Failed to pull down the '$REPO:latest' docker image"
209+
id=$(docker images "$REPO" | grep latest | awk '{print $3}')
210210
echo "Tagging $REPO:latest as $REPO:$TAG for use as environment for this branch."
211-
docker tag $id $REPO:$TAG
211+
docker tag $id "$REPO:$TAG"
212212
fi
213213
fi
214214

215215
echo -e "\nThe web interface for 'runserver' should appear on $URL\n"
216216
if [ -z "$MYSQLDIR" ]; then
217-
docker run -ti -p $PORT:8000 -v $HOME:/home/$WHO \
218-
-e USER=$WHO -e DATADIR=${parent#$HOME/}/data -e CWD=${PWD#$HOME/} \
219-
-e TAG=$TAG -e FILEDIR=${FILEDIR#$HOME} \
220-
$REPO:$TAG "$@"
217+
docker run -ti -p $PORT:8000 -v "$HOME:/home/$WHO" \
218+
-e USER="$WHO" -e DATADIR="${parent#$HOME/}/data" -e CWD="${PWD#$HOME/}" \
219+
-e TAG="$TAG" -e FILEDIR=${FILEDIR#$HOME} \
220+
"$REPO:$TAG" "$@"
221221
else
222-
docker run -ti -p $PORT:8000 -v $HOME:/home/$WHO -v $MYSQLDIR:/var/lib/mysql\
223-
-e USER=$WHO -e DATADIR=${parent#$HOME/}/data -e CWD=${PWD#$HOME/} \
224-
-e TAG=$TAG -e FILEDIR=${FILEDIR#$HOME} \
225-
$REPO:$TAG "$@"
222+
docker run -ti -p $PORT:8000 -v "$HOME:/home/$WHO" -v "$MYSQLDIR:/var/lib/mysql"\
223+
-e USER="$WHO" -e DATADIR="${parent#$HOME/}/data" -e CWD="${PWD#$HOME/}" \
224+
-e TAG="$TAG" -e FILEDIR=${FILEDIR#$HOME} \
225+
"$REPO:$TAG" "$@"
226226
fi
227227

228228
echo ""

docker/settings_local.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
IDSUBMIT_REPOSITORY_PATH = "test/id/"
2020
IDSUBMIT_STAGING_PATH = "test/staging/"
2121
INTERNET_DRAFT_ARCHIVE_DIR = "test/archive/"
22+
INTERNET_ALL_DRAFTS_ARCHIVE_DIR = "test/archive/"
23+
RFC_PATH = "test/rfc/"
2224

2325
AGENDA_PATH = 'test/data/proceedings/'
2426

@@ -28,3 +30,16 @@
2830

2931
TRAC_WIKI_DIR_PATTERN = "test/wiki/%s"
3032
TRAC_SVN_DIR_PATTERN = "test/svn/%s"
33+
34+
MEDIA_BASE_DIR = 'test'
35+
MEDIA_ROOT = MEDIA_BASE_DIR + '/media/'
36+
MEDIA_URL = '/media/'
37+
38+
PHOTOS_DIRNAME = 'photo'
39+
PHOTOS_DIR = MEDIA_ROOT + PHOTOS_DIRNAME
40+
41+
SUBMIT_YANG_RFC_MODEL_DIR = '/www/tools.ietf.org/yang/rfcmod/'
42+
SUBMIT_YANG_DRAFT_MODEL_DIR = '/www/tools.ietf.org/yang/draftmod/'
43+
SUBMIT_YANG_INVAL_MODEL_DIR = '/www/tools.ietf.org/yang/invalmod/'
44+
SUBMIT_YANGLINT_COMMAND = None
45+

0 commit comments

Comments
 (0)