switch to custom CI base image with dependencies installed

This commit is contained in:
Jens Langhammer 2019-04-18 10:15:44 +02:00
parent 3cfe45d3cb
commit 8143fae2d6
2 changed files with 123 additions and 102 deletions

View File

@ -1,15 +1,11 @@
# Global Variables
before_script:
- "python3 -m pip install -U virtualenv"
- "virtualenv env"
- "source env/bin/activate"
- "pip3 install -U -r requirements-dev.txt"
stages:
- build-buildimage
- test
- build
- docs
- deploy
image: python:3.6
image: docker.pkg.beryju.org/passbook-build-base:latest
services:
- postgres:latest
- redis:latest
@ -22,6 +18,20 @@ variables:
include:
- /client-packages/allauth/.gitlab-ci.yml
create-build-image:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "{\"auths\":{\"docker.$NEXUS_URL\":{\"auth\":\"$NEXUS_AUTH\"}}}" > /kaniko/.docker/config.json
script:
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.build-base --destination docker.pkg.beryju.org/passbook-build-base:latest --destination docker.pkg.beryju.org/passbook-build-base:0.1.32-beta
stage: build-buildimage
only:
refs:
- tags
- /^version/.*$/
isort:
script:
- isort -c -sg env
@ -121,7 +131,6 @@ package-client-package-sentry:
- /^version/.*$/
changes:
- client-packages/sentry-auth-passbook/**
# docs:
# stage: docs
# only:

12
Dockerfile.build-base Normal file
View File

@ -0,0 +1,12 @@
FROM python:3.6
COPY ./passbook/ /app/passbook
COPY ./client-packages/ /app/client-packages
COPY ./requirements.txt /app/
COPY ./requirements-dev.txt /app/
WORKDIR /app/
RUN apt-get update && apt-get install libssl-dev libffi-dev libpq-dev -y && \
pip install -U -r requirements-dev.txt && \
rm -rf /app/*