Skip to content
Snippets Groups Projects
Unverified Commit 31e8810a authored by Daniel Ecer's avatar Daniel Ecer Committed by GitHub
Browse files

use docker-compose for ci build (#37)

parent 93a37b78
No related branches found
No related tags found
No related merge requests found
.env 0 → 100644
COMPOSE_PROJECT_NAME=sciencebeam-gym
IMAGE_TAG=develop
......@@ -5,8 +5,8 @@ services:
- docker
before_install:
- docker build -t elife/sciencebeam-gym .
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml build
script:
- ./project_tests.sh
- docker-compose -f docker-compose.yml -f docker-compose.ci.yml run --rm sciencebeam-gym ./project_tests.sh
FROM python:2.7.14-stretch
ENV PROJECT_HOME=/srv/sciencebeam-gym
ENV VENV=${PROJECT_HOME}/venv
RUN virtualenv ${VENV}
ENV PYTHONUSERBASE=${VENV} PATH=${VENV}/bin:$PATH
WORKDIR ${PROJECT_HOME}
RUN virtualenv venv
COPY requirements.prereq.txt ${PROJECT_HOME}/
RUN venv/bin/pip install -r requirements.prereq.txt
......
elifeLibrary {
def commit
stage 'Checkout', {
checkout scm
commit = elifeGitRevision()
}
stage 'Build image', {
sh 'docker build -t elife/sciencebeam-gym .'
}
node('containers-jenkins-plugin') {
stage 'Build images', {
checkout scm
dockerComposeBuild(commit)
}
stage 'Run tests', {
elifeLocalTests './project_tests.sh'
stage 'Project tests', {
dockerComposeRun(
"sciencebeam-gym",
"./project_tests.sh",
commit
)
}
}
elifeMainlineOnly {
stage 'Merge to master', {
elifeGitMoveToBranch commit, 'master'
}
stage 'Downstream', {
build job: '/dependencies/dependencies-sciencebeam-update-sciencebeam-gym', wait: false, parameters: [string(name: 'commit', value: commit)]
}
}
}
version: '3'
# to add images that are only used for tests
services: {}
version: '3'
services:
sciencebeam-gym:
build:
context: .
dockerfile: Dockerfile
image: elifesciences/sciencebeam-gym:${IMAGE_TAG}
#!/bin/bash
set -e
docker run --rm elife/sciencebeam-gym /bin/bash -c 'venv/bin/pip install pytest nose && venv/bin/pytest sciencebeam_gym'
pip install -r requirements.dev.txt
pytest sciencebeam_gym
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