Project

General

Profile

Continuous Delivery and Testing » History » Version 10

Luke Murphey, 03/04/2017 08:01 PM

1 1 Luke Murphey
h1. Continuous Delivery and Testing
2 1 Luke Murphey
3 1 Luke Murphey
You can use a continuous integration tool to automate testing and deploying your Splunk apps. This will allow you to:
4 1 Luke Murphey
5 1 Luke Murphey
# Test your app on several platforms and versions of Splunk automatically (or with a click of a button)
6 1 Luke Murphey
# Easily build clean and consistent copies of your app (avoids the possible corrupt builds made on Developer hosts)
7 1 Luke Murphey
# Deploy the app to your test and production hosts with a single click
8 2 Luke Murphey
9 2 Luke Murphey
Some notes:
10 2 Luke Murphey
To use a created package (spl or tar.gz), make sure to:
11 2 Luke Murphey
12 2 Luke Murphey
* Make a fetch artifact step
13 2 Luke Murphey
* Set the fetch as a file, not a directory (https://groups.google.com/forum/#!searchin/go-cd/gocd$20fetch$20zip$20artifact$20%7Csort:relevance/go-cd/Ja5lBT6bpRA/A0ojaSRqBwAJ)
14 3 Luke Murphey
15 5 Luke Murphey
Need to create a minimal account for installing apps with the following capabilities per (https://answers.splunk.com/answers/67843/capability-to-install-app.html):
16 5 Luke Murphey
* rest_apps_management
17 5 Luke Murphey
* admin_all_objects
18 9 Luke Murphey
* restart_splunkd (to restart Splunk)
19 10 Luke Murphey
* web_debug (to bump Splunk)
20 5 Luke Murphey
21 7 Luke Murphey
You might need to add the user "go" to the "splunk" group:
22 7 Luke Murphey
23 7 Luke Murphey
<pre>
24 7 Luke Murphey
sudo usermod -G splunk go
25 7 Luke Murphey
</pre>
26 6 Luke Murphey
27 3 Luke Murphey
Should this be done using:
28 3 Luke Murphey
# The build script?
29 5 Luke Murphey
## Pros: Could hide password using secure variable; can be done in a single line; password can be globally in environment variables
30 5 Luke Murphey
## Cons: requires the build script as a material; requires ant on all agents
31 3 Luke Murphey
# Direct commands?
32 4 Luke Murphey
# Straight copying?
33 5 Luke Murphey
34 5 Luke Murphey
Using the build script:
35 5 Luke Murphey
Pros:
36 5 Luke Murphey
# Could hide password using secure variable
37 5 Luke Murphey
# Can be done in a single line
38 5 Luke Murphey
# Password can be globally in environment variables
39 5 Luke Murphey
# Could bump Splunk too
40 5 Luke Murphey
41 5 Luke Murphey
Cons:
42 5 Luke Murphey
# Requires downloading the build script as a material
43 5 Luke Murphey
# Requires ant on the agents