sta 0.0.1.1
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.
- data/README +16 -0
- data/bin/is +130 -0
- metadata +67 -0
data/README
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
"STA" means Sugar Tester Assistent.
|
2
|
+
|
3
|
+
This gem is only for Sugar Team Member to assistent their daily testing work.
|
4
|
+
|
5
|
+
1. Setup
|
6
|
+
Run `gem install sta` command in Ruby evironment.
|
7
|
+
|
8
|
+
2. Usage
|
9
|
+
a. command `is` is for 'install sugar'.
|
10
|
+
We need you input two paramaters to install your sugar instance automatically.
|
11
|
+
i. The version of sugar build.
|
12
|
+
ii. The falvor of sugar build.
|
13
|
+
|
14
|
+
3. Supported platform
|
15
|
+
We only support linux now.
|
16
|
+
We can run it on Mac, but the instance is Not installed untill you try to access the sugar instance.
|
data/bin/is
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
#
|
4
|
+
|
5
|
+
require 'fileutils'
|
6
|
+
|
7
|
+
|
8
|
+
class SugarPkg
|
9
|
+
def installSugar
|
10
|
+
getBuildNumber
|
11
|
+
getBuildFlavor
|
12
|
+
generatePkgName
|
13
|
+
removeFiles
|
14
|
+
downloadPkg
|
15
|
+
unzipPkg
|
16
|
+
mdfPermission
|
17
|
+
generateConfig
|
18
|
+
sendIstRequest
|
19
|
+
end
|
20
|
+
|
21
|
+
def generateConfig
|
22
|
+
siConfig = <<CONFIG
|
23
|
+
<?php
|
24
|
+
$sugar_config_si = array (
|
25
|
+
'setup_db_host_name' => 'localhost',
|
26
|
+
'setup_db_database_name' => 'sguarcrm#{@buildNumber.gsub(/\./,'')}#{@buildFlavor}',
|
27
|
+
'setup_db_drop_tables' => 0,
|
28
|
+
'setup_db_create_database' => 1,
|
29
|
+
'demoData' => 'yes',
|
30
|
+
'setup_site_admin_user_name' => 'admin',
|
31
|
+
'setup_site_admin_password' => 'asdf',
|
32
|
+
'setup_db_create_sugarsales_user' => 0,
|
33
|
+
'setup_db_admin_user_name' => 'root',
|
34
|
+
'setup_db_admin_user_password' => '',
|
35
|
+
'setup_db_sugarsales_user' => 'root',
|
36
|
+
'setup_db_sugarsales_password' => 'asdf',
|
37
|
+
'setup_db_type' => 'mysql',
|
38
|
+
'setup_site_url' => 'http://localhost/#{@fldName}',
|
39
|
+
'setup_system_name' => 'SugarCRM',
|
40
|
+
'default_currency_iso4217' => 'USD',
|
41
|
+
'default_currency_name' => 'US Dollars',
|
42
|
+
'default_currency_significant_digits' => '2',
|
43
|
+
'default_currency_symbol' => '$',
|
44
|
+
'default_date_format' => 'Y-m-d',
|
45
|
+
'default_time_format' => 'H:i',
|
46
|
+
'default_decimal_seperator' => '.',
|
47
|
+
'default_export_charset' => 'ISO-8859-1',
|
48
|
+
'default_language' => 'en_us',
|
49
|
+
'default_locale_name_format' => 's f l',
|
50
|
+
'default_number_grouping_seperator' => ',',
|
51
|
+
'export_delemiter' => ',',
|
52
|
+
);
|
53
|
+
?>
|
54
|
+
CONFIG
|
55
|
+
|
56
|
+
fd = File.new("#{@fldName}/config_si.php", "w+")
|
57
|
+
fd.write(siConfig)
|
58
|
+
fd.close()
|
59
|
+
end
|
60
|
+
|
61
|
+
def removeFiles
|
62
|
+
`rm -rf #{@pkgName}`
|
63
|
+
`rm -rf #{@fldName}`
|
64
|
+
end
|
65
|
+
|
66
|
+
def sendIstRequest
|
67
|
+
`firefox http://localhost/#{@fldName}`
|
68
|
+
end
|
69
|
+
|
70
|
+
def mdfPermission
|
71
|
+
`chmod -R 777 #{@fldName}`
|
72
|
+
end
|
73
|
+
|
74
|
+
def unzipPkg
|
75
|
+
`unzip #{@pkgName}`
|
76
|
+
end
|
77
|
+
|
78
|
+
def downloadPkg
|
79
|
+
`curl -O http://honey-b/builds/#{@buildNumber}/latest/#{@pkgName}`
|
80
|
+
end
|
81
|
+
|
82
|
+
def generatePkgName
|
83
|
+
@pkgName = "Sugar#{@buildFlavor}-#{@buildNumber}.zip"
|
84
|
+
@fldName = "Sugar#{@buildFlavor}-Full-#{@buildNumber}"
|
85
|
+
end
|
86
|
+
|
87
|
+
def getBuildFlavor
|
88
|
+
defaultBuildFlavor= "Ult"
|
89
|
+
|
90
|
+
pmt_msg =
|
91
|
+
"Which flavor do you want to install? (For example: #{defaultBuildFlavor})\nPlease ente your build number(Ult/Ent/Corp/Pro/CE):"
|
92
|
+
|
93
|
+
print pmt_msg
|
94
|
+
|
95
|
+
i = gets
|
96
|
+
|
97
|
+
if (i == "\n")
|
98
|
+
@buildFlavor= defaultBuildFlavor
|
99
|
+
else
|
100
|
+
@buildFlavor= i.gsub(/\n/,'')
|
101
|
+
end
|
102
|
+
|
103
|
+
print "#{@buildFlavor}\n"
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
def getBuildNumber
|
108
|
+
defaultBuildNumber = "6.4.0RC2"
|
109
|
+
|
110
|
+
pmt_msg =
|
111
|
+
"Which build do you want to install? (For example: #{defaultBuildNumber})\nPlease ente your build number:"
|
112
|
+
|
113
|
+
print pmt_msg
|
114
|
+
|
115
|
+
i = gets
|
116
|
+
|
117
|
+
if (i == "\n")
|
118
|
+
@buildNumber = defaultBuildNumber
|
119
|
+
else
|
120
|
+
@buildNumber = i.gsub(/\n/,'')
|
121
|
+
end
|
122
|
+
|
123
|
+
print "#{@buildNumber}\n"
|
124
|
+
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
sp = SugarPkg.new()
|
129
|
+
sp.installSugar
|
130
|
+
exit(0)
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sta
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 73
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
- 1
|
11
|
+
version: 0.0.1.1
|
12
|
+
platform: ruby
|
13
|
+
authors:
|
14
|
+
- Yunpeng Li
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2011-12-08 00:00:00 Z
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: STA can install Sugar instance, install Sugar portal, do silent upgrade, do silent convert, or download sugar packages. Only for Sugar team member.
|
23
|
+
email: rlee@sugarcrm.com
|
24
|
+
executables:
|
25
|
+
- is
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- bin/is
|
32
|
+
- README
|
33
|
+
homepage: https://github.com/RandyLee/Primitive
|
34
|
+
licenses: []
|
35
|
+
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 3
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
version: "0"
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
requirements: []
|
60
|
+
|
61
|
+
rubyforge_project:
|
62
|
+
rubygems_version: 1.8.12
|
63
|
+
signing_key:
|
64
|
+
specification_version: 3
|
65
|
+
summary: STA is Sugar Tester Assistent!
|
66
|
+
test_files: []
|
67
|
+
|