|
1 | 1 | kind: template |
2 | | -load: deploythatapp.jsonnet |
| 2 | +load: hostbutter.jsonnet |
3 | 3 | data: |
4 | | - projectName: ${DRONE_REPO} |
5 | | - gitSshKey: default |
6 | | - ciImageRegistry: "registry.lokalhost.net" |
7 | 4 | domains: >- |
8 | | - ["lokalhost.net", "fresh2.dev"] |
| 5 | + ["lokalhost.net"] |
9 | 6 | domainTriggers: >- |
10 | 7 | { |
11 | | - "lokalhost.net": { |
12 | | - "branch": ["main", "master"], |
13 | | - "event": ["push", "custom"] |
14 | | - }, |
15 | | - "fresh2.dev": { |
16 | | - "event": ["tag"] |
17 | | - } |
| 8 | + "lokalhost.net": {} |
18 | 9 | } |
19 | | - imageTags: "" |
20 | | - useDinD: false |
21 | | - publishDockerHub: false |
22 | | - deployStack: true |
23 | | - deployCommands: >- |
| 10 | + domainClusterMap: >- |
| 11 | + {} |
| 12 | + publishRegistries: >- |
24 | 13 | {} |
25 | 14 | secrets: >- |
26 | 15 | [] |
27 | 16 | secretFiles: >- |
28 | | - {} |
29 | | - volumes: >- |
30 | | - [] |
31 | | - domainVars: >- |
32 | 17 | { |
33 | | - "lokalhost.net": { |
34 | | - "PYPI_CREDS": {"from_secret": "lokalhost.net_pypi-creds"} |
35 | | - } |
| 18 | + "ENV_FILE": ".env" |
36 | 19 | } |
| 20 | + volumes: >- |
| 21 | + [] |
37 | 22 | beforeSteps: >- |
38 | 23 | [ |
39 | 24 | { |
40 | | - "name": "run-tests", |
41 | | - "image": "registry.lokalhost.net/python:3.9-buster", |
42 | | - "commands": ["make test", "make build-docs"], |
43 | | - "when": { |
44 | | - "event": ["push", "custom", "tag"] |
45 | | - } |
| 25 | + "name": "py-test", |
| 26 | + "image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3", |
| 27 | + "environment": { |
| 28 | + "PIP_CONF": {"from_secret": "PIP_CONF"}, |
| 29 | + "MYKE_MODULE": "mykefiles.python" |
| 30 | + }, |
| 31 | + "commands": [ |
| 32 | + "mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf", |
| 33 | + "myke py-install", |
| 34 | + "myke py-reports", |
| 35 | + "myke py-build" |
| 36 | + ], |
| 37 | + "when": {} |
46 | 38 | } |
47 | 39 | ] |
48 | 40 | afterSteps: >- |
| 41 | + [] |
| 42 | + finalSteps: >- |
49 | 43 | [ |
50 | 44 | { |
51 | | - "name": "publish-testpypi", |
52 | | - "image": "registry.lokalhost.net/python:3.9-buster", |
| 45 | + "name": "py-build-package", |
| 46 | + "image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3", |
| 47 | + "environment": { |
| 48 | + "PYPI_CREDS": {"from_secret": "PYPI_CREDS"}, |
| 49 | + "PIP_CONF": {"from_secret": "PIP_CONF"}, |
| 50 | + "MYKE_MODULE": "mykefiles.python" |
| 51 | + }, |
53 | 52 | "commands": [ |
54 | | - "echo -n \"$PYPI_CREDS\" > ~/.pypirc", |
55 | | - "make publish" |
| 53 | + "echo \"$PYPI_CREDS\" > ~/.pypirc", |
| 54 | + "mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf", |
| 55 | + "myke py-version-set --repository lokalhost", |
| 56 | + "myke py-build" |
| 57 | + ], |
| 58 | + "when": {} |
| 59 | + }, |
| 60 | + { |
| 61 | + "name": "py-publish-sandbox", |
| 62 | + "image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3", |
| 63 | + "environment": { |
| 64 | + "PYPI_CREDS": {"from_secret": "PYPI_CREDS"}, |
| 65 | + "PIP_CONF": {"from_secret": "PIP_CONF"}, |
| 66 | + "TWINE_CERT": "/etc/ssl/certs/ca-certificates.crt", |
| 67 | + "MYKE_MODULE": "mykefiles.python" |
| 68 | + }, |
| 69 | + "commands": [ |
| 70 | + "echo \"$PYPI_CREDS\" > ~/.pypirc", |
| 71 | + "mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf", |
| 72 | + "myke py-publish --repository lokalhost" |
| 73 | + ], |
| 74 | + "when": {} |
| 75 | + }, |
| 76 | + { |
| 77 | + "name": "py-publish-dev", |
| 78 | + "image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3", |
| 79 | + "environment": { |
| 80 | + "PYPI_CREDS": {"from_secret": "PYPI_CREDS"}, |
| 81 | + "PIP_CONF": {"from_secret": "PIP_CONF"}, |
| 82 | + "TWINE_CERT": "/etc/ssl/certs/ca-certificates.crt", |
| 83 | + "MYKE_MODULE": "mykefiles.python" |
| 84 | + }, |
| 85 | + "commands": [ |
| 86 | + "echo \"$PYPI_CREDS\" > ~/.pypirc", |
| 87 | + "mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf", |
| 88 | + "myke py-publish --repository codeberg" |
| 89 | + ], |
| 90 | + "when": { |
| 91 | + "ref": ["refs/heads/dev", "refs/heads/main", "refs/tags/*"] |
| 92 | + } |
| 93 | + }, |
| 94 | + { |
| 95 | + "name": "py-publish-test", |
| 96 | + "image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3", |
| 97 | + "environment": { |
| 98 | + "PYPI_CREDS": {"from_secret": "PYPI_CREDS"}, |
| 99 | + "PIP_CONF": {"from_secret": "PIP_CONF"}, |
| 100 | + "TWINE_CERT": "/etc/ssl/certs/ca-certificates.crt", |
| 101 | + "MYKE_MODULE": "mykefiles.python" |
| 102 | + }, |
| 103 | + "commands": [ |
| 104 | + "echo \"$PYPI_CREDS\" > ~/.pypirc", |
| 105 | + "mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf", |
| 106 | + "myke py-publish --repository testpypi" |
56 | 107 | ], |
57 | 108 | "when": { |
58 | | - "branch": ["main", "master"], |
59 | | - "event": ["push", "custom"] |
| 109 | + "ref": ["refs/tags/*"] |
60 | 110 | } |
61 | 111 | }, |
62 | 112 | { |
63 | | - "name": "publish-pypi", |
64 | | - "image": "registry.lokalhost.net/python:3.9-buster", |
| 113 | + "name": "py-publish-prod", |
| 114 | + "image": "registry.lokalhost.net/fresh2dev/mykefiles:5de40c3", |
| 115 | + "environment": { |
| 116 | + "PYPI_CREDS": {"from_secret": "PYPI_CREDS"}, |
| 117 | + "PIP_CONF": {"from_secret": "PIP_CONF"}, |
| 118 | + "TWINE_CERT": "/etc/ssl/certs/ca-certificates.crt", |
| 119 | + "MYKE_MODULE": "mykefiles.python" |
| 120 | + }, |
65 | 121 | "commands": [ |
66 | | - "echo -n \"$PYPI_CREDS\" > ~/.pypirc", |
67 | | - "VERSION=${DRONE_TAG} make publish-prod" |
| 122 | + "echo \"$PYPI_CREDS\" > ~/.pypirc", |
| 123 | + "mkdir -p ~/.config/pip && echo \"$PIP_CONF\" > ~/.config/pip/pip.conf", |
| 124 | + "myke py-publish --repository pypi" |
68 | 125 | ], |
69 | 126 | "when": { |
70 | | - "event": ["tag"] |
| 127 | + "ref": ["refs/tags/*"] |
71 | 128 | } |
72 | 129 | } |
73 | 130 | ] |
74 | 131 | extraObjects: >- |
75 | | - [] |
| 132 | + [ |
| 133 | + { |
| 134 | + "kind": "secret", |
| 135 | + "name": "PYPI_CREDS", |
| 136 | + "get": { |
| 137 | + "path": "secret/data/hostbutter/global", |
| 138 | + "name": "PYPI_CREDS" |
| 139 | + } |
| 140 | + }, |
| 141 | + { |
| 142 | + "kind": "secret", |
| 143 | + "name": "PIP_CONF", |
| 144 | + "get": { |
| 145 | + "path": "secret/data/hostbutter/global", |
| 146 | + "name": "PIP_CONF" |
| 147 | + } |
| 148 | + } |
| 149 | + ] |
0 commit comments