Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 189 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,83 @@ version: 2.1
orbs:
python: circleci/python@0.2.1

splunk-release:
executors:
python37:
docker:
- image: circleci/python:3.7
commands:
tag:
parameters:
gh_user:
description: Git Hub username
type: string
gh_token:
description: Git Hub token
type: string
tag_level:
description: Tag level
type: string
steps:
- run:
name: TAG
command: |
git remote set-url origin https://<<parameters.gh_user>>:<<parameters.gh_token>>@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git
./semtag <<parameters.tag_level>>
merge-to-master:
parameters:
gh_user:
description: Git Hub username
type: string
gh_token:
description: Git Hub token
type: string
steps:
- run:
name: Merge
command: |
git remote set-url origin https://<<parameters.gh_user>>:<<parameters.gh_token>>@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git
git config --global user.email "addonreleasesrv@splunk.com"
git config --global user.name "Add on release service"
git pull origin master
git merge master -m "Merge from master"
git checkout master
git merge develop
git push
jobs:
tag:
parameters:
gh_user:
description: Git Hub username
type: string
gh_token:
description: Git Hub token
type: string
tag_level:
description: Tag level
type: string
executor: python37
steps:
- checkout
- tag:
tag_level: <<parameters.tag_level>>
gh_user: <<parameters.gh_user>>
gh_token: <<parameters.gh_token>>
merge-to-master:
executor: python37
parameters:
gh_user:
description: Git Hub username
type: string
gh_token:
description: Git Hub token
type: string
steps:
- checkout
- merge-to-master:
gh_user: <<parameters.gh_user>>
gh_token: <<parameters.gh_token>>

executors:
linux:
machine:
Expand Down Expand Up @@ -119,6 +196,23 @@ jobs:
- store_artifacts:
path: htmlcov

publish-pypi:
docker:
- image: circleci/python:3.7
steps:
- setup_remote_docker:
docker_layer_caching: true
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: "Publish on PyPI"
command: |
PATH=$PATH:/usr/local/go/bin
pip install twine
python setup.py sdist bdist_wheel
twine upload dist/*

workflows:
main:
jobs:
Expand All @@ -127,9 +221,104 @@ workflows:
parameters:
os: [linux]
python-version: ["2.7.17", "3.7.4"]
filters:
branches:
only: /.*/
- test-splunk:
matrix:
parameters:
os: [linux]
splunk-version: ["7.2", "7.3", "8.0"]
python-version: ["2.7.17", "3.7.4"]
filters:
branches:
only: /.*/
- splunk-release/tag:
name: tag-alpha
tag_level: alpha
gh_user: ${GH_USER}
gh_token: ${GH_PAT}
filters:
branches:
only: develop
requires:
- test-unit
- approval-tag-beta:
requires:
- tag-alpha
type: approval
filters:
branches:
only: develop
- splunk-release/tag:
name: tag-beta
tag_level: beta
gh_user: ${GH_USER}
gh_token: ${GH_PAT}
requires:
- approval-tag-beta
- approval-merge-beta-to-master:
requires:
- tag-beta
type: approval
filters:
branches:
only: develop
- splunk-release/merge-to-master:
name: merge-beta-to-master
gh_user: ${GH_USER}
gh_token: ${GH_PAT}
requires:
- approval-merge-beta-to-master
filters:
branches:
only: develop
- splunk-release/tag:
name: tag-candidate
tag_level: candidate
gh_user: ${GH_USER}
gh_token: ${GH_PAT}
filters:
branches:
only: master
- approval-tag-final-major:
type: approval
requires:
- tag-candidate
- splunk-release/tag:
name: tag-final-major
tag_level: final -s major
gh_user: ${GH_USER}
gh_token: ${GH_PAT}
requires:
- approval-tag-final-major
- approval-tag-final-minor:
type: approval
requires:
- tag-candidate
- splunk-release/tag:
name: tag-final-minor
tag_level: final -s minor
gh_user: ${GH_USER}
gh_token: ${GH_PAT}
requires:
- approval-tag-final-minor
- approval-tag-final-patch:
type: approval
requires:
- tag-candidate
- splunk-release/tag:
name: tag-final-patch
tag_level: final -s patch
gh_user: ${GH_USER}
gh_token: ${GH_PAT}
requires:
- approval-tag-final-patch
publish:
jobs:
- publish-pypi:
filters:
branches:
ignore: /.*/
tags:
only: /^v\d*\.\d*\.\d*.*$/
Loading