avst-wizard 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/avst-wizard.gemspec +1 -1
- data/bin/avst-wizard +2 -1
- data/config/hiera/confluence/5.7.4/default.yaml +59 -0
- data/config/hiera/jira/7.0.9/default.yaml +103 -0
- data/config/hiera/jira/default.yaml +4 -0
- data/lib/avst-wizard.rb +26 -6
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZWU2YzdhN2Y2NjE3MTlmZDI0NDJlZTVjZjk4YzQwNGJjNWQ2ZjFkOQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
ZmI4ZjA2ODcxMTNiYzk0NDg0NTM3YjNjNzEzYWZkZWVmOTg0NWZmNA==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ZTdiN2YzM2RmZjBhNTRlOWZjYjk2ZjQxMjlkY2Q4NjNiMTE1ZjFhNzdjNWZl
|
|
10
|
+
MmJmMTM5ZDhlZWFjZTdiNzkyODk0ZjkwNTkxYmZhOTk4ZWMxMDM1NWQ0ODA1
|
|
11
|
+
YTQxNDVhMzFiNjBlY2QxMmQ5OTI1NjVjYWIxMTllOGMyYzIwN2Q=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NmY3ZmFjMDU1NDIxOTQ2ZDA2NzEwMThhMDhlN2Y1NjU1Njg1NGFjMmYyMjQz
|
|
14
|
+
ZGU5MmI2ZmFkMTcwNGQzNGIwZTI0NWU3MGQyOTEzNWE1Y2ExZDFhZTdiZjk1
|
|
15
|
+
ZWFjM2JhZjgzY2I5ZDYyNTMyMWEyOGI2MzhjN2I3ZDdkMTI2NzY=
|
data/README.md
CHANGED
|
@@ -118,7 +118,7 @@ Tested with versions:
|
|
|
118
118
|
- crowd - 2.7.2, 2.6.4, 2.8.0, 2.8.3
|
|
119
119
|
- confl - 5.6.3, 5.2.5, 5.3.1, 5.8.10, 5.7.3
|
|
120
120
|
- bamboo - 5.7.1, 5.6.0, 5.9.4
|
|
121
|
-
- jira - 6.3.6, 6.2.7, 6.4.11
|
|
121
|
+
- jira - 6.3.6, 6.2.7, 6.4.11, 7.0.9, 7.1.7
|
|
122
122
|
- bitbucket - 2.0.3, 3.6.0, 4.0.0
|
|
123
123
|
|
|
124
124
|
## License
|
data/avst-wizard.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "avst-wizard"
|
|
7
|
-
spec.version = '0.0.
|
|
7
|
+
spec.version = '0.0.24'
|
|
8
8
|
spec.authors = ["Martin Brehovsky"]
|
|
9
9
|
spec.email = ["mbrehovsky@adaptavist.com"]
|
|
10
10
|
spec.summary = %q{Avstwizard}
|
data/bin/avst-wizard
CHANGED
|
@@ -134,7 +134,8 @@ unless base_url
|
|
|
134
134
|
abort("Please provide base_url and product_type options!!!").red
|
|
135
135
|
end
|
|
136
136
|
begin
|
|
137
|
-
|
|
137
|
+
url_required_part = conf.get_config("url_required_part", false)
|
|
138
|
+
runner = AvstWizard::AvstWizard.new(base_url, required_config, url_required_part)
|
|
138
139
|
|
|
139
140
|
|
|
140
141
|
# wait for app to start
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
required_config:
|
|
4
|
+
'/setup/setuplicense.action':
|
|
5
|
+
licenseString: "license"
|
|
6
|
+
'/setup/setupdbchoice-start.action':
|
|
7
|
+
dbConfigInfo.databaseUrl: "database_url"
|
|
8
|
+
dbConfigInfo.userName: "database_user"
|
|
9
|
+
dbConfigInfo.password: "database_pass"
|
|
10
|
+
'/setup/setupadministrator-start.action':
|
|
11
|
+
username: "admin_user"
|
|
12
|
+
fullName: "admin_full_name"
|
|
13
|
+
email: "admin_email"
|
|
14
|
+
password: "admin_pass"
|
|
15
|
+
|
|
16
|
+
stages:
|
|
17
|
+
'/setup/setupstart.action':
|
|
18
|
+
post_url: 'setup/dosetupstart.action'
|
|
19
|
+
values:
|
|
20
|
+
setupTypeCustom: "Next"
|
|
21
|
+
'/setup/setuplicense.action':
|
|
22
|
+
post_url: 'setup/dosetuplicense.action'
|
|
23
|
+
values:
|
|
24
|
+
licenseString: "%{license}"
|
|
25
|
+
setupTypeCustom: "Next"
|
|
26
|
+
'/setup/setupdbchoice-start.action':
|
|
27
|
+
post_url: 'setup/setupstandarddb.action'
|
|
28
|
+
values:
|
|
29
|
+
dbConfigInfo.driverClassName: "%{database_driver_class}" #"com.mysql.jdbc.Driver"
|
|
30
|
+
dbConfigInfo.databaseUrl: "%{database_url}"
|
|
31
|
+
dbConfigInfo.userName: "%{database_user}"
|
|
32
|
+
dbConfigInfo.password: "%{database_pass}"
|
|
33
|
+
database: "%{database_type}"
|
|
34
|
+
edit: "Next"
|
|
35
|
+
'/setup/setupdata-start.action':
|
|
36
|
+
post_url: 'setup/setupdata.action'
|
|
37
|
+
values:
|
|
38
|
+
dbchoiceSelect: "Empty+Site"
|
|
39
|
+
contentChoice: "blank"
|
|
40
|
+
'/setup/setupusermanagementchoice-start.action':
|
|
41
|
+
post_url: 'setup/setupusermanagementchoice.action'
|
|
42
|
+
values:
|
|
43
|
+
userManagementChoice: "internal"
|
|
44
|
+
internal: "Manage+users+and+groups+within+Confluence"
|
|
45
|
+
'/setup/setupadministrator-start.action':
|
|
46
|
+
post_url: 'setup/setupadministrator.action'
|
|
47
|
+
values:
|
|
48
|
+
username: "%{admin_user}"
|
|
49
|
+
fullName: "%{admin_full_name}"
|
|
50
|
+
email: "%{admin_email}"
|
|
51
|
+
password: "%{admin_pass}"
|
|
52
|
+
confirm: "%{admin_pass}"
|
|
53
|
+
edit: "Next"
|
|
54
|
+
'/setup/finishsetup.action':
|
|
55
|
+
final: true
|
|
56
|
+
'/dashboard.action':
|
|
57
|
+
final: true
|
|
58
|
+
'/login.action':
|
|
59
|
+
final: true
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
required_config:
|
|
4
|
+
'/secure/SetupLicense!default.jspa':
|
|
5
|
+
setupLicenseKey: "license"
|
|
6
|
+
'/secure/SetupApplicationProperties!default.jspa':
|
|
7
|
+
baseURL: "base_url" # "http://localhost"
|
|
8
|
+
title: "instance_name"
|
|
9
|
+
'/secure/SetupDatabase!default.jspa':
|
|
10
|
+
jdbcHostname: "database_url" #"localhost"
|
|
11
|
+
jdbcDatabase: "database_name"
|
|
12
|
+
jdbcUsername: "database_user"
|
|
13
|
+
jdbcPassword: "database_pass"
|
|
14
|
+
'/secure/SetupAdminAccount!default.jspa':
|
|
15
|
+
fullname: "admin_full_name"
|
|
16
|
+
email: "admin_email"
|
|
17
|
+
username: "admin_user"
|
|
18
|
+
password: "admin_pass"
|
|
19
|
+
confirm: "admin_pass"
|
|
20
|
+
|
|
21
|
+
optional_config:
|
|
22
|
+
analytics-enabled: "mail_analytics_enabled"
|
|
23
|
+
from: "mail_notification_from"
|
|
24
|
+
serverName: "mail_server_name"
|
|
25
|
+
port: "mail_server_port"
|
|
26
|
+
username: "mail_server_user"
|
|
27
|
+
password: "mail_server_pass"
|
|
28
|
+
|
|
29
|
+
stages:
|
|
30
|
+
'/secure/SetupMode!default.jspa':
|
|
31
|
+
post_url: 'secure/SetupMode.jspa'
|
|
32
|
+
values:
|
|
33
|
+
setupOption: "classic"
|
|
34
|
+
'/secure/SetupDatabase!default.jspa':
|
|
35
|
+
post_url: 'secure/SetupDatabase.jspa'
|
|
36
|
+
values:
|
|
37
|
+
databaseOption: "external"
|
|
38
|
+
databaseType: "%{database_type}" #"mysql/postgres72"
|
|
39
|
+
jdbcHostname: "%{database_url}" #"localhost"
|
|
40
|
+
jdbcPort: "%{database_port}" #"3306/5432"
|
|
41
|
+
jdbcDatabase: "%{database_name}"
|
|
42
|
+
jdbcSid: ""
|
|
43
|
+
jdbcUsername: "%{database_user}"
|
|
44
|
+
jdbcPassword: "%{database_pass}"
|
|
45
|
+
schemaName: "%{database_schema_name}" #""/public
|
|
46
|
+
testingConnection: "false"
|
|
47
|
+
'/secure/SetupApplicationProperties!default.jspa':
|
|
48
|
+
post_url: 'secure/SetupApplicationProperties.jspa'
|
|
49
|
+
values:
|
|
50
|
+
title: "%{instance_name}"
|
|
51
|
+
mode: "private"
|
|
52
|
+
baseURL: "%{base_url}"
|
|
53
|
+
nextStep: "true"
|
|
54
|
+
'/secure/SetupProductBundle!default.jspa':
|
|
55
|
+
post_url: 'secure/SetupProductBundle.jspa'
|
|
56
|
+
values:
|
|
57
|
+
selectedBundle: "TRACKING" # Choices: TRACKING, DEVELOPMENT, SERVICEDESK
|
|
58
|
+
'/secure/SetupLicense!default.jspa':
|
|
59
|
+
post_url: 'secure/SetupLicense.jspa'
|
|
60
|
+
values:
|
|
61
|
+
setupLicenseKey: "%{license}"
|
|
62
|
+
setupFirstName: ""
|
|
63
|
+
setupLastName: ""
|
|
64
|
+
setupEmail: ""
|
|
65
|
+
setupPluginLicenseKey: ""
|
|
66
|
+
'/secure/SetupAdminAccount!default.jspa':
|
|
67
|
+
complex: true
|
|
68
|
+
substages:
|
|
69
|
+
'action="SetupAdminAccount.jspa"':
|
|
70
|
+
post_url: 'secure/SetupAdminAccount.jspa'
|
|
71
|
+
values:
|
|
72
|
+
fullname: "%{admin_full_name}"
|
|
73
|
+
email: "%{admin_email}"
|
|
74
|
+
username: "%{admin_user}"
|
|
75
|
+
password: "%{admin_pass}"
|
|
76
|
+
confirm: "%{admin_pass}"
|
|
77
|
+
'action="SetupMailNotifications.jspa"':
|
|
78
|
+
post_url: 'secure/SetupMailNotifications.jspa'
|
|
79
|
+
values:
|
|
80
|
+
analytics-enabled: "%{mail_analytics_enabled}"
|
|
81
|
+
noemail: "true"
|
|
82
|
+
name: "Default+SMTP+Server"
|
|
83
|
+
from: "%{mail_notification_from}"
|
|
84
|
+
prefix: "[JIRA]"
|
|
85
|
+
mailservertype: "smtp"
|
|
86
|
+
serviceProvider: "custom"
|
|
87
|
+
serverName: "%{mail_server_name}"
|
|
88
|
+
protocol: "smtp"
|
|
89
|
+
port: "%{mail_server_port}"
|
|
90
|
+
timeout: "10000"
|
|
91
|
+
username: "%{mail_server_user}"
|
|
92
|
+
password: "%{mail_server_pass}"
|
|
93
|
+
jndiLocation: ""
|
|
94
|
+
type: "smtp"
|
|
95
|
+
testingMailConnection: "false"
|
|
96
|
+
'/secure/SetupProductBundleReport!default.jspa':
|
|
97
|
+
post_url: 'secure/SetupProductBundleReport.jspa'
|
|
98
|
+
'/secure/Dashboard.jspa?src=SetupComplete':
|
|
99
|
+
final: true
|
|
100
|
+
'/secure/WelcomeToJIRA.jspa':
|
|
101
|
+
final: true
|
|
102
|
+
'/secure/WelcomeToJIRASoftware.jspa':
|
|
103
|
+
final: true
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
|
|
3
|
+
# tested on Jira 7.1.7
|
|
4
|
+
|
|
3
5
|
required_config:
|
|
4
6
|
'/secure/SetupLicense!default.jspa':
|
|
5
7
|
setupLicenseKey: "license"
|
|
@@ -18,6 +20,8 @@ required_config:
|
|
|
18
20
|
password: "admin_pass"
|
|
19
21
|
confirm: "admin_pass"
|
|
20
22
|
|
|
23
|
+
url_required_part: 'secure'
|
|
24
|
+
|
|
21
25
|
optional_config:
|
|
22
26
|
analytics-enabled: "mail_analytics_enabled"
|
|
23
27
|
from: "mail_notification_from"
|
data/lib/avst-wizard.rb
CHANGED
|
@@ -24,12 +24,13 @@ module AvstWizard
|
|
|
24
24
|
|
|
25
25
|
attr_writer :atl_token
|
|
26
26
|
|
|
27
|
-
def initialize(url, required_config = {})
|
|
27
|
+
def initialize(url, required_config = {}, url_required_part=nil)
|
|
28
28
|
@url = url
|
|
29
29
|
@cookie = ""
|
|
30
30
|
@current_url = ""
|
|
31
31
|
@atl_token = ""
|
|
32
32
|
@required_config = required_config
|
|
33
|
+
@url_required_part = url_required_part
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
# Does GET requests to url, follows redirects, stores cookies and xsrf.token if present
|
|
@@ -50,7 +51,7 @@ module AvstWizard
|
|
|
50
51
|
if response['set-cookie']
|
|
51
52
|
@cookie = response['set-cookie'].split('; ')[0]
|
|
52
53
|
response['set-cookie'].split(';').each do |part|
|
|
53
|
-
if ((part.include? "atl.xsrf.token") and (part.match(/atl.xsrf.token=(.*)/)))
|
|
54
|
+
if ((part and part.include? "atl.xsrf.token") and (part.match(/atl.xsrf.token=(.*)/)))
|
|
54
55
|
# parse only the token
|
|
55
56
|
@atl_token = part.match(/atl.xsrf.token=(.*)/).captures[0]
|
|
56
57
|
break
|
|
@@ -59,14 +60,15 @@ module AvstWizard
|
|
|
59
60
|
puts "Found new cookie #{get_cookie}".yellow
|
|
60
61
|
end
|
|
61
62
|
if response['location']
|
|
62
|
-
|
|
63
|
+
redirection_url = compose_redirection_url(response['location'])
|
|
64
|
+
puts "Redirected to: #{redirection_url}".yellow
|
|
63
65
|
else
|
|
64
66
|
@current_url = url.request_uri
|
|
65
67
|
puts "Ended in: #{@current_url}".yellow
|
|
66
68
|
end
|
|
67
69
|
case response
|
|
68
70
|
when Net::HTTPSuccess then response.code.to_i
|
|
69
|
-
when Net::HTTPRedirection then get_stage_and_fetch_cookie(
|
|
71
|
+
when Net::HTTPRedirection then get_stage_and_fetch_cookie(redirection_url, limit - 1)
|
|
70
72
|
else
|
|
71
73
|
puts response.body
|
|
72
74
|
puts response.code.to_s
|
|
@@ -74,6 +76,23 @@ module AvstWizard
|
|
|
74
76
|
end
|
|
75
77
|
end
|
|
76
78
|
|
|
79
|
+
def compose_redirection_url(location)
|
|
80
|
+
# in case response['location'] is not full url we need to compose it
|
|
81
|
+
# if it does contain base_url we assume it is ok
|
|
82
|
+
if location.include? @url
|
|
83
|
+
location
|
|
84
|
+
else
|
|
85
|
+
# in Jira 7.1.7 location is databaseSetup.jspa not secure/databaseSetup.jspa
|
|
86
|
+
if @url_required_part and !location.include? "/#{@url_required_part}/"
|
|
87
|
+
"#{@url}/#{@url_required_part}/#{location}"
|
|
88
|
+
else
|
|
89
|
+
# if required url part is present prepend url
|
|
90
|
+
# TODO: better check with regexp
|
|
91
|
+
"#{@url}#{location}"
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
77
96
|
# add atl_token to cookie in case it is present
|
|
78
97
|
def get_cookie
|
|
79
98
|
resp = @cookie
|
|
@@ -165,8 +184,9 @@ module AvstWizard
|
|
|
165
184
|
puts "Current : #{@url}#{@current_url}".yellow
|
|
166
185
|
# puts "BODY: #{response.body}"
|
|
167
186
|
redirected = true
|
|
168
|
-
if response['location'] and
|
|
169
|
-
|
|
187
|
+
if response['location'] and !"#{@url}/#{@current_url}".include? response['location']
|
|
188
|
+
redirection_url = compose_redirection_url(response['location'])
|
|
189
|
+
@current_url = URI.parse(redirection_url).request_uri
|
|
170
190
|
else
|
|
171
191
|
puts "Was not redirected, staying on page...".yellow
|
|
172
192
|
redirected = false
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: avst-wizard
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.24
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Brehovsky
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -136,6 +136,7 @@ files:
|
|
|
136
136
|
- config/hiera/confluence/5.3.1/default.yaml
|
|
137
137
|
- config/hiera/confluence/5.6.3/default.yaml
|
|
138
138
|
- config/hiera/confluence/5.7.3/default.yaml
|
|
139
|
+
- config/hiera/confluence/5.7.4/default.yaml
|
|
139
140
|
- config/hiera/confluence/5.7/default.yaml
|
|
140
141
|
- config/hiera/confluence/default.yaml
|
|
141
142
|
- config/hiera/confluence/test.yaml
|
|
@@ -146,6 +147,7 @@ files:
|
|
|
146
147
|
- config/hiera/jira/6.2.7/default.yaml
|
|
147
148
|
- config/hiera/jira/6.3.12/default.yaml
|
|
148
149
|
- config/hiera/jira/6.3.6/default.yaml
|
|
150
|
+
- config/hiera/jira/7.0.9/default.yaml
|
|
149
151
|
- config/hiera/jira/default.yaml
|
|
150
152
|
- config/hiera/jira/test.yaml
|
|
151
153
|
- lib/advanced_hash.rb
|