Commit 75bd897c authored by Rémi Cailletaud's avatar Rémi Cailletaud

ajout codestyle

parent 1b60d507
......@@ -12,9 +12,17 @@ job_test:
stage : test
script:
- python setup.py test
- pip install coverage
- coverage run -m unittest discover
- coverage report
job_codestyle:
stage: test
script:
- pip install pycodestyle
- pycodestyle dice.py
allow_failure: true
pages:
stage : deploy
only:
......
......@@ -3,6 +3,7 @@ image : python:3
stages :
- test
- deploy
- pypi
before_script:
- cd python-dice
......@@ -16,6 +17,13 @@ job_test:
- coverage run -m unittest discover
- coverage report
job_codestyle:
stage: test
script:
- pip install pycodestyle
- pycodestyle dice.py
allow_failure: true
pages:
stage : deploy
only:
......
......@@ -19,6 +19,13 @@ job_test:
- coverage run -m unittest discover
- coverage report
job_codestyle:
stage: test
script:
- pip install pycodestyle
- pycodestyle dice.py
allow_failure: true
pages:
stage : deploy
only:
......
......@@ -33,6 +33,13 @@ job_test:
- coverage run -m unittest discover
- coverage report
job_codestyle:
stage: test
script:
- pip install pycodestyle
- pycodestyle dice.py
allow_failure: true
pages:
stage : deploy
only:
......
.job_template: &deploy_job
stage: deploy
except:
- /^version-.*$/
when: manual
image: docker
before_script:
- cd python-dice
script:
- docker pull ciformation/dice-server:latest
- if [ "$(docker ps -q -f name=dice-$CI_JOB_NAME)" ]; then docker stop dice-$CI_JOB_NAME; fi;
- docker run --name dice-$CI_JOB_NAME -d --rm -p $PORT:8081 ciformation/dice-server:latest
image : python:3
stages :
- test
- doc
- pypi
- build
- deploy
before_script:
......@@ -9,9 +26,12 @@ before_script:
- python setup.py install
job_test:
stage: test
stage : test
script:
- python setup.py test
- pip install coverage
- coverage run -m unittest discover
- coverage report
job_codestyle:
stage: test
......@@ -33,3 +53,40 @@ pages:
paths:
- public
pypi:
stage : deploy
only:
- /^version-.*$/
script:
- version=$(echo $CI_COMMIT_REF_NAME|cut -d "-" -f 2)
- sed -i -e "s/version='.*',/version='$version',/g" setup.py
- pip install twine
- pip wheel . -w wheelhouse
- twine upload --repository-url https://test.pypi.org/legacy/ wheelhouse/*
build:
stage : build
except:
- /^version-.*$/
image: docker
services:
- docker:dind
before_script:
- docker info
- cd python-dice
script:
- docker build -t $DOCKER_LOGIN/dice-server .
- echo $DOCKER_PASSWORD | docker login -u $DOCKER_LOGIN --password-stdin
- docker push $DOCKER_LOGIN/dice-server
blue:
<<: *deploy_job
variables:
DOCKER_HOST: "osug-docker-ci.u-ga.fr:2376"
PORT: 8090
green:
<<: *deploy_job
variables:
DOCKER_HOST: "osug-docker-ci.u-ga.fr:2376"
PORT: 8091
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