-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from yarikoptic/enh-test-contributing
DOC+DOCTEST: more exhaustive list of dependencees
- Loading branch information
Showing
10 changed files
with
160 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test_README_in_docker-Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#Acquire::http { Proxy "http://172.17.42.1:3142"; }; | ||
#Acquire::http { Proxy "http://smaug.datalad.org:3142"; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
#emacs: -*- mode: shell-script; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- | ||
#ex: set sts=4 ts=4 sw=4 noet: | ||
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## | ||
# | ||
# See COPYING file distributed along with the datalad package for the | ||
# copyright and license terms. | ||
# | ||
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## | ||
# | ||
# Helper to generate a Docker instance mapping user uder docker into your USER/UID/GID | ||
# and allowing to run tox within that clean automatically generated according to | ||
# README.md's apt-get lines environment | ||
# | ||
set -e | ||
#set -x | ||
set -u | ||
|
||
DL_DIST=$1 | ||
|
||
topdir=$(realpath `dirname $0`) | ||
dockerfile=$topdir/test_README_in_docker-Dockerfile | ||
# echo "D: $DL_APT" | ||
sed -e "s,DL_DIST,$DL_DIST,g" \ | ||
-e "s,DL_USER,$USER,g" \ | ||
-e "s,DL_UID,`id -u`,g" \ | ||
-e "s,DL_GID,`id -g`,g" \ | ||
-e "s,DL_GIT_USER_EMAIL,`git config --get user.email`,g" \ | ||
-e "s,DL_GIT_USER_NAME,`git config --get user.name`,g" \ | ||
$dockerfile.in >| $dockerfile | ||
|
||
#DL_APT=$(grep '^\(apt-get\|pip\)' ./../../README.md) | ||
|
||
grep '^apt-get ' ./../../README.md | sed -e 's|python-{|python{,3}-{|g' \ | ||
| while read aptline; do | ||
sed -i -e "s|\(\(.*\)DL_APT\(.*\)\)|\2$aptline\3\n\1|g" $dockerfile | ||
: | ||
done | ||
sed -e '/DL_APT/d' -i $dockerfile | ||
|
||
tag=datalad:test_README_${USER}_$DL_DIST | ||
echo "I: tag $tag" | ||
if docker images | grep -q datalad.*test_README.*$DL_DIST; then | ||
echo "I: tag already exists -- skipping rebuilding" | ||
else | ||
docker build -t $tag -f $dockerfile . #&& rm Dockerfile | ||
#docker build --no-cache=True -t $tag -f $dockerfile . #&& rm Dockerfile | ||
fi | ||
|
||
topgitdir=`realpath ${topdir}/../..` | ||
echo "I: top git dir $topgitdir" | ||
|
||
tox="$topgitdir/.tox" | ||
if [ -e "$tox" ]; then | ||
echo "I: removing existing tox under $tox" | ||
rm -r $tox | ||
fi | ||
|
||
echo "I: running tox within docker" | ||
docker run -it --rm=true -v $topgitdir:/home/$USER/datalad $tag tox --sitepackages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM neurodebian:DL_DIST | ||
MAINTAINER Yaroslav Halchenko <yoh@datalad.org> | ||
|
||
USER root | ||
|
||
# Speed up installation using our apt cacher | ||
#RUN mkdir /etc/apt/apt.conf.d/ | ||
COPY conf/etc/apt/apt.conf.d/99apt-cacher /etc/apt/apt.conf.d/99apt-cacher | ||
RUN chmod a+r /etc/apt/apt.conf.d/99apt-cacher | ||
|
||
# Make deb-src avail | ||
RUN sed -i -e 's,^deb\(.*\),deb\1\ndeb-src\1,g' /etc/apt/sources.list.d/neurodebian.sources.list /etc/apt/sources.list | ||
|
||
# Assure popcon doesn't kick in | ||
RUN bash -c "echo 'debconf debconf/frontend select noninteractive' | debconf-set-selections -" | ||
|
||
RUN apt-get update | ||
# Use bash for extended syntax | ||
RUN bash -c "DL_APT" | ||
# Some rudimentary tools if we need to do anything within docker | ||
RUN bash -c "apt-get install -y -q vim less" | ||
RUN apt-get clean | ||
|
||
# Let's setup user matching user | ||
RUN groupadd --gid DL_GID -r DL_USER && useradd -m --uid DL_UID -g DL_USER DL_USER | ||
|
||
USER DL_USER | ||
|
||
WORKDIR /home/DL_USER | ||
# Prepare system for working with Git | ||
RUN git config --global user.email "DL_GIT_USER_EMAIL" | ||
RUN git config --global user.name "DL_GIT_USER_NAME" | ||
# RUN git clone git://github.com/datalad/datalad | ||
RUN mkdir datalad | ||
|
||
WORKDIR /home/DL_USER/datalad | ||
|
||
# run outside so we could re-enter etc | ||
# RUN tox | ||
# Fall back to root, so we have full control happen we want to reuse it? | ||
# USER root |