Skip to content

Commit

Permalink
Issue #2: add a Dockerfile and docker setup stage to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhoshkun committed Sep 6, 2019
1 parent 990bec9 commit 0ef0404
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
stages:
- setup
- test

docker_build:
image: docker:18.09.0
stage: setup
variable:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_IMAGE_NAME_CI: ${CI_REGISTRY_IMAGE}/puma-ci:${CI_COMMIT_REF_SLUG}
services:
- docker:dind
script:
# Login to our registry
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin ${CI_REGISTRY}
- cd ./ci/docker
- docker build --target PUMA_CI -t ${DOCKER_IMAGE_NAME_CI} .
- docker push ${DOCKER_IMAGE_NAME_CI}
tags:
- docker
- gce
only:
changes:
- ci/docker/**/*

.test_base_task: &test_base_task
image: registry.gitlab.com/gift-surg/puma/puma-ci:master
script:
- pytest

Expand Down
15 changes: 15 additions & 0 deletions ci/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ubuntu:18.04 AS PUMA_CI
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
tzdata \
git-core \
python3.7 \
python3-distutils \
curl \
&& rm -rf /var/lib/apt/lists/*
# Make python3.7 available via python
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
RUN python get-pip.py
# Install needed tools
RUN pip install pytest

0 comments on commit 0ef0404

Please sign in to comment.