2018-05-29 21:49:40 +02:00
|
|
|
---
|
2018-08-02 20:47:24 +02:00
|
|
|
image: s3lph/matemat-ci:20180802-02
|
2018-05-29 21:49:40 +02:00
|
|
|
|
2018-06-05 22:38:42 +02:00
|
|
|
stages:
|
|
|
|
- test
|
2018-07-11 17:17:00 +02:00
|
|
|
- build
|
|
|
|
- staging
|
2018-06-05 22:38:42 +02:00
|
|
|
|
2018-09-15 02:12:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- export MATEMAT_VERSION=$(python -c 'from matemat import __version__; print(__version__)')
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-29 21:49:40 +02:00
|
|
|
test:
|
2018-06-05 22:38:42 +02:00
|
|
|
stage: test
|
2018-05-29 21:49:40 +02:00
|
|
|
script:
|
2018-10-19 21:35:35 +02:00
|
|
|
- pip3 install -e .
|
2018-09-15 02:12:16 +02:00
|
|
|
- sudo -u matemat python3.7 -m coverage run --rcfile=setup.cfg -m unittest discover matemat
|
|
|
|
- sudo -u matemat python3.7 -m coverage combine
|
|
|
|
- sudo -u matemat python3.7 -m coverage report --rcfile=setup.cfg
|
2018-06-05 22:32:09 +02:00
|
|
|
|
|
|
|
codestyle:
|
2018-07-11 17:17:00 +02:00
|
|
|
stage: test
|
2018-06-05 22:32:09 +02:00
|
|
|
script:
|
2018-10-19 21:35:35 +02:00
|
|
|
- pip3 install -e .
|
2018-07-10 22:18:57 +02:00
|
|
|
- sudo -u matemat pycodestyle matemat
|
2018-07-10 20:25:34 +02:00
|
|
|
|
2018-09-15 02:12:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
build_docker:
|
2018-07-11 17:17:00 +02:00
|
|
|
stage: build
|
2018-07-10 20:25:34 +02:00
|
|
|
script:
|
2018-09-15 02:12:16 +02:00
|
|
|
- docker build -t "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" package/docker
|
|
|
|
- docker tag "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME"
|
2018-07-10 20:25:34 +02:00
|
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN registry.gitlab.com
|
2018-08-02 22:08:47 +02:00
|
|
|
- docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA"
|
2018-09-15 02:12:16 +02:00
|
|
|
- docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME"
|
|
|
|
only:
|
|
|
|
- staging
|
|
|
|
- master
|
|
|
|
- tags
|
|
|
|
|
|
|
|
build_wheel:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- python3.7 setup.py egg_info --tag-build "+$CI_COMMIT_SHA" --tag-date bdist_wheel
|
|
|
|
- python3.7 setup.py egg_info --tag-build "+$CI_COMMIT_REF_NAME" --tag-date bdist_wheel
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- "dist/*.whl"
|
2018-07-17 20:30:40 +02:00
|
|
|
only:
|
2018-10-19 21:31:11 +02:00
|
|
|
- deployment
|
2018-08-02 17:21:22 +02:00
|
|
|
- staging
|
2018-08-02 21:55:22 +02:00
|
|
|
- master
|
2018-09-15 02:12:16 +02:00
|
|
|
- tags
|
|
|
|
|
|
|
|
# This is only useful once Debian either defaults python3 to 3.7 or provides python3.7- packages
|
|
|
|
# for the needed dependencies... But it SHOULD work...
|
|
|
|
#build_deb:
|
|
|
|
# stage: build
|
|
|
|
# script:
|
|
|
|
# - cp -r static/ package/debian/matemat/usr/lib/matemat/static/
|
|
|
|
# - cp -r templates/ package/debian/matemat/usr/lib/matemat/templates/
|
|
|
|
# - python3.7 setup.py egg_info -d -b +master install --root=package/debian/matemat/ --prefix=/usr --optimize=1
|
|
|
|
# - export PYTHON_BIN=$(which python3)
|
|
|
|
# - cd package/debian
|
|
|
|
# - mv matemat/usr/lib/python3.7/{site,dist}-packages
|
|
|
|
# - mv matemat/usr/bin/matemat matemat/usr/lib/matemat/matemat
|
2018-10-19 21:31:11 +02:00
|
|
|
# - rm -rf matemat/usr/bin
|
2018-09-15 02:12:16 +02:00
|
|
|
# - find . -type f -exec sed -re "s#${PYTHON_BIN}#/usr/bin/python3.7#g" -i {} \;
|
|
|
|
# - dpkg-deb --build matemat
|
|
|
|
# - mv matemat.deb "matemat_${MATEMAT_VERSION}+${CI_COMMIT_REF_NAME}-1_all.deb"
|
|
|
|
# artifacts:
|
|
|
|
# paths:
|
|
|
|
# - "package/debian/*.deb"
|
|
|
|
# only:
|
|
|
|
# - staging
|
|
|
|
# - master
|
|
|
|
# - tags
|
|
|
|
|
2018-10-19 21:31:11 +02:00
|
|
|
build_archlinux:
|
|
|
|
stage: build
|
|
|
|
image: base/devel:latest # Use an archlinux image instead of the customized debian image.
|
|
|
|
script:
|
|
|
|
- cp -r static/ package/archlinux/matemat/usr/lib/matemat/static/
|
|
|
|
- cp -r templates/ package/archlinux/matemat/usr/lib/matemat/templates/
|
|
|
|
- python3.7 setup.py egg_info -d -b +master install --root=package/archlinux/matemat/ --prefix=/usr --optimize=1
|
|
|
|
- export PYTHON_BIN=$(which python3)
|
|
|
|
- cd package/archlinux
|
|
|
|
- mv matemat/usr/bin/matemat matemat/usr/lib/matemat/matemat
|
|
|
|
- rm -rf matemat/usr/bin
|
|
|
|
- find . -type f -exec sed -re "s#${PYTHON_BIN}#/usr/bin/python3.7#g" -i {} \;
|
|
|
|
- makepkg -s MATEMAT_VERSION=${MATEMAT_VERSION}
|
|
|
|
- mv matemat-${MATEMAT_VERSION}-1-any.pkg.tar.xz "matemat-${MATEMAT_VERSION}+${CI_COMMIT_REF_NAME}-1-any.pkg.tar.xz"
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- "package/archlinux/*.pkg.tar.xz"
|
|
|
|
only:
|
|
|
|
- deployment
|
|
|
|
- staging
|
|
|
|
- master
|
|
|
|
- tags
|
|
|
|
|
2018-09-15 02:12:16 +02:00
|
|
|
|
2018-07-11 17:17:00 +02:00
|
|
|
|
|
|
|
staging:
|
|
|
|
stage: staging
|
|
|
|
script:
|
2018-07-11 17:34:59 +02:00
|
|
|
- eval $(ssh-agent -s)
|
|
|
|
- ssh-add - <<<"$STAGING_SSH_PRIVATE_KEY"
|
2018-08-02 22:08:47 +02:00
|
|
|
- echo "$CI_COMMIT_SHA" | ssh -p 20022 -oStrictHostKeyChecking=no matemat@kernelpanic.lol
|
2018-07-11 17:17:00 +02:00
|
|
|
environment:
|
2018-07-11 17:20:24 +02:00
|
|
|
name: staging
|
|
|
|
url: https://matemat.kernelpanic.lol/
|
2018-07-11 17:37:48 +02:00
|
|
|
only:
|
2018-08-02 17:21:22 +02:00
|
|
|
- staging
|