vagrant-ec-sandbox 0.1.0.Preview
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 +7 -0
- data/lib/vagrant-ec-sandbox/action/base.rb +53 -0
- data/lib/vagrant-ec-sandbox/action/check_dir.rb +41 -0
- data/lib/vagrant-ec-sandbox/action/check_file.rb +41 -0
- data/lib/vagrant-ec-sandbox/action/code/install.rb +0 -0
- data/lib/vagrant-ec-sandbox/action/code/prepare_dist.rb +37 -0
- data/lib/vagrant-ec-sandbox/action/code/remove.rb +0 -0
- data/lib/vagrant-ec-sandbox/action/code.rb +15 -0
- data/lib/vagrant-ec-sandbox/action/dist/check_artifact.rb +26 -0
- data/lib/vagrant-ec-sandbox/action/dist/check_wildfly_installer.rb +28 -0
- data/lib/vagrant-ec-sandbox/action/dist/clear_contents.rb +34 -0
- data/lib/vagrant-ec-sandbox/action/dist/config_ec.rb +92 -0
- data/lib/vagrant-ec-sandbox/action/dist/deploy_ecapp.rb +44 -0
- data/lib/vagrant-ec-sandbox/action/dist/get_vbuild.rb +39 -0
- data/lib/vagrant-ec-sandbox/action/dist/get_vnexus.rb +65 -0
- data/lib/vagrant-ec-sandbox/action/dist/install_wildfly.rb +40 -0
- data/lib/vagrant-ec-sandbox/action/dist/make_contents.rb +36 -0
- data/lib/vagrant-ec-sandbox/action/dist.rb +44 -0
- data/lib/vagrant-ec-sandbox/action/init/env_config_confirm.rb +18 -0
- data/lib/vagrant-ec-sandbox/action/init/init_dir.rb +31 -0
- data/lib/vagrant-ec-sandbox/action/init/init_vagrant.rb +67 -0
- data/lib/vagrant-ec-sandbox/action/init.rb +11 -0
- data/lib/vagrant-ec-sandbox/action/select_db.rb +51 -0
- data/lib/vagrant-ec-sandbox/action/up_vagrant.rb +23 -0
- data/lib/vagrant-ec-sandbox/action/use_app_server.rb +27 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/get_isinstalled.rb +50 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/redirect_dirs.rb +56 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/reload.rb +45 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/reload_admin.rb +38 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/remove.rb +32 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/start.rb +42 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/start_admin.rb +36 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/status.rb +36 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/stop.rb +42 -0
- data/lib/vagrant-ec-sandbox/action/wildfly/switch_db.rb +48 -0
- data/lib/vagrant-ec-sandbox/action/wildfly.rb +79 -0
- data/lib/vagrant-ec-sandbox/action.rb +129 -0
- data/lib/vagrant-ec-sandbox/command/as/config_db.rb +34 -0
- data/lib/vagrant-ec-sandbox/command/as/install.rb +34 -0
- data/lib/vagrant-ec-sandbox/command/as/restart.rb +33 -0
- data/lib/vagrant-ec-sandbox/command/as/show_status.rb +32 -0
- data/lib/vagrant-ec-sandbox/command/as/start.rb +33 -0
- data/lib/vagrant-ec-sandbox/command/as/stop.rb +32 -0
- data/lib/vagrant-ec-sandbox/command/as/test.rb +32 -0
- data/lib/vagrant-ec-sandbox/command/base.rb +52 -0
- data/lib/vagrant-ec-sandbox/command/init.rb +29 -0
- data/lib/vagrant-ec-sandbox/command/root.rb +101 -0
- data/lib/vagrant-ec-sandbox/communicator_extender.rb +45 -0
- data/lib/vagrant-ec-sandbox/config/sandbox_config.rb +235 -0
- data/lib/vagrant-ec-sandbox/db_selector/db_info.rb +8 -0
- data/lib/vagrant-ec-sandbox/db_selector/db_selector.rb +20 -0
- data/lib/vagrant-ec-sandbox/db_selector/direct_selector.rb +30 -0
- data/lib/vagrant-ec-sandbox/db_selector/direct_selector_config.rb +37 -0
- data/lib/vagrant-ec-sandbox/db_selector/manual_input_selector.rb +32 -0
- data/lib/vagrant-ec-sandbox/db_selector/oracle_db_info.rb +19 -0
- data/lib/vagrant-ec-sandbox/db_selector/selector_config.rb +22 -0
- data/lib/vagrant-ec-sandbox/dir_structure.rb +306 -0
- data/lib/vagrant-ec-sandbox/errors.rb +33 -0
- data/lib/vagrant-ec-sandbox/helpers.rb +11 -0
- data/lib/vagrant-ec-sandbox/plugin.rb +29 -0
- data/lib/vagrant-ec-sandbox/resource/hg_clone_provider.rb +46 -0
- data/lib/vagrant-ec-sandbox/resource/hg_clone_provider_config.rb +29 -0
- data/lib/vagrant-ec-sandbox/resource/local_provider.rb +19 -0
- data/lib/vagrant-ec-sandbox/resource/local_provider_config.rb +20 -0
- data/lib/vagrant-ec-sandbox/resource/maven_provider.rb +51 -0
- data/lib/vagrant-ec-sandbox/resource/maven_provider_config.rb +20 -0
- data/lib/vagrant-ec-sandbox/resource/provider_config.rb +10 -0
- data/lib/vagrant-ec-sandbox/resource/resource_provider.rb +20 -0
- data/lib/vagrant-ec-sandbox/server/app_server/as.rb +18 -0
- data/lib/vagrant-ec-sandbox/server/app_server/as_config.rb +38 -0
- data/lib/vagrant-ec-sandbox/server/server.rb +18 -0
- data/lib/vagrant-ec-sandbox/session.rb +146 -0
- data/lib/vagrant-ec-sandbox/util/host/dir_util.rb +39 -0
- data/lib/vagrant-ec-sandbox/util/host/file_util.rb +67 -0
- data/lib/vagrant-ec-sandbox/util/host/hg_clone.rb +32 -0
- data/lib/vagrant-ec-sandbox/util/host/mvn.rb +54 -0
- data/lib/vagrant-ec-sandbox/util/name.rb +22 -0
- data/lib/vagrant-ec-sandbox/util/output_buffer.rb +58 -0
- data/lib/vagrant-ec-sandbox/util/sandbox/get_user_processes.rb +85 -0
- data/lib/vagrant-ec-sandbox/util/sandbox/system_command.rb +91 -0
- data/lib/vagrant-ec-sandbox/util/sandbox/wildfly/add-user.rb +48 -0
- data/lib/vagrant-ec-sandbox/util/sandbox/wildfly/deploy.rb +34 -0
- data/lib/vagrant-ec-sandbox/util/sandbox/wildfly/response.rb +32 -0
- data/lib/vagrant-ec-sandbox/util/sandbox/wildfly/run_cli.rb +86 -0
- data/lib/vagrant-ec-sandbox/version.rb +5 -0
- data/lib/vagrant-ec-sandbox.rb +113 -0
- data/templates/action/dist/install_wildfly.sh.erb +23 -0
- data/templates/action/hello.sh.erb +1 -0
- data/templates/action/init/Vagrantfile.erb +91 -0
- data/templates/action/init/provision.sh.erb +71 -0
- data/templates/action/init/resources/settings.xml.erb +118 -0
- data/templates/action/wildfly/config_ec.sh.erb +5 -0
- data/templates/action/wildfly/deloy.cli.erb +0 -0
- data/templates/action/wildfly/open_interface.cli.erb +3 -0
- data/templates/action/wildfly/redirect_log.cli.erb +3 -0
- data/templates/action/wildfly/switch_db.cli.erb +43 -0
- data/templates/locales/en.yml +35 -0
- metadata +168 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
require "log4r"
|
2
|
+
require "vagrant/plugin/manager"
|
3
|
+
require "vagrant/util/platform"
|
4
|
+
|
5
|
+
|
6
|
+
module VagrantPlugins
|
7
|
+
module ECSandbox
|
8
|
+
module Util
|
9
|
+
module Sandbox
|
10
|
+
module Wildfly
|
11
|
+
class Response
|
12
|
+
attr_reader :outcome
|
13
|
+
attr_reader :response_headers
|
14
|
+
attr_reader :result
|
15
|
+
attr_reader :server
|
16
|
+
attr_reader :outcome
|
17
|
+
attr_reader :outcome
|
18
|
+
attr_reader :outcome
|
19
|
+
attr_reader :outcome
|
20
|
+
|
21
|
+
def initialize
|
22
|
+
outcome = :success | :failed
|
23
|
+
response_headers = {}
|
24
|
+
result = {}
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require "log4r"
|
2
|
+
require "vagrant/plugin/manager"
|
3
|
+
require "vagrant/util/platform"
|
4
|
+
require_relative "../system_command"
|
5
|
+
|
6
|
+
|
7
|
+
module VagrantPlugins
|
8
|
+
module ECSandbox
|
9
|
+
module Util
|
10
|
+
module Sandbox
|
11
|
+
module Wildfly
|
12
|
+
class RunCli < VagrantPlugins::ECSandbox::Util::Sandbox::SystemCommand
|
13
|
+
def self.execute(env, command, properties, opts=nil)
|
14
|
+
new_opts = {
|
15
|
+
file_name_base:nil,
|
16
|
+
controller:nil,
|
17
|
+
controller_port:nil
|
18
|
+
}.merge(opts || {})
|
19
|
+
|
20
|
+
file_name_base = new_opts[:file_name_base] || 'wildfly_cmd.cli'
|
21
|
+
file_name_base << '.cli' unless File.extname(file_name_base)
|
22
|
+
session = env[:sandbox_session]
|
23
|
+
|
24
|
+
session.dir_structures[:sandbox].using(command,
|
25
|
+
communicator:env[:machine].communicate,
|
26
|
+
file_name_base:file_name_base,
|
27
|
+
use_unit_line_ending:true,
|
28
|
+
host_dir_structure:session.dir_structures[:host]) do |command_file|
|
29
|
+
execute_file(env, command_file, properties, opts)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.execute_file(env, command_file, properties, opts=nil)
|
35
|
+
new_opts = {
|
36
|
+
controller:nil,
|
37
|
+
controller_port:nil
|
38
|
+
}.merge(opts || {})
|
39
|
+
|
40
|
+
file_name = File.basename(command_file) || command_file << '.properties'
|
41
|
+
session = env[:sandbox_session]
|
42
|
+
|
43
|
+
if properties
|
44
|
+
session.dir_structures[:sandbox].using(properties,
|
45
|
+
file_name_base:file_name,
|
46
|
+
use_unit_line_ending:true,
|
47
|
+
host_dir_structure:session.dir_structures[:host]) do |properties_file|
|
48
|
+
new(session.dir_structures, command_file, properties_file,
|
49
|
+
controller: new_opts[:controller],
|
50
|
+
controller_port: new_opts[:controller_port]).execute(env)
|
51
|
+
end
|
52
|
+
else
|
53
|
+
new(session.dir_structures, command_file, nil,
|
54
|
+
controller: new_opts[:controller],
|
55
|
+
controller_port: new_opts[:controller_port]).execute(env)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def initialize(dir_structures, command_file, properties_file, opts=nil)
|
60
|
+
new_opts = opts || {}
|
61
|
+
|
62
|
+
@connect = new_opts[:connect] || true
|
63
|
+
@controller = new_opts[:controller] || 'localhost'
|
64
|
+
@controller_port = new_opts[:controller_port] || '9990'
|
65
|
+
@command_file = command_file
|
66
|
+
@properties_file = properties_file
|
67
|
+
@cli_bin = dir_structures[:sandbox].internal(:app, :as, "wildfly-8.1.0.Final", "bin", "jboss-cli.sh")
|
68
|
+
|
69
|
+
connect_str = @connect ? '--connect' : ''
|
70
|
+
|
71
|
+
if @properties_file
|
72
|
+
super("sudo -u wildfly #{@cli_bin} --controller=#{@controller}:#{@controller_port} #{connect_str} --file=#{@command_file} --properties=#{@properties_file}", {good_exit: [0]})
|
73
|
+
else
|
74
|
+
super("sudo -u wildfly #{@cli_bin} --controller=#{@controller}:#{@controller_port} #{connect_str} --file=#{@command_file}", {good_exit: [0]})
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def on_line(type, line)
|
79
|
+
# TODO: change to return hashes
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
begin
|
2
|
+
require "vagrant"
|
3
|
+
rescue LoadError
|
4
|
+
raise "The Vagrant Hello plugin must be run within Vagrant."
|
5
|
+
end
|
6
|
+
|
7
|
+
|
8
|
+
# This is a sanity check to make sure no one is attempting to install
|
9
|
+
# this into an early Vagrant version.
|
10
|
+
if Vagrant::VERSION < "1.2.0"
|
11
|
+
raise "The Vagrant Hello plugin is only compatible with Vagrant 1.2+"
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'vagrant-ec-sandbox/version'
|
15
|
+
require 'vagrant-ec-sandbox/plugin'
|
16
|
+
require 'vagrant-ec-sandbox/helpers'
|
17
|
+
require_relative 'vagrant-ec-sandbox/resource/local_provider'
|
18
|
+
require_relative 'vagrant-ec-sandbox/resource/local_provider_config'
|
19
|
+
require_relative 'vagrant-ec-sandbox/resource/maven_provider'
|
20
|
+
require_relative 'vagrant-ec-sandbox/resource/maven_provider_config'
|
21
|
+
require_relative 'vagrant-ec-sandbox/resource/hg_clone_provider'
|
22
|
+
require_relative 'vagrant-ec-sandbox/resource/hg_clone_provider_config'
|
23
|
+
require_relative 'vagrant-ec-sandbox/server/app_server/as'
|
24
|
+
require_relative 'vagrant-ec-sandbox/server/app_server/as_config'
|
25
|
+
require_relative 'vagrant-ec-sandbox/db_selector/direct_selector'
|
26
|
+
require_relative 'vagrant-ec-sandbox/db_selector/direct_selector_config'
|
27
|
+
require_relative 'vagrant-ec-sandbox/db_selector/manual_input_selector'
|
28
|
+
|
29
|
+
|
30
|
+
module VagrantPlugins
|
31
|
+
module ECSandbox
|
32
|
+
def self.logger(class_name)
|
33
|
+
Log4r::Logger.new("vagrantplugins::ecsandbox::#{class_name}")
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.init!
|
37
|
+
return if defined?(@_init)
|
38
|
+
|
39
|
+
@__resource_provider_defs = {}
|
40
|
+
@__resource_provider_configs = {}
|
41
|
+
@__server_configs = {}
|
42
|
+
@__server_defs = {}
|
43
|
+
@__db_selector_defs = {}
|
44
|
+
@__db_selector_configs = {}
|
45
|
+
|
46
|
+
|
47
|
+
@__resource_provider_defs[VagrantPlugins::ECSandbox::Resource::LocalProvider.name.to_sym] =
|
48
|
+
VagrantPlugins::ECSandbox::Resource::LocalProvider
|
49
|
+
@__resource_provider_configs[VagrantPlugins::ECSandbox::Resource::LocalProvider.name.to_sym] =
|
50
|
+
VagrantPlugins::ECSandbox::Resource::LocalProviderConfig
|
51
|
+
|
52
|
+
|
53
|
+
@__resource_provider_defs[VagrantPlugins::ECSandbox::Resource::MavenProvider.name.to_sym] =
|
54
|
+
VagrantPlugins::ECSandbox::Resource::MavenProvider
|
55
|
+
@__resource_provider_configs[VagrantPlugins::ECSandbox::Resource::MavenProvider.name.to_sym] =
|
56
|
+
VagrantPlugins::ECSandbox::Resource::MavenProviderConfig
|
57
|
+
|
58
|
+
@__resource_provider_defs[VagrantPlugins::ECSandbox::Resource::HgCloneProvider.name.to_sym] =
|
59
|
+
VagrantPlugins::ECSandbox::Resource::HgCloneProvider
|
60
|
+
@__resource_provider_configs[VagrantPlugins::ECSandbox::Resource::HgCloneProvider.name.to_sym] =
|
61
|
+
VagrantPlugins::ECSandbox::Resource::HgCloneProviderConfig
|
62
|
+
|
63
|
+
|
64
|
+
@__server_defs[VagrantPlugins::ECSandbox::Server::AppServer::AS.name.to_sym] =
|
65
|
+
VagrantPlugins::ECSandbox::Server::AppServer::AS
|
66
|
+
@__server_configs[VagrantPlugins::ECSandbox::Server::AppServer::AS.name.to_sym] =
|
67
|
+
VagrantPlugins::ECSandbox::Server::AppServer::ASConfig
|
68
|
+
|
69
|
+
|
70
|
+
@__db_selector_defs[VagrantPlugins::ECSandbox::DBSelector::DirectSelector.name.to_sym] =
|
71
|
+
VagrantPlugins::ECSandbox::DBSelector::DirectSelector
|
72
|
+
@__db_selector_configs[VagrantPlugins::ECSandbox::DBSelector::DirectSelector.name.to_sym] =
|
73
|
+
VagrantPlugins::ECSandbox::DBSelector::DirectSelectorConfig
|
74
|
+
|
75
|
+
|
76
|
+
@__db_selector_defs[VagrantPlugins::ECSandbox::DBSelector::ManualInputSelector.name.to_sym] =
|
77
|
+
VagrantPlugins::ECSandbox::DBSelector::ManualInputSelector
|
78
|
+
|
79
|
+
|
80
|
+
@_init = true
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.server_defs
|
84
|
+
init!
|
85
|
+
return @__server_defs
|
86
|
+
end
|
87
|
+
|
88
|
+
def self.db_selector_defs
|
89
|
+
init!
|
90
|
+
return @__db_selector_defs
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.resource_provider_defs
|
94
|
+
init!
|
95
|
+
return @__resource_provider_defs
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.server_configs
|
99
|
+
init!
|
100
|
+
return @__server_configs
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.db_selector_configs
|
104
|
+
init!
|
105
|
+
return @__db_selector_configs
|
106
|
+
end
|
107
|
+
|
108
|
+
def self.resource_provider_configs
|
109
|
+
init!
|
110
|
+
return @__resource_provider_configs
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
wildfly_unzip_dir=<%= app_dir %>/wildfly-8.1.0.Final
|
2
|
+
|
3
|
+
if [ -d <%= app_dir %> ]
|
4
|
+
then
|
5
|
+
(cd <%= app_dir %> && rm -r *)
|
6
|
+
fi
|
7
|
+
|
8
|
+
mkdir --parents <%= app_dir %>
|
9
|
+
|
10
|
+
unzip <%= wildfly_dist %> -d <%= app_dir %>
|
11
|
+
export JBOSS_HOME=$wildfly_unzip_dir
|
12
|
+
|
13
|
+
if ! id -u "wildfly" >/dev/null 2>&1; then
|
14
|
+
sudo adduser --system --group --no-create-home --home $wildfly_unzip_dir --disabled-login wildfly
|
15
|
+
fi
|
16
|
+
|
17
|
+
# for some reasons, the CLI tool cannot create folders/files
|
18
|
+
# create them with installation as quick fix
|
19
|
+
mkdir -p $wildfly_unzip_dir/domain/configuration/domain_xml_history/snapshot
|
20
|
+
mkdir -p $wildfly_unzip_dir/wildfly-8.1.0.Final/
|
21
|
+
touch $wildfly_unzip_dir/wildfly-8.1.0.Final/.jboss-cli-history
|
22
|
+
|
23
|
+
sudo chown -R wildfly $wildfly_unzip_dir
|
@@ -0,0 +1 @@
|
|
1
|
+
echo "Hello From Sandbox!"
|
@@ -0,0 +1,91 @@
|
|
1
|
+
<% host_dir = session.dir_structures[:host] %>
|
2
|
+
<% sandbox_dir = session.dir_structures[:sandbox] %>
|
3
|
+
Vagrant.configure(2) do |config|
|
4
|
+
|
5
|
+
config.vm.box = "<%= box %>"
|
6
|
+
|
7
|
+
config.vm.provider "virtualbox" do |v|
|
8
|
+
v.memory = <%= memory %>
|
9
|
+
v.cpus = <%= cpus %>
|
10
|
+
end
|
11
|
+
|
12
|
+
config.vm.provision "shell", path: "<%= host_dir.provision_script %>"
|
13
|
+
|
14
|
+
config.vm.network "forwarded_port", guest: 8080, host: <%= as_http_port || 8080 %>
|
15
|
+
config.vm.network "forwarded_port", guest: 9990, host: <%= as_management_port || 9990 %>
|
16
|
+
config.vm.network "forwarded_port", guest: 18080, host: <%= as_bpm_port || 18080 %>
|
17
|
+
|
18
|
+
config.vm.synced_folder "<%= host_dir.resource %>", "<%= sandbox_dir.resource %>", create:true
|
19
|
+
config.vm.synced_folder "<%= host_dir.status %>", "<%= sandbox_dir.status %>", create:true
|
20
|
+
|
21
|
+
##
|
22
|
+
## Server configuration
|
23
|
+
config.ec.server "app_server" do |as|
|
24
|
+
as.smtp_host = nil
|
25
|
+
as.smtp_port = nil
|
26
|
+
as.datasrc_pw_encryption = false
|
27
|
+
as.developer_mode = true
|
28
|
+
|
29
|
+
# Un-comment following to support old EC server groups
|
30
|
+
# as.wildfly_servers = ['ec-server-a1']
|
31
|
+
# as.wildfly_server_group = 'ec-server-group-a'
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
## Database connection info
|
36
|
+
config.ec.db_selector "direct" do |s|
|
37
|
+
s.name = 'Stavanger Local'
|
38
|
+
s.host = "10.52.64.65"
|
39
|
+
s.port = 1521
|
40
|
+
s.serv = "EC"
|
41
|
+
s.user = "eckernel_head"
|
42
|
+
s.pw = "energy"
|
43
|
+
s.is_default = true
|
44
|
+
end
|
45
|
+
|
46
|
+
config.ec.db_selector "direct" do |s|
|
47
|
+
s.name = 'Local'
|
48
|
+
s.host = "192.168.91.128"
|
49
|
+
s.port = 1521
|
50
|
+
s.serv = "EC"
|
51
|
+
s.user = "eckernel_head"
|
52
|
+
s.pw = "energy"
|
53
|
+
s.is_default = true
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
##
|
58
|
+
## Use following section to build EC from a local EC install zip
|
59
|
+
# config.ec.artifact "distribution" do |artifact|
|
60
|
+
# artifact.use 'local'
|
61
|
+
# artifact.config.path = 'C:\Users\hannnyii\Desktop\ec-app-install-distribution.zip'
|
62
|
+
# end
|
63
|
+
|
64
|
+
|
65
|
+
##
|
66
|
+
## Use following section to build EC from local distribution repo
|
67
|
+
# config.ec.code "distribution" do |code|
|
68
|
+
# code.use 'local'
|
69
|
+
# code.config.path = 'C:\EnergyComponents\versions\11\code\distribution'
|
70
|
+
# end
|
71
|
+
|
72
|
+
# config.ec.artifact "distribution" do |artifact|
|
73
|
+
# artifact.use 'maven_build'
|
74
|
+
# # artifact.config.code = 'distribution'
|
75
|
+
# end
|
76
|
+
|
77
|
+
|
78
|
+
##
|
79
|
+
## Use following section to build EC from remote distribution repo
|
80
|
+
config.ec.code "distribution" do |code|
|
81
|
+
code.use 'hg_clone'
|
82
|
+
code.config.default_branch = 'default'
|
83
|
+
code.config.default_user = 'n/a'
|
84
|
+
end
|
85
|
+
|
86
|
+
config.ec.artifact "distribution" do |artifact|
|
87
|
+
artifact.use 'maven_build'
|
88
|
+
# artifact.config.code = 'distribution'
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
<% sandbox_dir = session.dir_structures[:sandbox] %>
|
2
|
+
#-------------------------
|
3
|
+
# Preparation
|
4
|
+
#-------------------------
|
5
|
+
_timestamp=$(date +"%Y%m%d_%H%M%S")
|
6
|
+
|
7
|
+
project_dir="<%= sandbox_dir.project %>"
|
8
|
+
internal_dir="<%= sandbox_dir.internal %>"
|
9
|
+
|
10
|
+
res_dir="<%= sandbox_dir.resource %>"
|
11
|
+
tmp_dir="<%= sandbox_dir.internal(:tmp, "provisioner") %>/$_timestamp"
|
12
|
+
log_dir="<%= sandbox_dir.internal(:logs, "provisioner") %>/$_timestamp"
|
13
|
+
|
14
|
+
# it randomly happen that the root user does not have permission
|
15
|
+
# to execute "sudo -u vagrant mkdir -p $sandbox_dir", therefore
|
16
|
+
# the dirs are created by root first and then get updated with
|
17
|
+
# a new owner
|
18
|
+
mkdir -p $project_dir
|
19
|
+
mkdir -p $internal_dir
|
20
|
+
mkdir -p $res_dir
|
21
|
+
mkdir -p $tmp_dir
|
22
|
+
mkdir -p $log_dir
|
23
|
+
|
24
|
+
chown -R vagrant $project_dir
|
25
|
+
chown -R vagrant $internal_dir
|
26
|
+
chown -R vagrant $res_dir
|
27
|
+
chown -R vagrant $tmp_dir
|
28
|
+
chown -R vagrant $log_dir
|
29
|
+
|
30
|
+
adddate() {
|
31
|
+
while IFS= read -r line; do
|
32
|
+
echo "$(date +"%Y-%m-%d %H:%M:%S") - $line"
|
33
|
+
done
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
#-------------------------
|
38
|
+
# Software Installation
|
39
|
+
#-------------------------
|
40
|
+
log_file="$log_dir/1-software_install.log"
|
41
|
+
touch $log_file
|
42
|
+
|
43
|
+
if [ 0 -ne $(($(($(date +%s)-$(date -r /var/lib/apt/periodic/update-success-stamp +%s)))/60/60/24)) ]; then
|
44
|
+
echo 'Updating apt-get'
|
45
|
+
apt-get update | adddate >> $log_file
|
46
|
+
else
|
47
|
+
echo 'apt-get is up-to-date'
|
48
|
+
fi;
|
49
|
+
|
50
|
+
echo "Installing unzip..."
|
51
|
+
apt-get install -y unzip | adddate >> $log_file
|
52
|
+
|
53
|
+
echo "Installing openjdk-7..."
|
54
|
+
apt-get install -y openjdk-7-jre | adddate >> $log_file
|
55
|
+
apt-get install -y openjdk-7-jdk | adddate >> $log_file
|
56
|
+
|
57
|
+
echo "Installing maven..."
|
58
|
+
apt-get install -y maven | adddate >> $log_file
|
59
|
+
|
60
|
+
echo "Installing mercurial..."
|
61
|
+
apt-get install -y mercurial | adddate >> $log_file
|
62
|
+
|
63
|
+
#-------------------------
|
64
|
+
# Maven Configuration
|
65
|
+
#-------------------------
|
66
|
+
echo "Configurating maven..."
|
67
|
+
log_file="$log_dir/2-maven_configuration.log"
|
68
|
+
touch $log_file
|
69
|
+
|
70
|
+
mvn | adddate >> $log_file
|
71
|
+
cp <%= sandbox_dir.mvn_settings %> /usr/share/maven/conf/settings.xml | adddate >> $log_file
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
2
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
3
|
+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0">
|
4
|
+
|
5
|
+
<!-- The below setting is used only for those cases when the .m2 repository is changing it's default location which is: ${user.home}/.m2 -->
|
6
|
+
<localRepository>\ec\code\maven_repository\</localRepository>
|
7
|
+
|
8
|
+
<mirrors>
|
9
|
+
<!-- Bellow mirrors are mirroring different repos like: snapshots repo, and all other repos including external ones -->
|
10
|
+
<mirror>
|
11
|
+
<id>nexus</id>
|
12
|
+
<url>http://ws002990.eu.tieto.com:8082/nexus/content/groups/public</url>
|
13
|
+
<mirrorOf>*</mirrorOf>
|
14
|
+
</mirror>
|
15
|
+
</mirrors>
|
16
|
+
|
17
|
+
<profiles>
|
18
|
+
<!-- Below profile is made to fit on all the machines and you can fill in with all specific app server and db server details,
|
19
|
+
but of course you can create your own developer profile -->
|
20
|
+
<profile>
|
21
|
+
<id>default</id>
|
22
|
+
<activation>
|
23
|
+
<activeByDefault>true</activeByDefault>
|
24
|
+
</activation>
|
25
|
+
|
26
|
+
<!-- Below properties are used for further integration testing Jboss server and DB server configuration -->
|
27
|
+
<!-- Local Jboss AS7 server settings -->
|
28
|
+
<properties>
|
29
|
+
<jboss-as.hostname>localhost</jboss-as.hostname>
|
30
|
+
|
31
|
+
<!-- These values are used for integration tests, where a direct connection is made
|
32
|
+
to the database. -->
|
33
|
+
<test.db.server.host>svg-db03</test.db.server.host>
|
34
|
+
<test.db.server.port>1521</test.db.server.port>
|
35
|
+
<test.db.servicename>EC003</test.db.servicename>
|
36
|
+
<test.db.server.username>hannnyii</test.db.server.username>
|
37
|
+
<test.db.server.password>bKdra157#03</test.db.server.password>
|
38
|
+
<jboss-as.zip.location>C:\EnergyComponents\EC-11_0\ECJBoss-EC-11_0\jboss-eap-6.2.0.zip</jboss-as.zip.location>
|
39
|
+
<jboss-as.install.location>C:\EnergyComponents\EC-11_0\ECJBoss-EC-11_0</jboss-as.install.location>
|
40
|
+
</properties>
|
41
|
+
|
42
|
+
<repositories>
|
43
|
+
|
44
|
+
<!-- com.tieto artifacts -->
|
45
|
+
<repository>
|
46
|
+
<id>releases</id>
|
47
|
+
<url>http://ws002990.eu.tieto.com:8082/nexus/content/repositories/releases</url>
|
48
|
+
<releases>
|
49
|
+
<enabled>true</enabled>
|
50
|
+
</releases>
|
51
|
+
<snapshots>
|
52
|
+
<enabled>false</enabled>
|
53
|
+
</snapshots>
|
54
|
+
</repository>
|
55
|
+
|
56
|
+
<repository>
|
57
|
+
<id>snapshots</id>
|
58
|
+
<url>http://ws002990.eu.tieto.com:8082/nexus/content/repositories/snapshots</url>
|
59
|
+
<snapshots>
|
60
|
+
<enabled>true</enabled>
|
61
|
+
</snapshots>
|
62
|
+
</repository>
|
63
|
+
|
64
|
+
<!-- External repositories -->
|
65
|
+
<repository>
|
66
|
+
<!-- This is the central repository for external releases -->
|
67
|
+
<id>central</id>
|
68
|
+
<url>http://repo1.maven.org/maven2</url>
|
69
|
+
<name>Central Repository</name>
|
70
|
+
</repository>
|
71
|
+
|
72
|
+
<repository>
|
73
|
+
<id>JBoss Repo</id>
|
74
|
+
<url>https://repository.jboss.org/nexus/content/repositories/public</url>
|
75
|
+
<name>JBoss Repo</name>
|
76
|
+
</repository>
|
77
|
+
|
78
|
+
<repository>
|
79
|
+
<id>JBoss Repo Releases</id>
|
80
|
+
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
|
81
|
+
<name>JBoss Repo</name>
|
82
|
+
</repository>
|
83
|
+
|
84
|
+
<repository>
|
85
|
+
<id>fusesource</id>
|
86
|
+
<name>fusesource</name>
|
87
|
+
<url>http://repo.fusesource.com/maven2</url>
|
88
|
+
</repository>
|
89
|
+
|
90
|
+
|
91
|
+
</repositories>
|
92
|
+
</profile>
|
93
|
+
</profiles>
|
94
|
+
|
95
|
+
<activeProfiles>
|
96
|
+
<activeProfile>default</activeProfile>
|
97
|
+
</activeProfiles>
|
98
|
+
|
99
|
+
<servers>
|
100
|
+
<server>
|
101
|
+
<id>releases</id>
|
102
|
+
<username>admin</username>
|
103
|
+
<password>Ab123456</password>
|
104
|
+
</server>
|
105
|
+
|
106
|
+
<server>
|
107
|
+
<id>snapshots</id>
|
108
|
+
<username>admin</username>
|
109
|
+
<password>Ab123456</password>
|
110
|
+
</server>
|
111
|
+
|
112
|
+
<server>
|
113
|
+
<id>nexus</id>
|
114
|
+
<username>admin</username>
|
115
|
+
<password>Ab123456</password>
|
116
|
+
</server>
|
117
|
+
</servers>
|
118
|
+
</settings>
|
File without changes
|
@@ -0,0 +1,43 @@
|
|
1
|
+
:take-snapshot()
|
2
|
+
|
3
|
+
try
|
4
|
+
/profile=<%= profile_name %>/subsystem=datasources/data-source=ECDS_UNMANAGED/:write-attribute(name=connection-url,value=jdbc:oracle:thin:@<%= host %>:<%= port %>:<%= service %>)
|
5
|
+
/profile=<%= profile_name %>/subsystem=datasources/data-source=ECDS_UNMANAGED/:write-attribute(name=user-name,value=<%= user %>)
|
6
|
+
/profile=<%= profile_name %>/subsystem=datasources/data-source=ECDS_UNMANAGED/:write-attribute(name=password,value=<%= password %>)
|
7
|
+
catch
|
8
|
+
end-try
|
9
|
+
|
10
|
+
try
|
11
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS/xa-datasource-properties=URL/:remove
|
12
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS/xa-datasource-properties=user/:remove
|
13
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS/xa-datasource-properties=password/:remove
|
14
|
+
catch
|
15
|
+
end-try
|
16
|
+
|
17
|
+
try
|
18
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS/xa-datasource-properties=URL:add(value=jdbc:oracle:thin:@<%= host %>:<%= port %>:<%= service %>)
|
19
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS/xa-datasource-properties=user:add(value=<%= user %>)
|
20
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS/xa-datasource-properties=password:add(value=<%= password %>)
|
21
|
+
catch
|
22
|
+
end-try
|
23
|
+
|
24
|
+
try
|
25
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS_MHM_BROKER/xa-datasource-properties=URL/:remove
|
26
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS_MHM_BROKER/xa-datasource-properties=user/:remove
|
27
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS_MHM_BROKER/xa-datasource-properties=password/:remove
|
28
|
+
catch
|
29
|
+
end-try
|
30
|
+
|
31
|
+
try
|
32
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS_MHM_BROKER/xa-datasource-properties=URL:add(value=jdbc:oracle:thin:@<%= host %>:<%= port %>:<%= service %>)
|
33
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS_MHM_BROKER/xa-datasource-properties=user:add(value=<%= user %>)
|
34
|
+
/profile=<%= profile_name %>/subsystem=datasources/xa-data-source=ECDS_MHM_BROKER/xa-datasource-properties=password:add(value=<%= password %>)
|
35
|
+
catch
|
36
|
+
end-try
|
37
|
+
|
38
|
+
# try
|
39
|
+
# /profile=<%= profile_name %>/subsystem=datasources/data-source=jbpmDS/:write-attribute(name=connection-url,value=jdbc:oracle:thin:@<%= host %>:<%= port %>:<%= service %>)
|
40
|
+
# /profile=<%= profile_name %>/subsystem=datasources/data-source=jbpmDS/:write-attribute(name=user-name,value=<%= user %>)
|
41
|
+
# /profile=<%= profile_name %>/subsystem=datasources/data-source=jbpmDS/:write-attribute(name=password,value=<%= password %>)
|
42
|
+
# catch
|
43
|
+
# end-try
|
@@ -0,0 +1,35 @@
|
|
1
|
+
en:
|
2
|
+
ec_sandbox:
|
3
|
+
action:
|
4
|
+
init:
|
5
|
+
in_dev: |-
|
6
|
+
Start initialization in development mode.
|
7
|
+
success: |-
|
8
|
+
Vagrant file has been placed in the folder. Edit the file ('%{path}') with your configuration before executing any 'vagrant ec' commands.
|
9
|
+
success_dev: |-
|
10
|
+
Vagrant file has been placed in the folder with development options.
|
11
|
+
configure_system_confirm: |-
|
12
|
+
Do you want the Sandbox plugin to configure your system for development? [y/N]
|
13
|
+
dir_created: |-
|
14
|
+
Sandbox directories created.
|
15
|
+
wildfly:
|
16
|
+
not_installed: |-
|
17
|
+
Wildfly not installed.
|
18
|
+
installed: |-
|
19
|
+
Wildfly installation found.
|
20
|
+
dist:
|
21
|
+
deploying_ec_app: |-
|
22
|
+
Deploying Energy Components...
|
23
|
+
ec_app_deployed: |-
|
24
|
+
Energy Components deployed.
|
25
|
+
errors:
|
26
|
+
dist_not_found: |-
|
27
|
+
Did not find distribution artifact. The artifact file needs to be placed at path '%{path}'.
|
28
|
+
wildfly_installer_not_found: |-
|
29
|
+
Cannot find wildfly installer on path '%{path}'.
|
30
|
+
wildfly_not_installed: |-
|
31
|
+
Wildfly not installed.
|
32
|
+
file_not_found: |-
|
33
|
+
Cannot find file on path '%{path}'.
|
34
|
+
user_name_not_found: |-
|
35
|
+
User '%{username}' not found.
|