This is an automated email from the ASF dual-hosted git repository. dill0wn pushed a commit to branch dw/8427 in repository https://gitbox.apache.org/repos/asf/allura.git
commit 8dd1b57a7f16aae99d843125993bba3878a2d76a Author: Dillon Walls <dillon.wa...@slashdotmedia.com> AuthorDate: Wed Apr 20 12:01:13 2022 -0400 [#8427] fix for jenkins failing on forgegit --- Dockerfile | 11 ++++++--- scripts/jenkins-python3.7.sh | 56 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 340b3e09b..7ce6336dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,10 +21,13 @@ FROM ubuntu:18.04 # In order to get python3.7, we must add the deadsnakes apt repo, and install 3.7 specifically RUN apt-get update \ && apt-get install software-properties-common -y --no-install-recommends \ - && add-apt-repository ppa:deadsnakes/ppa + && add-apt-repository ppa:deadsnakes/ppa -y \ + && add-apt-repository ppa:git-core/ppa -y \ + && apt-get update + +RUN apt-get upgrade -y git -RUN apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ git-core \ python3.7 \ python3.7-venv \ @@ -46,6 +49,8 @@ RUN apt-get update \ sudo \ && rm -rf /var/lib/apt/lists/* +# RUN git config --global --add safe.directory /allura/ForgeGit/forgegit/tests/data/*.git + # up-to-date version of node & npm RUN curl --silent --location https://deb.nodesource.com/setup_10.x | sudo bash - && \ DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends nodejs diff --git a/scripts/jenkins-python3.7.sh b/scripts/jenkins-python3.7.sh index 1cf42179a..5e02882e3 100755 --- a/scripts/jenkins-python3.7.sh +++ b/scripts/jenkins-python3.7.sh @@ -20,18 +20,30 @@ IMAGE_TAG=allura +# this fixes the input device is not a TTY .. see https://github.com/docker/compose/issues/5696 +# export COMPOSE_INTERACTIVE_NO_CLI=1 + echo echo "=============================================================================" echo "Jenkins Host Info:" echo "=============================================================================" +touch "foo.txt" echo -n 'cpu count: '; grep -c processor /proc/cpuinfo echo hostname: `hostname --short` +echo whoami: `whoami` echo NODE_NAME: $NODE_NAME +echo docker: +docker version +echo docker compose: +docker-compose version echo path: $PATH echo workspace: $WORKSPACE echo jenkins_home: $JENKINS_HOME echo home: $HOME echo pwd: `pwd` +ls -lAh +ls -lAh ./scripts/ +ls -lAh ../ env echo @@ -41,36 +53,54 @@ echo "========================================================================== rm -rf ./allura-data git clean -f -x # remove test.log, nosetest.xml etc (don't use -d since it'd remove our venv dir) +docker-compose down + echo echo "=============================================================================" echo "Run: build docker image" echo "=============================================================================" docker-compose build +echo +echo "=============================================================================" +echo "Setup: venv, pip, pysvn, ./rebuild-all.sh, npm, etc." +echo "=============================================================================" +docker-compose run web scripts/init-docker-dev.sh + +echo +echo "=============================================================================" +echo "Starting up docker containers" +echo "=============================================================================" +docker-compose up -d web + echo echo "=============================================================================" echo "Docker Container Info:" echo "=============================================================================" -docker-compose run web bash -c ' +docker-compose exec -T web bash -c ' echo python path: `which python; python -V`; echo python3.7 path: `which python3.7; python3.7 -V`; git --version; svn --version; echo pip: `pip3 --version`; -echo npm: `npm --version`;' - -echo -echo "=============================================================================" -echo "Setup: venv, pip, pysvn, ./rebuild-all.sh, npm, etc." -echo "=============================================================================" -docker-compose run web scripts/init-docker-dev.sh +echo npm: `npm --version`; +echo whoami: `whoami`; +ls -lAh /allura; +ls -lAh /allura/; +ls -lAh /allura/ForgeGit/forgegit/tests/data/; +ls -lAh /allura/ForgeGit/forgegit/tests/data/*.git; +' echo echo "=============================================================================" echo "Setup: tests" echo "=============================================================================" # set up test dependencies -docker-compose run web pip install -r requirements-dev.txt +docker-compose exec -T web pip install -q -r requirements-dev.txt + +# make test git repos safe to run even though owned by different user +docker-compose exec -T web chown root:root -R /allura +docker-compose exec -T web git config --global --add safe.directory '*' echo echo "=============================================================================" @@ -78,14 +108,14 @@ echo "Run: tests" echo "=============================================================================" # use "Allura* Forge* scripts" instead of "." so that .allura-venv doesn't get checked too (and '.' gives './' prefixed results which don't work out) -docker-compose run web pyflakes Allura* Forge* scripts | awk -F\: '{printf "%s:%s: [E]%s\n", $1, $2, $3}' > pyflakes.txt -docker-compose run web pycodestyle Allura* Forge* scripts > pep8.txt +docker-compose exec -T web bash -c "pyflakes Allura* Forge* scripts | awk -F\: '{printf \"%s:%s: [E]%s\n\", \$1, \$2, \$3}' > pyflakes.txt" +docker-compose exec -T web bash -c "pycodestyle Allura* Forge* scripts > pep8.txt" # TODO: ALLURA_VALIDATION=all -docker-compose run -e LANG=en_US.UTF-8 web ./run_tests --with-xunitmp # --with-coverage --cover-erase +docker-compose exec -T -e LANG=en_US.UTF-8 web ./run_tests --with-xunitmp # --with-coverage --cover-erase retcode=$? -#find . -name .coverage -maxdepth 2 | while read coveragefile; do pushd `dirname $coveragefile`; coverage xml --include='forge*,allura*'; popd; done; +find . -name .coverage -maxdepth 2 | while read coveragefile; do pushd `dirname $coveragefile`; coverage xml --include='forge*,allura*'; popd; done; echo echo "============================================================================="