2017-05-19 12:38:29 +00:00
|
|
|
# Uncomment if you want to use docker-in-docker
|
|
|
|
# image: gsiupm/dockermake:latest
|
|
|
|
# services:
|
|
|
|
# - docker:dind
|
2017-02-13 11:04:29 +00:00
|
|
|
# When using dind, it's wise to use the overlayfs driver for
|
|
|
|
# improved performance.
|
2017-05-19 12:38:29 +00:00
|
|
|
|
2017-02-13 11:04:29 +00:00
|
|
|
stages:
|
|
|
|
- test
|
2017-02-27 19:00:09 +00:00
|
|
|
- push
|
2017-05-19 12:38:29 +00:00
|
|
|
- deploy
|
2017-02-27 11:14:39 +00:00
|
|
|
- clean
|
2017-02-13 11:04:29 +00:00
|
|
|
|
2017-05-19 12:38:29 +00:00
|
|
|
before_script:
|
2017-08-27 16:43:40 +00:00
|
|
|
- make -e login
|
2017-05-19 12:38:29 +00:00
|
|
|
|
2017-02-13 11:04:29 +00:00
|
|
|
.test: &test_definition
|
2017-02-13 18:41:18 +00:00
|
|
|
stage: test
|
2017-02-13 11:04:29 +00:00
|
|
|
script:
|
2017-02-27 11:14:39 +00:00
|
|
|
- make -e test-$PYTHON_VERSION
|
2017-02-17 10:24:57 +00:00
|
|
|
|
2017-02-13 11:04:29 +00:00
|
|
|
test-3.5:
|
|
|
|
<<: *test_definition
|
2017-02-27 11:14:39 +00:00
|
|
|
variables:
|
|
|
|
PYTHON_VERSION: "3.5"
|
2017-02-13 11:04:29 +00:00
|
|
|
|
|
|
|
test-2.7:
|
|
|
|
<<: *test_definition
|
2017-02-27 11:14:39 +00:00
|
|
|
variables:
|
|
|
|
PYTHON_VERSION: "2.7"
|
2017-02-13 11:04:29 +00:00
|
|
|
|
|
|
|
.image: &image_definition
|
2017-02-27 19:00:09 +00:00
|
|
|
stage: push
|
2017-02-13 11:04:29 +00:00
|
|
|
script:
|
2017-02-27 11:14:39 +00:00
|
|
|
- make -e push-$PYTHON_VERSION
|
2017-02-13 11:04:29 +00:00
|
|
|
only:
|
2017-02-13 18:41:18 +00:00
|
|
|
- tags
|
|
|
|
- triggers
|
2017-10-03 13:17:40 +00:00
|
|
|
- fix-makefiles
|
2017-02-13 11:04:29 +00:00
|
|
|
|
2017-02-27 19:00:09 +00:00
|
|
|
push-3.5:
|
2017-02-13 11:04:29 +00:00
|
|
|
<<: *image_definition
|
|
|
|
variables:
|
2017-02-13 18:41:18 +00:00
|
|
|
PYTHON_VERSION: "3.5"
|
2017-02-13 11:04:29 +00:00
|
|
|
|
2017-02-27 19:00:09 +00:00
|
|
|
push-2.7:
|
2017-02-13 11:04:29 +00:00
|
|
|
<<: *image_definition
|
|
|
|
variables:
|
2017-02-13 18:41:18 +00:00
|
|
|
PYTHON_VERSION: "2.7"
|
2017-02-27 19:22:55 +00:00
|
|
|
|
2017-02-27 19:00:09 +00:00
|
|
|
push-latest:
|
2017-02-27 19:22:55 +00:00
|
|
|
<<: *image_definition
|
2017-02-27 18:30:02 +00:00
|
|
|
variables:
|
2017-02-27 19:22:55 +00:00
|
|
|
PYTHON_VERSION: latest
|
2017-02-13 18:41:18 +00:00
|
|
|
only:
|
|
|
|
- master
|
2017-02-27 11:14:39 +00:00
|
|
|
- triggers
|
2017-12-13 14:36:35 +00:00
|
|
|
- fix-makefiles
|
2017-02-27 11:14:39 +00:00
|
|
|
|
2017-06-02 17:21:12 +00:00
|
|
|
push-github:
|
2017-05-19 12:38:29 +00:00
|
|
|
stage: deploy
|
|
|
|
script:
|
2017-06-02 17:21:12 +00:00
|
|
|
- make -e push-github
|
2017-05-19 12:38:29 +00:00
|
|
|
only:
|
|
|
|
- master
|
2017-06-02 17:21:12 +00:00
|
|
|
- triggers
|
2017-10-03 14:41:04 +00:00
|
|
|
- fix-makefiles
|
2017-05-19 12:38:29 +00:00
|
|
|
|
2017-06-02 17:21:12 +00:00
|
|
|
deploy_pypi:
|
|
|
|
stage: deploy
|
|
|
|
script: # Configure the PyPI credentials, then push the package, and cleanup the creds.
|
|
|
|
- echo "[server-login]" >> ~/.pypirc
|
2017-10-03 15:05:24 +00:00
|
|
|
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
|
2017-10-03 15:19:14 +00:00
|
|
|
- echo "username=" ${PYPI_USER} >> ~/.pypirc
|
2017-06-02 17:21:12 +00:00
|
|
|
- echo "password=" ${PYPI_PASSWORD} >> ~/.pypirc
|
|
|
|
- make pip_upload
|
|
|
|
- echo "" > ~/.pypirc && rm ~/.pypirc # If the above fails, this won't run.
|
|
|
|
only:
|
2017-06-12 19:06:34 +00:00
|
|
|
- /^v?\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
|
2017-06-02 17:21:12 +00:00
|
|
|
except:
|
|
|
|
- branches
|
|
|
|
|
|
|
|
deploy:
|
2017-05-19 15:55:52 +00:00
|
|
|
stage: deploy
|
2017-06-02 17:21:12 +00:00
|
|
|
environment: test
|
2017-05-19 15:55:52 +00:00
|
|
|
script:
|
2017-06-02 17:21:12 +00:00
|
|
|
- make -e deploy
|
2017-05-19 15:55:52 +00:00
|
|
|
only:
|
|
|
|
- master
|
2017-10-03 11:43:30 +00:00
|
|
|
- fix-makefiles
|
2017-05-19 15:55:52 +00:00
|
|
|
|
2017-05-19 15:55:52 +00:00
|
|
|
push-github:
|
|
|
|
stage: deploy
|
|
|
|
script:
|
|
|
|
- make -e push-github
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- triggers
|
|
|
|
|
2017-02-27 11:14:39 +00:00
|
|
|
clean :
|
|
|
|
stage: clean
|
|
|
|
script:
|
2017-02-27 19:22:55 +00:00
|
|
|
- make -e clean
|
2017-06-02 17:21:12 +00:00
|
|
|
when: manual
|
|
|
|
|
2017-06-12 19:50:51 +00:00
|
|
|
cleanup_py:
|
2017-06-02 17:21:12 +00:00
|
|
|
stage: clean
|
|
|
|
when: always # this is important; run even if preceding stages failed.
|
|
|
|
script:
|
|
|
|
- rm -vf ~/.pypirc # we don't want to leave these around, but GitLab may clean up anyway.
|
2017-06-02 18:02:27 +00:00
|
|
|
- docker logout
|