.gitlab-ci.yml 918 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
Run tests:
  stage: test
  image: python:3.7
  script:
    - python setup.py test

Build Docker image:
  stage: deploy
  only:
    changes:
      - Dockerfile
    refs:
      - tags
  image: docker:stable
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_DRIVER: overlay2
  before_script:
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
  script:
    - docker build -t $CI_REGISTRY_IMAGE:latest .
    - docker push $CI_REGISTRY_IMAGE:latest
  tags:
    - docker-privileged

Publish on PyPI:
  stage: deploy
  image: python:3.7
  only:
    - tags
  before_script:
    - pip install twine
    - python setup.py sdist bdist_wheel
  variables:
    TWINE_USERNAME: cbenz
    # TWINE_PASSWORD: # Secret variable, see project CI settings.
  script:
    - twine upload dist/*
  environment:
    name: PyPI
    url: https://pypi.org/project/validata-ui/$CI_COMMIT_TAG