-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
64 lines (63 loc) · 1.9 KB
/
bitbucket-pipelines.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# bitbucket-pipelines.yml - Bitbucket Pipelines configuration
# Copyright (C) 2016-2019 Kaz Nishimura
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
# See <https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html>
# for details.
---
definitions:
steps:
- step: &test
name: Test
caches:
- pip
script:
- pip install "setuptools>=38.6"
- python ./setup.py test
- step: &deploy-pypi
name: PyPI deployment
script:
- pipe: atlassian/pypi-publish:0.2.5
variables:
PYPI_USERNAME: $PYPI_USERNAME
PYPI_PASSWORD: $PYPI_PASSWORD
DISTRIBUTIONS: sdist bdist_wheel
- step: &deploy-testpypi
name: TestPyPI deployment
script:
- pipe: atlassian/pypi-publish:0.2.5
variables:
PYPI_USERNAME: $TESTPYPI_USERNAME
PYPI_PASSWORD: $TESTPYPI_PASSWORD
DISTRIBUTIONS: sdist bdist_wheel
REPOSITORY: https://test.pypi.org/legacy/
image: python:3
pipelines:
branches:
default:
- step: *test
bookmarks:
deployment/test:
- step:
<<: *deploy-testpypi
deployment: test
deployment/staging:
- step:
name: Version check
script:
- python ./setup.py --version | grep -v '\.dev[0-9]'
- step:
<<: *deploy-pypi
trigger: manual
deployment: staging
deployment/production:
- step:
name: Version check
script:
- python ./setup.py --version | grep -v '\.dev[0-9]'
- step:
<<: *deploy-pypi
trigger: manual
deployment: production