Move virtualenv and wheelhouse creation into the image

This commit is contained in:
Jean-Paul Calderone 2019-04-04 11:26:10 -04:00
parent df1a51cb60
commit 30a34d0b5d
2 changed files with 17 additions and 8 deletions

View File

@ -1,5 +1,9 @@
FROM debian:8
ENV WHEELHOUSE_PATH /tmp/wheelhouse
ENV VIRTUALENV_PATH /tmp/venv
ENV BUILD_SRC_ROOT /tmp/image-build-time-source
RUN apt-get --quiet update && \
apt-get --quiet --yes install git && \
apt-get --quiet --yes install \
@ -11,3 +15,12 @@ RUN apt-get --quiet update && \
libssl-dev \
libyaml-dev \
virtualenv
# Get the project source. Copying in the whole project source here isn't very
# cache friendly but there's no Docker layer cache on CircleCI anyway!
COPY . ${BUILD_SRC_ROOT}
RUN usermod --home /tmp/nobody nobody
RUN chown --recursive nobody:nogroup "${BUILD_SRC_ROOT}"
RUN sudo --set-home -u nobody "${BUILD_SRC_ROOT}"/.circleci/create-virtualenv.sh "${WHEELHOUSE_PATH}" "${VIRTUALENV_PATH}"
RUN sudo --set-home -u nobody "${BUILD_SRC_ROOT}"/.circleci/populate-wheelhouse.sh "${WHEELHOUSE_PATH}" "${VIRTUALENV_PATH}" "${BUILD_SRC_ROOT}"

View File

@ -81,19 +81,12 @@ jobs:
steps:
- "checkout"
- run: &BOOTSTRAP_TEST_ENVIRONMENT
name: "Bootstrap test environment"
command: |
~/project/.circleci/bootstrap-test-environment.sh ~/project
- run: &SETUP_VIRTUALENV
name: "Setup virtualenv"
# pip cannot install packages if the working directory is not
# readable.
working_directory: "/tmp"
command: |
sudo --set-home -u nobody /tmp/project/.circleci/create-virtualenv.sh "${WHEELHOUSE_PATH}" "/tmp/tests"
sudo --set-home -u nobody /tmp/project/.circleci/populate-wheelhouse.sh "${WHEELHOUSE_PATH}" "/tmp/tests" "/tmp/project"
sudo --set-home -u nobody /tmp/project/.circleci/setup-virtualenv.sh \
"${TAHOE_LAFS_TOX_ENVIRONMENT}" \
"${TAHOE_LAFS_TOX_ARGS}"
@ -180,8 +173,11 @@ jobs:
steps:
- "checkout"
- run:
name: "Bootstrap test environment"
command: |
~/project/.circleci/bootstrap-test-environment.sh ~/project
# DRY, YAML-style. See the debian-9 steps.
- run: *BOOTSTRAP_TEST_ENVIRONMENT
- run: *SETUP_VIRTUALENV
- run:
name: "Install Tor"