mirror of
https://github.com/certbot/certbot.git
synced 2026-04-26 08:39:19 -04:00
* If there's no python or there's only python2.6 on red hat systems, install python3 * Always check for python2.6 * address style, documentation, nits * factor out all initialization code * fix up python version return value when no python installed * add no python error and exit * document DeterminePythonVersion parameters * build letsencrypt-auto * close brace * build leauto * fix syntax errors * set USE_PYTHON_3 for all cases * rip out NOCRASH * replace NOCRASH, update LE_PYTHON set logic * use built-in venv for py3 * switch to LE_PYTHON not affecting bootstrap selection and not overwriting LE_PYTHON * python3ify fetch.py * get fetch.py working with python2 and 3 * don't verify server certificates in fetch.py HttpsGetter * Use SSLContext and an environment variable so that our tests continue to never verify server certificates. * typo * build * remove commented out code * address review comments * add documentation for YES_FLAG and QUIET_FLAG * Add tests to centos6 Dockerfile to make sure we install python3 if and only if appropriate to do so.
37 lines
1,023 B
Docker
37 lines
1,023 B
Docker
# For running tests, build a docker image with a passwordless sudo and a trust
|
|
# store we can manipulate.
|
|
|
|
FROM centos:6
|
|
|
|
RUN yum install -y epel-release
|
|
|
|
# Install pip and sudo:
|
|
RUN yum install -y python-pip sudo
|
|
# Use pipstrap to update to a stable and tested version of pip
|
|
COPY ./pieces/pipstrap.py /opt
|
|
RUN /opt/pipstrap.py
|
|
# Pin pytest version for increased stability
|
|
RUN pip install pytest==3.2.5
|
|
|
|
# Add an unprivileged user:
|
|
RUN useradd --create-home --home-dir /home/lea --shell /bin/bash --groups wheel --uid 1000 lea
|
|
|
|
# Let that user sudo:
|
|
RUN sed -i.bkp -e \
|
|
's/# %wheel\(NOPASSWD: ALL\)\?/%wheel/g' \
|
|
/etc/sudoers
|
|
|
|
RUN mkdir -p /home/lea/certbot
|
|
|
|
# Install fake testing CA:
|
|
COPY ./tests/certs/ca/my-root-ca.crt.pem /usr/local/share/ca-certificates/
|
|
RUN update-ca-trust
|
|
|
|
# Copy code:
|
|
COPY . /home/lea/certbot/letsencrypt-auto-source
|
|
|
|
USER lea
|
|
WORKDIR /home/lea
|
|
|
|
RUN sudo chmod +x certbot/letsencrypt-auto-source/tests/centos6_tests.sh
|
|
CMD sudo certbot/letsencrypt-auto-source/tests/centos6_tests.sh
|