-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconstrui.yml
142 lines (120 loc) · 3.22 KB
/
construi.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
image: python:2.7
default: test
environment:
- DOCKER_PUSH_NAME=lstephen/construi
- PIP_CONFIG_FILE=$PWD/pip.conf
volumes:
- $PWD/.local:/root/.local
targets:
set_version:
shell: /bin/bash -c
run:
- echo $(git describe --dirty --tags) > VERSION
- echo "__version__ = '$(cat VERSION)'" > construi/__version__.py
test:
before:
- mypy
- test_p27
- test_p35
- test_p37
- test_integration_p27
- test_integration_p35
- test_integration_p37
test_p27: &test_p
before:
- install
run: python setup.py test
test_p35:
<<: *test_p
image: python:3.5
test_p37:
<<: *test_p
image: python:3.7
test_integration_p27: &test_integration_p
before:
- set_version
volumes:
- /var/run/docker.sock:/var/run/docker.sock
shell: /bin/bash -c
run:
- pip install --user behave==1.2.6
- pip install . && /root/.local/bin/behave
test_integration_p35:
<<: *test_integration_p
image: python:3.5
test_integration_p37:
<<: *test_integration_p
image: python:3.7
install:
before:
- set_version
run:
- python setup.py install --user
package:
before:
- install
run:
- rm -rf dist
- python setup.py sdist
docker:
before:
- package
image: docker:17.07.0-ce
volumes:
- /var/run/docker.sock:/var/run/docker.sock
shell: /bin/sh -c
run: docker build -t $DOCKER_PUSH_NAME:$(cat VERSION) --build-arg construi_version=$(cat VERSION) .
release:
before:
- release-pypi
- release-docker
release-pypi:
before:
- package
environment:
- TWINE_USERNAME
- TWINE_PASSWORD
shell: /bin/bash -c
run: pip install twine && twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
release-docker:
before:
- docker
image: docker:17.07.0-ce
environment:
- DOCKER_PUSH_USERNAME
- DOCKER_PUSH_PASSWORD
volumes:
- /var/run/docker.sock:/var/run/docker.sock
shell: /bin/sh -c
run: "docker login -u $DOCKER_PUSH_USERNAME -p $DOCKER_PUSH_PASSWORD
&& docker tag $DOCKER_PUSH_NAME:$(cat VERSION) $DOCKER_PUSH_NAME:latest
&& docker push $DOCKER_PUSH_NAME:$(cat VERSION)
&& docker push $DOCKER_PUSH_NAME:latest"
requirements:
build:
dockerfile: Dockerfile.pip-compile
context: .construi
run: --output-file requirements.txt requirements.in
format:
build:
dockerfile: Dockerfile.format
context: .construi
run:
- autoflake -ri --remove-all-unused-imports setup.py construi/ test/ features/
- isort -rc setup.py construi/ test/ features/
- black -t py27 setup.py construi/ test/ features/
mypy:
build:
dockerfile: Dockerfile.mypy
context: .construi
run:
- --python-version 2.7 --strict --ignore-missing-imports construi/
- --python-version 3.4 --strict --ignore-missing-imports --no-warn-unused-ignores construi/
- --python-version 3.7 --strict --ignore-missing-imports --no-warn-unused-ignores construi/
site-serve:
build:
dockerfile: Dockerfile.gh-pages
context: .construi
ports:
- "4000:4000"
run: jekyll serve --source docs --host 0.0.0.0