Skip to content

Commit 3b21d27

Browse files
author
rfaircloth-splunk
committed
Merge branch 'develop' of https://github.com/splunk/splunk-solutions-sdk-python into develop
2 parents 12470b2 + a72055c commit 3b21d27

File tree

8 files changed

+3388
-47
lines changed

8 files changed

+3388
-47
lines changed

.circleci/config.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,83 @@ version: 2.1
33
orbs:
44
python: circleci/python@0.2.1
55

6+
splunk-release:
7+
executors:
8+
python37:
9+
docker:
10+
- image: circleci/python:3.7
11+
commands:
12+
tag:
13+
parameters:
14+
gh_user:
15+
description: Git Hub username
16+
type: string
17+
gh_token:
18+
description: Git Hub token
19+
type: string
20+
tag_level:
21+
description: Tag level
22+
type: string
23+
steps:
24+
- run:
25+
name: TAG
26+
command: |
27+
git remote set-url origin https://<<parameters.gh_user>>:<<parameters.gh_token>>@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git
28+
./semtag <<parameters.tag_level>>
29+
merge-to-master:
30+
parameters:
31+
gh_user:
32+
description: Git Hub username
33+
type: string
34+
gh_token:
35+
description: Git Hub token
36+
type: string
37+
steps:
38+
- run:
39+
name: Merge
40+
command: |
41+
git remote set-url origin https://<<parameters.gh_user>>:<<parameters.gh_token>>@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git
42+
git config --global user.email "addonreleasesrv@splunk.com"
43+
git config --global user.name "Add on release service"
44+
git pull origin master
45+
git merge master -m "Merge from master"
46+
git checkout master
47+
git merge develop
48+
git push
49+
jobs:
50+
tag:
51+
parameters:
52+
gh_user:
53+
description: Git Hub username
54+
type: string
55+
gh_token:
56+
description: Git Hub token
57+
type: string
58+
tag_level:
59+
description: Tag level
60+
type: string
61+
executor: python37
62+
steps:
63+
- checkout
64+
- tag:
65+
tag_level: <<parameters.tag_level>>
66+
gh_user: <<parameters.gh_user>>
67+
gh_token: <<parameters.gh_token>>
68+
merge-to-master:
69+
executor: python37
70+
parameters:
71+
gh_user:
72+
description: Git Hub username
73+
type: string
74+
gh_token:
75+
description: Git Hub token
76+
type: string
77+
steps:
78+
- checkout
79+
- merge-to-master:
80+
gh_user: <<parameters.gh_user>>
81+
gh_token: <<parameters.gh_token>>
82+
683
executors:
784
linux:
885
machine:
@@ -119,6 +196,23 @@ jobs:
119196
- store_artifacts:
120197
path: htmlcov
121198

199+
publish-pypi:
200+
docker:
201+
- image: circleci/python:3.7
202+
steps:
203+
- setup_remote_docker:
204+
docker_layer_caching: true
205+
- attach_workspace:
206+
at: /tmp/workspace
207+
- checkout
208+
- run:
209+
name: "Publish on PyPI"
210+
command: |
211+
PATH=$PATH:/usr/local/go/bin
212+
pip install twine
213+
python setup.py sdist bdist_wheel
214+
twine upload dist/*
215+
122216
workflows:
123217
main:
124218
jobs:
@@ -127,9 +221,104 @@ workflows:
127221
parameters:
128222
os: [linux]
129223
python-version: ["2.7.17", "3.7.4"]
224+
filters:
225+
branches:
226+
only: /.*/
130227
- test-splunk:
131228
matrix:
132229
parameters:
133230
os: [linux]
134231
splunk-version: ["7.2", "7.3", "8.0"]
135232
python-version: ["2.7.17", "3.7.4"]
233+
filters:
234+
branches:
235+
only: /.*/
236+
- splunk-release/tag:
237+
name: tag-alpha
238+
tag_level: alpha
239+
gh_user: ${GH_USER}
240+
gh_token: ${GH_PAT}
241+
filters:
242+
branches:
243+
only: develop
244+
requires:
245+
- test-unit
246+
- approval-tag-beta:
247+
requires:
248+
- tag-alpha
249+
type: approval
250+
filters:
251+
branches:
252+
only: develop
253+
- splunk-release/tag:
254+
name: tag-beta
255+
tag_level: beta
256+
gh_user: ${GH_USER}
257+
gh_token: ${GH_PAT}
258+
requires:
259+
- approval-tag-beta
260+
- approval-merge-beta-to-master:
261+
requires:
262+
- tag-beta
263+
type: approval
264+
filters:
265+
branches:
266+
only: develop
267+
- splunk-release/merge-to-master:
268+
name: merge-beta-to-master
269+
gh_user: ${GH_USER}
270+
gh_token: ${GH_PAT}
271+
requires:
272+
- approval-merge-beta-to-master
273+
filters:
274+
branches:
275+
only: develop
276+
- splunk-release/tag:
277+
name: tag-candidate
278+
tag_level: candidate
279+
gh_user: ${GH_USER}
280+
gh_token: ${GH_PAT}
281+
filters:
282+
branches:
283+
only: master
284+
- approval-tag-final-major:
285+
type: approval
286+
requires:
287+
- tag-candidate
288+
- splunk-release/tag:
289+
name: tag-final-major
290+
tag_level: final -s major
291+
gh_user: ${GH_USER}
292+
gh_token: ${GH_PAT}
293+
requires:
294+
- approval-tag-final-major
295+
- approval-tag-final-minor:
296+
type: approval
297+
requires:
298+
- tag-candidate
299+
- splunk-release/tag:
300+
name: tag-final-minor
301+
tag_level: final -s minor
302+
gh_user: ${GH_USER}
303+
gh_token: ${GH_PAT}
304+
requires:
305+
- approval-tag-final-minor
306+
- approval-tag-final-patch:
307+
type: approval
308+
requires:
309+
- tag-candidate
310+
- splunk-release/tag:
311+
name: tag-final-patch
312+
tag_level: final -s patch
313+
gh_user: ${GH_USER}
314+
gh_token: ${GH_PAT}
315+
requires:
316+
- approval-tag-final-patch
317+
publish:
318+
jobs:
319+
- publish-pypi:
320+
filters:
321+
branches:
322+
ignore: /.*/
323+
tags:
324+
only: /^v\d*\.\d*\.\d*.*$/

0 commit comments

Comments
 (0)