Skip to content

Commit

Permalink
Merge pull request #1151 from girder/tox-and-node-docker
Browse files Browse the repository at this point in the history
Make it easier to switch node versions in the test docker.
  • Loading branch information
manthey authored May 5, 2023
2 parents dc9f024 + e2b66a1 commit 2bcc4f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ jobs:
steps:
- checkout
- allservices:
version: 3.10.10
version: 3.10.11
node: v12
- tox:
env: test-py310
Expand All @@ -190,7 +190,7 @@ jobs:
steps:
- checkout
- allservices:
version: 3.11.2
version: 3.11.3
node: v12
- tox:
env: test-py311
Expand Down
25 changes: 18 additions & 7 deletions test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8 \
PYENV_ROOT="/.pyenv" \
PATH="/.pyenv/bin:/.pyenv/shims:$PATH" \
PYTHON_VERSIONS="3.9.16 3.8.16 3.7.16 3.6.15 3.10.10 3.11.2"
PYTHON_VERSIONS="3.9.16 3.8.16 3.7.16 3.6.15 3.10.11 3.11.3"

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -95,7 +95,7 @@ RUN pyenv update && \
find / -xdev -name __pycache__ -type d -exec rm -r {} \+ && \
rm -rf /tmp/* /var/tmp/* && \
# This makes duplicate python library files hardlinks of each other \
rdfind -minsize 1048576 -makehardlinks true -makeresultsfile false /.pyenv
rdfind -minsize 524288 -makehardlinks true -makeresultsfile false /.pyenv

RUN for ver in $PYTHON_VERSIONS; do \
pyenv local $ver && \
Expand All @@ -105,11 +105,22 @@ RUN for ver in $PYTHON_VERSIONS; do \
done && \
pyenv rehash && \
find / -xdev -name __pycache__ -type d -exec rm -r {} \+ && \
rm -rf /tmp/* /var/tmp/*
rm -rf /tmp/* /var/tmp/* && \
rdfind -minsize 524288 -makehardlinks true -makeresultsfile false /.pyenv

RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs && \
find / -xdev -name __pycache__ -type d -exec rm -r {} \+ && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Use nvm to install node
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

# Default node version
RUN . ~/.bashrc && \
nvm install 12 && \
nvm alias default 12 && \
nvm use default && \
rm /usr/local/bin/node || true && \
rm /usr/local/bin/npm || true && \
rm /usr/local/bin/npx || true && \
ln -s `which node` /usr/local/bin/. && \
ln -s `which npm` /usr/local/bin/. && \
ln -s `which npx` /usr/local/bin/.

WORKDIR /app

0 comments on commit 2bcc4f0

Please sign in to comment.