mirror of
https://github.com/gsi-upm/senpy
synced 2024-12-22 13:08:13 +00:00
112 lines
2.1 KiB
YAML
112 lines
2.1 KiB
YAML
# Uncomment if you want to use docker-in-docker
|
|
# image: gsiupm/dockermake:latest
|
|
# services:
|
|
# - docker:dind
|
|
# When using dind, it's wise to use the overlayfs driver for
|
|
# improved performance.
|
|
|
|
stages:
|
|
- test
|
|
- push
|
|
- deploy
|
|
- clean
|
|
|
|
before_script:
|
|
- make -e login
|
|
|
|
.test: &test_definition
|
|
stage: test
|
|
script:
|
|
- make -e test-$PYTHON_VERSION
|
|
|
|
test-3.5:
|
|
<<: *test_definition
|
|
variables:
|
|
PYTHON_VERSION: "3.5"
|
|
|
|
test-2.7:
|
|
<<: *test_definition
|
|
variables:
|
|
PYTHON_VERSION: "2.7"
|
|
|
|
.image: &image_definition
|
|
stage: push
|
|
script:
|
|
- make -e push-$PYTHON_VERSION
|
|
only:
|
|
- tags
|
|
- triggers
|
|
- fix-makefiles
|
|
|
|
push-3.5:
|
|
<<: *image_definition
|
|
variables:
|
|
PYTHON_VERSION: "3.5"
|
|
|
|
push-2.7:
|
|
<<: *image_definition
|
|
variables:
|
|
PYTHON_VERSION: "2.7"
|
|
|
|
push-latest:
|
|
<<: *image_definition
|
|
variables:
|
|
PYTHON_VERSION: latest
|
|
only:
|
|
- master
|
|
- triggers
|
|
- fix-makefiles
|
|
|
|
push-github:
|
|
stage: deploy
|
|
script:
|
|
- make -e push-github
|
|
only:
|
|
- master
|
|
- triggers
|
|
- fix-makefiles
|
|
|
|
deploy_pypi:
|
|
stage: deploy
|
|
script: # Configure the PyPI credentials, then push the package, and cleanup the creds.
|
|
- echo "[server-login]" >> ~/.pypirc
|
|
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
|
|
- echo "username=" ${PYPI_USER} >> ~/.pypirc
|
|
- echo "password=" ${PYPI_PASSWORD} >> ~/.pypirc
|
|
- make pip_upload
|
|
- echo "" > ~/.pypirc && rm ~/.pypirc # If the above fails, this won't run.
|
|
only:
|
|
- /^v?\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
|
|
except:
|
|
- branches
|
|
|
|
deploy:
|
|
stage: deploy
|
|
environment: test
|
|
script:
|
|
- make -e deploy
|
|
only:
|
|
- master
|
|
- fix-makefiles
|
|
|
|
push-github:
|
|
stage: deploy
|
|
script:
|
|
- make -e push-github
|
|
only:
|
|
- master
|
|
- triggers
|
|
|
|
clean :
|
|
stage: clean
|
|
script:
|
|
- make -e clean
|
|
when: manual
|
|
|
|
cleanup_py:
|
|
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.
|
|
- docker logout
|