Commit de89f814 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

heptapod-ci: switching to Python3.8 with our own base image

--HG--
branch : heptapod
parent 3e78a99421fa
......@@ -65,7 +65,7 @@
policy: pull
.use-pg11:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.27-lfs-2.9-chrome-83-node-12.x-yarn-1.21-postgresql-11-graphicsmagick-1.3.34"
image: "heptapod/ci-heptapod-base"
services:
- name: postgres:11.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
......
......@@ -48,7 +48,6 @@ rspec:
- .heptapod-rails-cache
script:
- rm -rf tmp/tests/gitaly # stale files from previous builds can prevent proper installation
- apt-get -qq update && apt-get install -qy virtualenv python-dev
- run_timed_command "bundle exec ruby -I. -e 'require \"config/environment\"; TestEnv.init'"
- run_timed_command "python3 scripts/prepare_build_py_heptapod.py"
- ls -al tmp/tests/*
......
......@@ -7,16 +7,14 @@ that `config/gitlab.yml` has already been initialized.
import os
import subprocess
# later on we'll install python3.8 (CI base image is Debian 9 with 3.5)
INTERPRETER = 'python2'
INTERPRETER = 'python3.8'
CWD = os.getcwd()
PY_HEPTAPOD_CLONE_PATH = os.path.join(CWD, 'vendor', 'py-heptapod')
VENV = os.path.join(CWD, 'venv')
HG_BIN = os.path.join(VENV, 'bin', 'hg')
PIP_BIN = os.path.join(VENV, 'bin', 'pip')
HG_BIN = '/usr/local/bin/hg'
PIP_BIN = 'pip3.8'
# yes, Mercurial is readily available in GitLab base CI image!
# But its Debian 9 version (hg 4.0)
......@@ -31,21 +29,12 @@ else:
PY_HEPTAPOD_CLONE_PATH,
))
virtualenv_cmd = ('virtualenv', '-p', INTERPRETER, VENV)
print("Creating virtualenv: " + repr(virtualenv_cmd))
subprocess.check_call(virtualenv_cmd)
dulwich_cmd = (PIP_BIN, 'install', 'dulwich<0.20')
print("Forcing install of a dulwich "
"version suitable for Python2: " + repr(dulwich_cmd))
subprocess.check_call(dulwich_cmd)
pip_cmd = (PIP_BIN, 'install', '-e', PY_HEPTAPOD_CLONE_PATH)
print("Installing py-heptapod in virtualenv: " + repr(pip_cmd))
print("Installing py-heptapod " + repr(pip_cmd))
subprocess.check_call(pip_cmd)
pip_logging_cmd = (PIP_BIN, 'install', 'hg-loggingmod')
print("Installing hg-loggingmod in virtualenv: " + repr(pip_logging_cmd))
print("Installing hg-loggingmod: " + repr(pip_logging_cmd))
subprocess.check_call(pip_logging_cmd)
local_hgrc_path = os.path.join(CWD, 'config', 'tests.hgrc')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment