Skip to content

Commit b8aefd6

Browse files
committed
Helpful instructions around docker usage
1 parent 7ff830d commit b8aefd6

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,23 @@ splunkrc:
5656
@echo "$(ATTN_COLOR)==> splunkrc $(NO_COLOR)"
5757
@echo "To make a .splunkrc:"
5858
@echo " [SPLUNK_INSTANCE_JSON] | python scripts/build-splunkrc.py ~/.splunkrc"
59+
60+
.PHONY: splunkrc_default
61+
splunkrc_default:
62+
@echo "$(ATTN_COLOR)==> splunkrc_default $(NO_COLOR)"
63+
@python scripts/build-splunkrc.py ~/.splunkrc
64+
65+
.PHONY: up
66+
up:
67+
@echo "$(ATTN_COLOR)==> up $(NO_COLOR)"
68+
@docker-compose up -d
69+
70+
.PHONY: wait_up
71+
wait_up:
72+
@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
74+
75+
.PHONY: down
76+
down:
77+
@echo "$(ATTN_COLOR)==> down $(NO_COLOR)"
78+
@docker-compose stop

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ The Splunk developer platform enables developers to take advantage of the same
2121
technology used by the Splunk product to build exciting new applications that
2222
are enabled by Splunk's unique capabilities.
2323

24-
2524
## Getting started with the Splunk SDK for Python
2625

2726
The Splunk SDK for Python contains library code and examples that show how to
@@ -45,7 +44,9 @@ The Splunk SDK for Python requires Python 2.7+, including Python 3. The Splunk S
4544
If you haven't already installed Splunk, download it
4645
[here](http://www.splunk.com/download). For more about installing and running
4746
Splunk and system requirements, see
48-
[Installing & Running Splunk](http://dev.splunk.com/view/SP-CAAADRV). The Splunk SDK for Python has been tested with Splunk Enterprise 7.0 and 7.2.
47+
[Installing & Running Splunk](http://dev.splunk.com/view/SP-CAAADRV). The Splunk SDK for Python has been tested with Splunk Enterprise 7.3 and 8.0.
48+
49+
You can also run `SPLUNK_VERSION=(VERSION) make up` to run a version of [Splunk from DockerHub](https://hub.docker.com/r/splunk/splunk/).
4950

5051
#### Splunk SDK for Python
5152
Get the Splunk SDK for Python; [download the SDK as a ZIP](http://dev.splunk.com/view/SP-CAAAEBB)
@@ -74,6 +75,17 @@ Alternatively, you can use **setup.py** on the sources you cloned from GitHub:
7475
However, it's not necessary to install the libraries to run the
7576
examples and unit tests from the SDK.
7677

78+
## Testing Quickstart
79+
80+
You'll need `docker` and `docker-compose` to get up and running using this method.
81+
82+
```
83+
SPLUNK_VERSION=8.0 make up
84+
make wait_up
85+
make splunkrc_default
86+
make test
87+
make down
88+
```
7789

7890
### Running the examples and unit tests
7991

scripts/build-splunkrc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
'host': 'localhost',
2626
'port': '8089',
2727
'username': 'admin',
28-
'password': 'changeme',
28+
'password': 'changed!',
2929
'scheme': 'https',
30-
'version': '6.3'
30+
'version': '8.0'
3131
}
3232

3333
DEFAULT_SPLUNKRC_PATH = os.path.join(str(Path.home()), '.splunkrc')

0 commit comments

Comments
 (0)