Skip to content

Commit d60a22c

Browse files
committed
Merge branch 'master' of github.com:splunk/splunk-sdk-python into develop
2 parents 390d327 + d1553e5 commit d60a22c

File tree

3 files changed

+100
-2
lines changed

3 files changed

+100
-2
lines changed

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
workflow_dispatch: {}
7+
8+
jobs:
9+
find_version:
10+
name: Find Version
11+
runs-on: ubuntu-latest
12+
outputs:
13+
version: ${{ steps.get-version.outputs.version }}
14+
steps:
15+
- name: Checkout source
16+
uses: actions/checkout@v2.3.2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.7
21+
- name: Get version
22+
id: get-version
23+
run: python -c 'import splunklib; print("::set-output name=version::%s" % splunklib.__version__)'
24+
tag_version:
25+
needs: find_version
26+
name: Tag Version
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Create tag
30+
uses: tvdias/github-tagger@v0.0.2
31+
with:
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
tag: ${{ needs.find_version.outputs.version }}
34+
release:
35+
needs: [find_version, tag_version]
36+
name: Create Release
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v2.3.2
41+
- name: Create Release
42+
id: create_release
43+
uses: actions/create-release@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
tag_name: ${{ needs.find_version.outputs.version }}
48+
release_name: Release/${{ needs.find_version.outputs.version }}
49+
body: |
50+
## Version ${{ needs.find_version.outputs.version }}
51+
52+
**TODO: Insert CHANGELOG.md contents here.**
53+
draft: false
54+
prerelease: false
55+
publish:
56+
needs: release
57+
name: Deploy Release to PyPI
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Checkout source
61+
uses: actions/checkout@v2.3.2
62+
- name: Set up Python
63+
uses: actions/setup-python@v2
64+
with:
65+
python-version: 3.7
66+
- name: Install dependencies
67+
run: pip install twine
68+
- name: Build package
69+
run: python setup.py sdist
70+
- name: Publish package to PyPI
71+
uses: pypa/gh-action-pypi-publish@v1.3.1
72+
with:
73+
user: __token__
74+
password: ${{ secrets.pypi_password }}
75+
# Test upload
76+
# - name: Publish package to TestPyPI
77+
# uses: pypa/gh-action-pypi-publish@master
78+
# with:
79+
# user: __token__
80+
# password: ${{ secrets.test_pypi_password }}
81+
# repository_url: https://test.pypi.org/legacy/

Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ VERSION := `git describe --tags --dirty 2>/dev/null`
1515
COMMITHASH := `git rev-parse --short HEAD 2>/dev/null`
1616
DATE := `date "+%FT%T%z"`
1717

18+
CONTAINER_NAME := 'splunk'
19+
1820
.PHONY: all
1921
all: build_app test
2022

@@ -67,12 +69,26 @@ up:
6769
@echo "$(ATTN_COLOR)==> up $(NO_COLOR)"
6870
@docker-compose up -d
6971

72+
.PHONY: remove
73+
remove:
74+
@echo "$(ATTN_COLOR)==> rm $(NO_COLOR)"
75+
@docker-compose rm -f -s
76+
7077
.PHONY: wait_up
7178
wait_up:
7279
@echo "$(ATTN_COLOR)==> wait_up $(NO_COLOR)"
73-
@for i in `seq 0 180`; do if docker exec -it splunk /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done
80+
@for i in `seq 0 180`; do if docker exec -it $(CONTAINER_NAME) /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done
7481

7582
.PHONY: down
7683
down:
7784
@echo "$(ATTN_COLOR)==> down $(NO_COLOR)"
7885
@docker-compose stop
86+
87+
.PHONY: start
88+
start: up wait_up
89+
90+
.PHONY: restart
91+
restart: down start
92+
93+
.PHONY: refresh
94+
refresh: remove start

tests/test_app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def test_package(self):
9696
p = self.app.package()
9797
self.assertEqual(p.name, self.app_name)
9898
self.assertTrue(p.path.endswith(self.app_name + '.spl'))
99-
self.assertTrue(p.url.endswith(self.app_name + '.spl'))
99+
# Assert string due to deprecation of this property in new Splunk versions
100+
self.assertIsInstance(p.url, str)
100101

101102
def test_updateInfo(self):
102103
p = self.app.updateInfo()

0 commit comments

Comments
 (0)