Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.71 KiB
Newer Older
#image: registry.esss.lu.se/ics-docker/miniconda
image: python:3.9-slim
Yngve Levinsen's avatar
Yngve Levinsen committed
.pip_install_default: &pip_install_default
    - apt update
    - apt install git -y
    - pip install scipy matplotlib h5py webdavclient3
.pip_install_sphinx: &pip_install_sphinx
    - pip install sphinx==3.2.1 sphinxcontrib-blockdiag blockdiag sphinxcontrib-restbuilder sphinx_rtd_theme numpy m2r2
    - pip install git+https://github.com/sphinx-contrib/confluencebuilder.git --user
Yngve Levinsen's avatar
Yngve Levinsen committed
variables:
  TWINE_REPOSITORY_URL: https://artifactory.esss.lu.se/artifactory/api/pypi/ics-pypi
stages:
    - test
    - deploy
style_check:
  stage: test
  image: registry.esss.lu.se/ics-docker/pre-commit
  script:
    - pre-commit run --all-files

examples:
  stage: test
Yngve Levinsen's avatar
Yngve Levinsen committed
  before_script:
    - *pip_install_default
  script:
Yngve Levinsen's avatar
Yngve Levinsen committed
    - python setup.py install
    - python tests.py -v

pages:
  stage: deploy
  before_script:
    - *pip_install_default
    - *pip_install_sphinx
    - python setup.py install
    - sphinx-build -b html -d public/doctrees   doc public
  artifacts:
    paths:
      - public
    - tags
confluence-doc:
  stage: deploy
  before_script:
    - *pip_install_default
    - *pip_install_sphinx
    - python setup.py install
    - sphinx-build -M confluence "doc" "doc"
  only:
    - tags

release-pypi:
  tags:
    - docker
  stage: deploy
  image: python:3.7
  before_script:
    - pip install twine
  script:
    - python setup.py check sdist bdist_wheel
    - twine upload dist/*
  only:
    - tags

auto-release:
    image: inetprocess/gitlab-release
    stage: deploy
    only:
        - tags
    script:
        - gitlab-release --message "Automatic release of ${CI_COMMIT_TAG} from ${CI_COMMIT_SHORT_SHA}<br>${CI_COMMIT_DESCRIPTION}"