use py39 on docker ci

This commit is contained in:
Manuel Barkhau 2021-05-13 20:03:07 +00:00
parent 9379984b93
commit 0219eaf557
3 changed files with 10 additions and 44 deletions

View file

@ -1,12 +1,12 @@
PACKAGE_NAME := pycalver PACKAGE_NAME := bumpver
# This is the python version that is used for: # This is the python version that is used for:
# - `make fmt` # - `make fmt`
# - `make ipy` # - `make ipy`
# - `make lint` # - `make lint`
# - `make devtest` # - `make devtest`
DEVELOPMENT_PYTHON_VERSION := python=3.8 DEVELOPMENT_PYTHON_VERSION := python=3.9
# These must be valid (space separated) conda package names. # These must be valid (space separated) conda package names.
# A separate conda environment will be created for each of these. # A separate conda environment will be created for each of these.
@ -18,7 +18,7 @@ DEVELOPMENT_PYTHON_VERSION := python=3.8
# - python=3.7 # - python=3.7
# - pypy2.7 # - pypy2.7
# - pypy3.5 # - pypy3.5
SUPPORTED_PYTHON_VERSIONS := python=2.7 python=3.5 python=3.6 python=3.8 pypy2.7 pypy3.5 SUPPORTED_PYTHON_VERSIONS := python=3.9 pypy3.5 python=2.7 pypy2.7
include Makefile.bootstrapit.make include Makefile.bootstrapit.make

View file

@ -67,9 +67,7 @@ BDIST_WHEEL_FILE_CMD = ls -1t dist/*.whl | head -n 1
DEV_ENV := $(ENV_PREFIX)/$(DEV_ENV_NAME) DEV_ENV := $(ENV_PREFIX)/$(DEV_ENV_NAME)
DEV_ENV_PY := $(DEV_ENV)/bin/python DEV_ENV_PY := $(DEV_ENV)/bin/python
RSA_KEY_PATH := $(HOME)/.ssh/$(PKG_NAME)_gitlab_runner_id_rsa DOCKER := $(shell which docker)
DOCKER := $(shell which podman || which docker)
DOCKER_BASE_IMAGE := registry.gitlab.com/mbarkhau/pycalver/base DOCKER_BASE_IMAGE := registry.gitlab.com/mbarkhau/pycalver/base
@ -604,19 +602,10 @@ dist_publish: bump_version dist_build dist_upload
## 4. You're using WSL but didn't do export DOCKER_HOST="tcp://localhost:2375" ## 4. You're using WSL but didn't do export DOCKER_HOST="tcp://localhost:2375"
.PHONY: docker_build .PHONY: docker_build
docker_build: docker_build:
@if [[ -f "$(RSA_KEY_PATH)" ]]; then \ $(DOCKER) build \
$(DOCKER) build \ --file docker_base.Dockerfile \
--build-arg SSH_PRIVATE_RSA_KEY="$$(cat '$(RSA_KEY_PATH)')" \ --tag $(DOCKER_BASE_IMAGE):$(DOCKER_IMAGE_VERSION) \
--file docker_base.Dockerfile \ --tag $(DOCKER_BASE_IMAGE) \
--tag $(DOCKER_BASE_IMAGE):$(DOCKER_IMAGE_VERSION) \ .;
--tag $(DOCKER_BASE_IMAGE) \
.; \
else \
$(DOCKER) build \
--file docker_base.Dockerfile \
--tag $(DOCKER_BASE_IMAGE):$(DOCKER_IMAGE_VERSION) \
--tag $(DOCKER_BASE_IMAGE) \
.; \
fi
# $(DOCKER) push $(DOCKER_BASE_IMAGE) $(DOCKER) push $(DOCKER_BASE_IMAGE)

View file

@ -9,31 +9,10 @@
FROM registry.gitlab.com/mbarkhau/bootstrapit/env_builder AS builder FROM registry.gitlab.com/mbarkhau/bootstrapit/env_builder AS builder
# gcc required for cmarkgfm on python3.8
# https://github.com/theacodes/cmarkgfm/issues/22
RUN apt-get update
RUN apt-get install -y gcc
RUN mkdir /root/.ssh/ && \ RUN mkdir /root/.ssh/ && \
ssh-keyscan gitlab.com >> /root/.ssh/known_hosts && \ ssh-keyscan gitlab.com >> /root/.ssh/known_hosts && \
ssh-keyscan registry.gitlab.com >> /root/.ssh/known_hosts ssh-keyscan registry.gitlab.com >> /root/.ssh/known_hosts
ARG SSH_PRIVATE_RSA_KEY
ENV ENV_SSH_PRIVATE_RSA_KEY=${SSH_PRIVATE_RSA_KEY}
# Write private key and generate public key
RUN if ! test -z "${ENV_SSH_PRIVATE_RSA_KEY}"; then \
echo -n "-----BEGIN RSA PRIVATE KEY-----" >> /root/.ssh/id_rsa && \
echo -n ${ENV_SSH_PRIVATE_RSA_KEY} \
| sed 's/-----BEGIN RSA PRIVATE KEY-----//' \
| sed 's/-----END RSA PRIVATE KEY-----//' \
| sed 's/ /\n/g' \
>> /root/.ssh/id_rsa && \
echo -n "-----END RSA PRIVATE KEY-----" >> /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/* && \
ssh-keygen -y -f /root/.ssh/id_rsa > /root/.ssh/id_rsa.pub; \
fi
ADD requirements/ requirements/ ADD requirements/ requirements/
ADD scripts/ scripts/ ADD scripts/ scripts/
@ -48,8 +27,6 @@ RUN make build/envs.txt
ADD requirements/ requirements/ ADD requirements/ requirements/
RUN make conda RUN make conda
RUN rm -f /root/.ssh/id_rsa
# Deleting pkgs implies that `conda install` # Deleting pkgs implies that `conda install`
# will have to pull all packages again. # will have to pull all packages again.
RUN conda clean --all --yes RUN conda clean --all --yes