Skip to content

Commit

Permalink
Add Jenkins integration (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
jawadqur authored Jul 27, 2020
1 parent 3fddb07 commit c873c0a
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ venv/

# Tox
.tox
.cache
.coverage
coverage.xml
htmlcov/
test-reports/

# Jenkins
.local/
.eggs/
.ssh/
*/_version.py
wait-for-it.sh

# vim
*.swp
7 changes: 7 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!groovy

library identifier: "jenkins-lib@master"
scriptedLibPipeline{
testRunner = "docker-compose"
}

2 changes: 2 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ pytz==2019.3
pre-commit==1.21.0
cfgv==2.0.1
detect-secrets==0.13.0

pytest-cov~=2.7.1
24 changes: 24 additions & 0 deletions docker-compose-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.3"
services:
postgres:
image: postgres:9.4
logging:
driver: none
environment:
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- ./psql-users.sh:/docker-entrypoint-initdb.d/psql-users.sh

app:
image: docker.osdc.io/ncigdc/jenkins-agent:master
environment:
SSH_AUTH_SOCK: $SSH_AUTH_SOCK
HTTPS_PROXY: http://cloud-proxy:3128
HTTP_PROXY: http://cloud-proxy:3128
volumes:
- .:/home/jenkins
- $SSH_AUTH_SOCK:$SSH_AUTH_SOCK
command: bash -c "wait-for-it localhost:5432 -t 120 && tox --recreate"
network_mode: "service:postgres"
depends_on:
- postgres
2 changes: 2 additions & 0 deletions psql-users.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
psql -U postgres -c "create user test with superuser password 'test';"
psql -U postgres -c "create database automated_test with owner test;"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

setup(
name='gdc_ng_models',
version='1.3.0',
setup_requires=["setuptools_scm"],
use_scm_version={"local_scheme": "dirty-tag", "fallback_version": "local"},
description='Non-graph GDC models',
license='Apache',
packages=find_packages(),
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ deps=
-rrequirements.txt
-rdev-requirements.txt
commands=
python setup.py develop
./service_wrapper.sh pytest -vvs {posargs} tests/
./service_wrapper.sh pytest -vvs --cov gdc_ng_models --cov-report xml --cov-report html --junit-xml test-reports/results.xml {posargs}

0 comments on commit c873c0a

Please sign in to comment.