forked from PyLink/PyLink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.jsonnet
94 lines (91 loc) · 1.81 KB
/
.drone.jsonnet
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
local test(py_version) = {
"kind": "pipeline",
"type": "docker",
"name": "test-" + py_version,
"steps": [
{
"name": "test",
"image": "python:" + py_version,
"commands": [
"git submodule update --recursive --remote --init",
"pip install -r requirements-docker.txt",
"python3 setup.py install",
"python3 -m unittest discover test/ --verbose"
]
}
]
};
local build_docker(py_version) = {
"kind": "pipeline",
"type": "docker",
"name": "build_docker",
"steps": [
{
"name": "set Docker image tags",
"image": "bash",
"commands": [
"bash .drone-write-tags.sh $DRONE_TAG > .tags",
"# Will build the following tags:",
"cat .tags"
]
},
{
"name": "build Docker image",
"image": "plugins/docker",
"settings": {
"repo": "jlu5/pylink",
"username": {
"from_secret": "docker_user"
},
"password": {
"from_secret": "docker_token"
}
}
}
],
"trigger": {
"event": [
"push"
],
"branch": ["release"],
},
"depends_on": ["test-" + py_version]
};
local deploy_pypi(py_version) = {
"kind": "pipeline",
"type": "docker",
"name": "deploy_pypi",
"steps": [
{
"name": "pypi_publish",
"image": "plugins/pypi",
"settings": {
"username": "__token__",
"password": {
"from_secret": "pypi_token"
}
}
}
],
"trigger": {
"event": [
"tag"
],
"ref": {
"exclude": [
"refs/tags/*alpha*",
"refs/tags/*beta*",
"refs/tags/*dev*"
]
}
},
"depends_on": ["test-" + py_version]
};
[
test("3.7"),
test("3.8"),
test("3.9"),
test("3.10"),
deploy_pypi("3.10"),
build_docker("3.10"),
]