.gitlab-ci.yml 1.74 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
before_script:
  - export PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/mvn

variables:
    PYPY_USERNAME: SECRET
    PYPY_TEST_PASSWORD: SECRET
    PYPY_LIVE_PASSWORD: SECRET


stages:
  - set-env
James Coyle's avatar
James Coyle committed
12
  - deploy
James Coyle's avatar
James Coyle committed
13
  - cleanup
James Coyle's avatar
James Coyle committed
14
  - db
Coyle's avatar
Coyle committed
15
  - github
16

17

James Coyle's avatar
James Coyle committed
18
set-pypirc:
19 20 21
  stage: set-env
  when: always
  script:
James Coyle's avatar
James Coyle committed
22
    - pip3 install crate
James Coyle's avatar
James Coyle committed
23
    - rm -rf ~/.pypirc
24 25 26 27 28 29
    - echo "[distutils]" >> ~/.pypirc
    - echo "index-servers=" >> ~/.pypirc
    - echo "    pypi" >> ~/.pypirc
    - echo "    pypitest" >> ~/.pypirc
    - echo "" >> ~/.pypirc
    - echo "[pypi]" >> ~/.pypirc
30 31
    - echo "username:$PYPI_USERNAME" >> ~/.pypirc
    - echo "password:$PYPI_LIVE_PASSWORD" >> ~/.pypirc
32 33
    - echo "" >> ~/.pypirc
    - echo "[pypitest]" >> ~/.pypirc
34 35 36
    - echo "repository:https://test.pypi.org/legacy/" >> ~/.pypirc
    - echo "username:$PYPI_USERNAME" >> ~/.pypirc
    - echo "password:$PYPI_TEST_PASSWORD" >> ~/.pypirc
37
    - chmod 600 ~/.pypirc
38 39 40
  tags:
    - storjapi

James Coyle's avatar
James Coyle committed
41

42
deploy-test:
James Coyle's avatar
James Coyle committed
43
  stage: deploy
44
  script:
James Coyle's avatar
James Coyle committed
45
    - python setup.py bdist_wheel --universal
46
    - twine upload --repository pypitest dist/*
47 48 49 50 51
  except:
    - master
  tags:
    - storjapi
  environment:
James Coyle's avatar
James Coyle committed
52
    name: test
53 54


James Coyle's avatar
James Coyle committed
55 56 57 58
deploy-production:
  stage: deploy
  script:
    - python setup.py bdist_wheel --universal
59
    - twine upload --repository pypi dist/*
James Coyle's avatar
James Coyle committed
60 61 62 63 64 65 66
  only:
    - master
  tags:
    - storjapi
  environment:
    name: production

67

James Coyle's avatar
James Coyle committed
68
cleanup_pypirc:
69 70 71
  stage: cleanup
  when: always
  script:
James Coyle's avatar
James Coyle committed
72
    - rm -rf ~/.pypirc
73 74
  tags:
    - storjapi
James Coyle's avatar
James Coyle committed
75 76 77 78 79 80 81 82 83

update_db:
  stage: db
  only:
    - master
  script:
    - python3 update-db.py
  tags:
    - storjapi
Coyle's avatar
Coyle committed
84 85 86 87 88 89 90 91 92 93

update_github:
  stage: github
  only:
    - master
  script:
    - git remote add github [email protected]:JAC2703/storjstatus-client.git
    - git push github master
  tags:
    - storjapi