-
Notifications
You must be signed in to change notification settings - Fork 43
/
config.yml
88 lines (78 loc) · 2.16 KB
/
config.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
version: 2
references:
container_python: &container_python
docker:
- image: circleci/python:3.7.7
working_dir: ~/project
restore_repo: &restore_repo
restore_cache:
keys:
- v1-repo-{{ .Branch }}-{{ .Revision }}
- v1-repo-{{ .Branch }}
- v1-repo
jobs:
checkout_code:
<<: *container_python
steps:
- *restore_repo
- checkout
- save_cache:
key: v1-repo-{{ .Branch }}-{{ .Revision }}
paths:
- ~/project
install_and_test:
<<: *container_python
steps:
- *restore_repo
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt"}}
- v1-dependencies
- run: |
python3 -m venv ~/venv
. ~/venv/bin/activate
pwd
pip install -r requirements.txt
pip install -r requirements-dev.txt
STAC_API_URL=https://earth-search.aws.element84.com/v0 pytest --cov satsearch test/
- save_cache:
key: v1-dependencies-{{ checksum "requirements.txt"}}
paths:
- ~/venv
deploy:
<<: *container_python
steps:
- *restore_repo
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt"}}
- v1-dependencies
- run:
name: Deploy
command: |
. ~/venv/bin/activate
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
pip install twine
python setup.py sdist
VERSION=`awk -F\' '{print $2,$4}' satsearch/version.py`
git tag $VERSION
git push origin $VERSION
twine upload --username "${PYPI_USER}" --password "${PYPI_PASS}" dist/*
workflows:
version: 2
build_test_deploy:
jobs:
- checkout_code
- install_and_test:
requires:
- checkout_code
- deploy:
requires:
- install_and_test
filters:
branches:
only: master