linux_ruby_dev_install 0.9.0
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 +15 -0
- data/.gitignore +18 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/linux_ruby_dev_install.iml +61 -0
- data/.idea/misc.xml +8 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/.linux_install.json +20 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGES +5 -0
- data/Gemfile +21 -0
- data/Gemfile.lock +42 -0
- data/LICENSE +21 -0
- data/README.md +3 -0
- data/Rakefile +39 -0
- data/Thorfile +19 -0
- data/Vagrantfile +155 -0
- data/bootstrap.sh +7 -0
- data/lib/linux_ruby_dev_install/generic_installer.rb +47 -0
- data/lib/linux_ruby_dev_install/linux_installer.rb +154 -0
- data/lib/linux_ruby_dev_install/linux_scripts.sh +119 -0
- data/lib/linux_ruby_dev_install/version.rb +3 -0
- data/lib/linux_ruby_dev_install.rb +1 -0
- data/linux_ruby_dev_install.gemspec.erb +21 -0
- data/spec/linux_installer_spec.rb +103 -0
- data/spec/spec_helper.rb +1 -0
- data/thor/linux_install.thor +148 -0
- metadata +158 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
NGIxZmZhMGY0MTkxODA3OTA1ZTA2MWZjYzM3YjQ2M2ExNWIxNWIxNg==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
YjRhMTc4ZTA0MmE1MjU5MGExMTBmOTk2M2NmNzRmMjRiYzg2YTNiZA==
|
|
7
|
+
SHA512:
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
NmZjYmNmYThiNTE0OGU1NzRkMTEwOTAzNDc2MzhmOTdiZWVlZDFkNTkwZDQ5
|
|
10
|
+
ODllNDIyZmU5OTk3NmJlYjVmODlhNjFkYTgxZDcxMWMxNjljYzQ4ODllNTkw
|
|
11
|
+
YjFmNzJlNzQ2MDliZjk2Zjg2ZWJjNWJlMDczZjcyODExNjY1Y2E=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
ODUwZTJkZGYyYmZiYjVmNWUyNWJiMmI2Njk2OTNhNmU0YmE4NDdhZTEyMDRm
|
|
14
|
+
OTEyYzBmNTQ5OTI2M2UxNzRlYjg0OWFhMmZjNjJlZjBmMWM5NzEyZmY2NTYx
|
|
15
|
+
YTZkZTBhOTY5MDlmNTNjZDU5NTU1NDI4MDdjODhiMGZlMzVmMmQ=
|
data/.gitignore
ADDED
data/.idea/.name
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
linux_ruby_dev_install
|
data/.idea/.rakeTasks
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
|
3
|
+
You are allowed to:
|
|
4
|
+
1. Remove rake task
|
|
5
|
+
2. Add existing rake tasks
|
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="build" taksId="build" /><RakeTask description="" fullCmd="gen" taksId="gen" /><RakeTask description="" fullCmd="install" taksId="install" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeTask description="" fullCmd="uninstall" taksId="uninstall" /></RakeGroup></Settings>
|
data/.idea/encodings.xml
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="FacetManager">
|
|
4
|
+
<facet type="gem" name="Ruby Gem">
|
|
5
|
+
<configuration>
|
|
6
|
+
<option name="GEM_APP_ROOT_PATH" value="$MODULE_DIR$" />
|
|
7
|
+
<option name="GEM_APP_TEST_PATH" value="" />
|
|
8
|
+
<option name="GEM_APP_LIB_PATH" value="$MODULE_DIR$/lib" />
|
|
9
|
+
</configuration>
|
|
10
|
+
</facet>
|
|
11
|
+
</component>
|
|
12
|
+
<component name="ModuleRunConfigurationManager">
|
|
13
|
+
<configuration default="false" name="provisio" type="RubyRunConfigurationType" factoryName="Ruby" temporary="true">
|
|
14
|
+
<module name="linux_ruby_dev_install" />
|
|
15
|
+
<RUBY_RUN_CONFIG NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
|
16
|
+
<RUBY_RUN_CONFIG NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
|
17
|
+
<RUBY_RUN_CONFIG NAME="SHOULD_USE_SDK" VALUE="false" />
|
|
18
|
+
<RUBY_RUN_CONFIG NAME="ALTERN_SDK_NAME" VALUE="" />
|
|
19
|
+
<RUBY_RUN_CONFIG NAME="myPassParentEnvs" VALUE="true" />
|
|
20
|
+
<envs />
|
|
21
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
|
22
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
|
23
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
|
24
|
+
<COVERAGE_PATTERN ENABLED="true">
|
|
25
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
|
26
|
+
</COVERAGE_PATTERN>
|
|
27
|
+
</EXTENSION>
|
|
28
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
|
29
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_PATH" VALUE="$MODULE_DIR$/provisio.gemspec" />
|
|
30
|
+
<RUBY_RUN_CONFIG NAME="SCRIPT_ARGS" VALUE="" />
|
|
31
|
+
<RunnerSettings RunnerId="RubyDebugRunner" />
|
|
32
|
+
<RunnerSettings RunnerId="RubyRunner" />
|
|
33
|
+
<ConfigurationWrapper RunnerId="RubyDebugRunner" />
|
|
34
|
+
<ConfigurationWrapper RunnerId="RubyRunner" />
|
|
35
|
+
<method />
|
|
36
|
+
</configuration>
|
|
37
|
+
</component>
|
|
38
|
+
<component name="NewModuleRootManager">
|
|
39
|
+
<content url="file://$MODULE_DIR$" />
|
|
40
|
+
<orderEntry type="jdk" jdkName="RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]" jdkType="RUBY_SDK" />
|
|
41
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
42
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.6.2, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
43
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
44
|
+
<orderEntry type="library" scope="PROVIDED" name="file_utils (v1.0.7, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
45
|
+
<orderEntry type="library" scope="PROVIDED" name="gemcutter (v0.7.1, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
46
|
+
<orderEntry type="library" scope="PROVIDED" name="gemspec_deps_gen (v1.1.2, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
47
|
+
<orderEntry type="library" scope="PROVIDED" name="highline (v1.6.21, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
48
|
+
<orderEntry type="library" scope="PROVIDED" name="json_pure (v1.8.1, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
49
|
+
<orderEntry type="library" scope="PROVIDED" name="metaclass (v0.0.4, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
50
|
+
<orderEntry type="library" scope="PROVIDED" name="mocha (v1.0.0, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
51
|
+
<orderEntry type="library" scope="PROVIDED" name="net-ssh (v2.9.0, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
52
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v2.14.1, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
53
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.14.8, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
54
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v2.14.5, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
55
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v2.14.6, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
56
|
+
<orderEntry type="library" scope="PROVIDED" name="script_executor (v1.3.8, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
57
|
+
<orderEntry type="library" scope="PROVIDED" name="text-interpolator (v1.1.1, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
58
|
+
<orderEntry type="library" scope="PROVIDED" name="thor (v0.19.1, RVM: ruby-1.9.3-p545 [linux_ruby_dev_install]) [gem]" level="application" />
|
|
59
|
+
</component>
|
|
60
|
+
</module>
|
|
61
|
+
|
data/.idea/misc.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-1.9.3-p545 [osx_ruby_dev]" project-jdk-type="RUBY_SDK" />
|
|
4
|
+
<component name="SvnBranchConfigurationManager">
|
|
5
|
+
<option name="mySupportsUserInfoFilter" value="true" />
|
|
6
|
+
</component>
|
|
7
|
+
</project>
|
|
8
|
+
|
data/.idea/modules.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/linux_ruby_dev_install.iml" filepath="$PROJECT_DIR$/.idea/linux_ruby_dev_install.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
9
|
+
|
data/.idea/vcs.xml
ADDED
data/.linux_install.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": {
|
|
3
|
+
"domain": "127.0.0.1",
|
|
4
|
+
"user": "vagrant",
|
|
5
|
+
"password": "vagrant",
|
|
6
|
+
"port": "2222",
|
|
7
|
+
"remote": true
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
"postgres": {
|
|
11
|
+
"hostname": "localhost", "user": "postgres", "password": "postgres",
|
|
12
|
+
"app_user": "ruby_dev_user",
|
|
13
|
+
"app_schemas": ["ruby_dev_test", "ruby_dev_dev", "ruby_dev_prod"]
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
"mysql": {
|
|
17
|
+
"hostname": "localhost", "user": "root", "password": "root"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
data/.ruby-gemset
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
linux_ruby_dev_install
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby-1.9.3
|
data/CHANGES
ADDED
data/Gemfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
source "https://rubygems.org"
|
|
2
|
+
|
|
3
|
+
group :default do
|
|
4
|
+
gem "text-interpolator", "~>1.0"
|
|
5
|
+
gem "script_executor", "~>1.3"
|
|
6
|
+
gem "thor", "~>0.19"
|
|
7
|
+
gem "json_pure", "~>1.8"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
group :development do
|
|
11
|
+
gem "gemspec_deps_gen", "~>1.1"
|
|
12
|
+
gem "gemcutter", "~>0.7"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
group :test do
|
|
16
|
+
gem "rspec"
|
|
17
|
+
gem "mocha"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
diff-lcs (1.2.5)
|
|
5
|
+
file_utils (1.0.7)
|
|
6
|
+
gemcutter (0.7.1)
|
|
7
|
+
gemspec_deps_gen (1.1.2)
|
|
8
|
+
bundler
|
|
9
|
+
file_utils
|
|
10
|
+
highline (1.6.21)
|
|
11
|
+
json_pure (1.8.1)
|
|
12
|
+
metaclass (0.0.4)
|
|
13
|
+
mocha (1.0.0)
|
|
14
|
+
metaclass (~> 0.0.1)
|
|
15
|
+
net-ssh (2.9.0)
|
|
16
|
+
rspec (2.14.1)
|
|
17
|
+
rspec-core (~> 2.14.0)
|
|
18
|
+
rspec-expectations (~> 2.14.0)
|
|
19
|
+
rspec-mocks (~> 2.14.0)
|
|
20
|
+
rspec-core (2.14.8)
|
|
21
|
+
rspec-expectations (2.14.5)
|
|
22
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
|
23
|
+
rspec-mocks (2.14.6)
|
|
24
|
+
script_executor (1.3.8)
|
|
25
|
+
highline (~> 1.6)
|
|
26
|
+
net-ssh (~> 2.8)
|
|
27
|
+
text-interpolator (~> 1.0)
|
|
28
|
+
text-interpolator (1.1.1)
|
|
29
|
+
thor (0.19.1)
|
|
30
|
+
|
|
31
|
+
PLATFORMS
|
|
32
|
+
ruby
|
|
33
|
+
|
|
34
|
+
DEPENDENCIES
|
|
35
|
+
gemcutter (~> 0.7)
|
|
36
|
+
gemspec_deps_gen (~> 1.1)
|
|
37
|
+
json_pure (~> 1.8)
|
|
38
|
+
mocha
|
|
39
|
+
rspec
|
|
40
|
+
script_executor (~> 1.3)
|
|
41
|
+
text-interpolator (~> 1.0)
|
|
42
|
+
thor (~> 0.19)
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Alexander Shvets
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.unshift File.expand_path("lib", File.dirname(__FILE__))
|
|
4
|
+
|
|
5
|
+
require "rspec/core/rake_task"
|
|
6
|
+
require "linux_ruby_dev_install/version"
|
|
7
|
+
require "gemspec_deps_gen/gemspec_deps_gen"
|
|
8
|
+
|
|
9
|
+
version = LinuxRubyDevInstall::VERSION
|
|
10
|
+
project_name = File.basename(Dir.pwd)
|
|
11
|
+
|
|
12
|
+
task :gen do
|
|
13
|
+
generator = GemspecDepsGen.new
|
|
14
|
+
|
|
15
|
+
generator.generate_dependencies "spec", "#{project_name}.gemspec.erb", "#{project_name}.gemspec"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
task :build => :gen do
|
|
19
|
+
system "gem build #{project_name}.gemspec"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
task :install do
|
|
23
|
+
system "gem install #{project_name}-#{version}.gem"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
task :uninstall do
|
|
27
|
+
system "gem uninstall #{project_name}"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
task :release => :build do
|
|
31
|
+
system "gem push #{project_name}-#{version}.gem"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
RSpec::Core::RakeTask.new do |task|
|
|
35
|
+
task.pattern = 'spec/**/*_spec.rb'
|
|
36
|
+
task.verbose = false
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
|
data/Thorfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
unless defined? Thor::Runner
|
|
4
|
+
require 'bundler'
|
|
5
|
+
|
|
6
|
+
gems = Bundler::Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, nil).requested_specs
|
|
7
|
+
|
|
8
|
+
gem = gems.find { |gem| gem.name == 'thor'}
|
|
9
|
+
|
|
10
|
+
load "#{ENV['GEM_HOME']}/gems/#{gem.name}-#{gem.version}/bin/thor"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
require 'thor'
|
|
14
|
+
|
|
15
|
+
Dir.glob("thor/**/*.thor") do |name|
|
|
16
|
+
Thor::Util.load_thorfile(name)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# $LOAD_PATH.unshift File.expand_path("lib", File.dirname(__FILE__))
|
data/Vagrantfile
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# -*- mode: ruby -*-
|
|
2
|
+
# vi: set ft=ruby :
|
|
3
|
+
|
|
4
|
+
# # Commands required to setup working docker enviro, link containers etc.
|
|
5
|
+
# $setup = <<SCRIPT
|
|
6
|
+
# echo "setup"
|
|
7
|
+
# SCRIPT
|
|
8
|
+
#
|
|
9
|
+
# # Commands required to ensure correct docker containers are started when the vm is rebooted.
|
|
10
|
+
# $start = <<SCRIPT
|
|
11
|
+
# echo "start"
|
|
12
|
+
#
|
|
13
|
+
# #PATH=$PATH:/usr/local/bin
|
|
14
|
+
#
|
|
15
|
+
# #source /usr/local/rvm/scripts/rvm
|
|
16
|
+
#
|
|
17
|
+
# #cd /vagrant
|
|
18
|
+
#
|
|
19
|
+
# #rvm use 1.9.3@n2
|
|
20
|
+
#
|
|
21
|
+
# # bundle --without production
|
|
22
|
+
#
|
|
23
|
+
# #rails s &
|
|
24
|
+
# SCRIPT
|
|
25
|
+
|
|
26
|
+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
|
27
|
+
VAGRANTFILE_API_VERSION = "2"
|
|
28
|
+
|
|
29
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
30
|
+
# All Vagrant configuration is done here. The most common configuration
|
|
31
|
+
# options are documented and commented below. For a complete reference,
|
|
32
|
+
# please see the online documentation at vagrantup.com.
|
|
33
|
+
|
|
34
|
+
# Every Vagrant virtual environment requires a box to build off of.
|
|
35
|
+
# config.vm.box = "base"
|
|
36
|
+
config.vm.box = "precise64"
|
|
37
|
+
|
|
38
|
+
# Disable automatic box update checking. If you disable this, then
|
|
39
|
+
# boxes will only be checked for updates when the user runs
|
|
40
|
+
# `vagrant box outdated`. This is not recommended.
|
|
41
|
+
# config.vm.box_check_update = false
|
|
42
|
+
|
|
43
|
+
# Create a forwarded port mapping which allows access to a specific port
|
|
44
|
+
# within the machine from a port on the host machine. In the example below,
|
|
45
|
+
# accessing "localhost:8080" will access port 80 on the guest machine.
|
|
46
|
+
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
|
47
|
+
config.vm.network "forwarded_port", guest: 3000, host: 3000
|
|
48
|
+
|
|
49
|
+
# Create a private network, which allows host-only access to the machine
|
|
50
|
+
# using a specific IP.
|
|
51
|
+
config.vm.network "private_network", ip: "22.22.22.22"
|
|
52
|
+
|
|
53
|
+
# Create a public network, which generally matched to bridged network.
|
|
54
|
+
# Bridged networks make the machine appear as another physical device on
|
|
55
|
+
# your network.
|
|
56
|
+
# config.vm.network "public_network"
|
|
57
|
+
|
|
58
|
+
# If true, then any SSH connections made will enable agent forwarding.
|
|
59
|
+
# Default value: false
|
|
60
|
+
# config.ssh.forward_agent = true
|
|
61
|
+
|
|
62
|
+
# Share an additional folder to the guest VM. The first argument is
|
|
63
|
+
# the path on the host to the actual folder. The second argument is
|
|
64
|
+
# the path on the guest to mount the folder. And the optional third
|
|
65
|
+
# argument is a set of non-required options.
|
|
66
|
+
# config.vm.synced_folder "../data", "/vagrant_data"
|
|
67
|
+
config.vm.synced_folder "../linux_ruby_dev_install", "/home/vagrant/linux_ruby_dev_install"
|
|
68
|
+
|
|
69
|
+
# Provider-specific configuration so you can fine-tune various
|
|
70
|
+
# backing providers for Vagrant. These expose provider-specific options.
|
|
71
|
+
# Example for VirtualBox:
|
|
72
|
+
#
|
|
73
|
+
# config.vm.provider "virtualbox" do |vb|
|
|
74
|
+
# # Don't boot with headless mode
|
|
75
|
+
# vb.gui = true
|
|
76
|
+
#
|
|
77
|
+
# # Use VBoxManage to customize the VM. For example to change memory:
|
|
78
|
+
# vb.customize ["modifyvm", :id, "--memory", "1024"]
|
|
79
|
+
# end
|
|
80
|
+
#
|
|
81
|
+
# View the documentation for the provider you're using for more
|
|
82
|
+
# information on available options.
|
|
83
|
+
|
|
84
|
+
# Enable provisioning with CFEngine. CFEngine Community packages are
|
|
85
|
+
# automatically installed. For example, configure the host as a
|
|
86
|
+
# policy server and optionally a policy file to run:
|
|
87
|
+
#
|
|
88
|
+
# config.vm.provision "cfengine" do |cf|
|
|
89
|
+
# cf.am_policy_hub = true
|
|
90
|
+
# # cf.run_file = "motd.cf"
|
|
91
|
+
# end
|
|
92
|
+
#
|
|
93
|
+
# You can also configure and bootstrap a client to an existing
|
|
94
|
+
# policy server:
|
|
95
|
+
#
|
|
96
|
+
# config.vm.provision "cfengine" do |cf|
|
|
97
|
+
# cf.policy_server_address = "10.0.2.15"
|
|
98
|
+
# end
|
|
99
|
+
|
|
100
|
+
# Enable provisioning with Puppet stand alone. Puppet manifests
|
|
101
|
+
# are contained in a directory path relative to this Vagrantfile.
|
|
102
|
+
# You will need to create the manifests directory and a manifest in
|
|
103
|
+
# the file default.pp in the manifests_path directory.
|
|
104
|
+
#
|
|
105
|
+
# config.vm.provision "puppet" do |puppet|
|
|
106
|
+
# puppet.manifests_path = "manifests"
|
|
107
|
+
# puppet.manifest_file = "site.pp"
|
|
108
|
+
# end
|
|
109
|
+
|
|
110
|
+
# Enable provisioning with chef solo, specifying a cookbooks path, roles
|
|
111
|
+
# path, and data_bags path (all relative to this Vagrantfile), and adding
|
|
112
|
+
# some recipes and/or roles.
|
|
113
|
+
#
|
|
114
|
+
# config.vm.provision "chef_solo" do |chef|
|
|
115
|
+
# chef.cookbooks_path = "../my-recipes/cookbooks"
|
|
116
|
+
# chef.roles_path = "../my-recipes/roles"
|
|
117
|
+
# chef.data_bags_path = "../my-recipes/data_bags"
|
|
118
|
+
# chef.add_recipe "mysql"
|
|
119
|
+
# chef.add_role "web"
|
|
120
|
+
#
|
|
121
|
+
# # You may also specify custom JSON attributes:
|
|
122
|
+
# chef.json = { mysql_password: "foo" }
|
|
123
|
+
# end
|
|
124
|
+
|
|
125
|
+
# Enable provisioning with chef server, specifying the chef server URL,
|
|
126
|
+
# and the path to the validation key (relative to this Vagrantfile).
|
|
127
|
+
#
|
|
128
|
+
# The Opscode Platform uses HTTPS. Substitute your organization for
|
|
129
|
+
# ORGNAME in the URL and validation key.
|
|
130
|
+
#
|
|
131
|
+
# If you have your own Chef Server, use the appropriate URL, which may be
|
|
132
|
+
# HTTP instead of HTTPS depending on your configuration. Also change the
|
|
133
|
+
# validation key to validation.pem.
|
|
134
|
+
#
|
|
135
|
+
# config.vm.provision "chef_client" do |chef|
|
|
136
|
+
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
|
|
137
|
+
# chef.validation_key_path = "ORGNAME-validator.pem"
|
|
138
|
+
# end
|
|
139
|
+
#
|
|
140
|
+
# If you're using the Opscode platform, your validator client is
|
|
141
|
+
# ORGNAME-validator, replacing ORGNAME with your organization name.
|
|
142
|
+
#
|
|
143
|
+
# If you have your own Chef Server, the default validation client name is
|
|
144
|
+
# chef-validator, unless you changed the configuration.
|
|
145
|
+
#
|
|
146
|
+
# chef.validation_client_name = "ORGNAME-validator"
|
|
147
|
+
|
|
148
|
+
# Setup the containers when the VM is first created
|
|
149
|
+
# config.vm.provision :shell, :path => "bootstrap.sh"
|
|
150
|
+
# config.vm.provision "shell", inline: $setup
|
|
151
|
+
|
|
152
|
+
# Make sure the correct containers are running
|
|
153
|
+
# every time we start the VM.
|
|
154
|
+
# config.vm.provision "shell", run: "always", inline: $start
|
|
155
|
+
end
|
data/bootstrap.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
require "highline"
|
|
3
|
+
|
|
4
|
+
require 'text_interpolator'
|
|
5
|
+
require 'script_executor/executable'
|
|
6
|
+
require 'script_executor/script_locator'
|
|
7
|
+
|
|
8
|
+
class GenericInstaller
|
|
9
|
+
include Executable, ScriptLocator
|
|
10
|
+
|
|
11
|
+
attr_reader :interpolator, :env, :script_list, :server_info
|
|
12
|
+
|
|
13
|
+
def initialize config_file_name, scripts_file_name
|
|
14
|
+
@interpolator = TextInterpolator.new
|
|
15
|
+
|
|
16
|
+
@env = read_config(config_file_name)
|
|
17
|
+
|
|
18
|
+
@script_list = scripts(File.expand_path(scripts_file_name, File.dirname(__FILE__)))
|
|
19
|
+
|
|
20
|
+
@server_info = env[:node] ? env[:node] : {}
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
protected
|
|
24
|
+
|
|
25
|
+
def read_config config_file_name
|
|
26
|
+
hash = JSON.parse(File.read(config_file_name), :symbolize_names => true)
|
|
27
|
+
|
|
28
|
+
interpolator.interpolate hash
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def terminal
|
|
32
|
+
@terminal ||= HighLine.new
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def ask_password message
|
|
36
|
+
terminal.ask(message) { |q| q.echo = "*" }
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def run server_info, script_name, params
|
|
40
|
+
execute(server_info) { evaluate_script_body(script_list[script_name], params, :string) }
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def run_command server_info, command
|
|
44
|
+
execute(server_info.merge({script: command}))
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
require 'linux_ruby_dev_install/generic_installer'
|
|
2
|
+
|
|
3
|
+
class LinuxInstaller < GenericInstaller
|
|
4
|
+
|
|
5
|
+
USER_LOCAL_BIN = "/usr/local/bin"
|
|
6
|
+
|
|
7
|
+
def prepare
|
|
8
|
+
env['password'] = ask_password("Enter password for #{env[:node][:user]}: ")
|
|
9
|
+
|
|
10
|
+
run(server_info.merge(capture_output: false), "prepare", env)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def rvm_install
|
|
14
|
+
installed = package_installed '#{ENV[\'HOME\']}/.rvm/bin/rvm'
|
|
15
|
+
|
|
16
|
+
if installed
|
|
17
|
+
puts "rvm already installed."
|
|
18
|
+
else
|
|
19
|
+
run(server_info, "rvm", env)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def npm_install
|
|
24
|
+
installed = package_installed "#{USER_LOCAL_BIN}/npm"
|
|
25
|
+
|
|
26
|
+
if installed
|
|
27
|
+
puts "npm already installed."
|
|
28
|
+
else
|
|
29
|
+
run(server_info, "npm", env)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# def qt_install
|
|
34
|
+
# installed = package_installed "#{USER_LOCAL_BIN}/qmake"
|
|
35
|
+
#
|
|
36
|
+
# if installed
|
|
37
|
+
# puts "qt already installed."
|
|
38
|
+
# else
|
|
39
|
+
# run(server_info, "qt", env)
|
|
40
|
+
# end
|
|
41
|
+
# end
|
|
42
|
+
#
|
|
43
|
+
# def mysql_install
|
|
44
|
+
# installed = package_installed "#{USER_LOCAL_BIN}/mysql"
|
|
45
|
+
#
|
|
46
|
+
# if installed
|
|
47
|
+
# puts "mysql already installed."
|
|
48
|
+
# else
|
|
49
|
+
# run(server_info, "mysql", env)
|
|
50
|
+
# end
|
|
51
|
+
# end
|
|
52
|
+
#
|
|
53
|
+
# def mysql_restart
|
|
54
|
+
# started = service_started("homebrew.mxcl.mysql")
|
|
55
|
+
#
|
|
56
|
+
# run(server_info, "mysql_restart", env.merge({started: started}))
|
|
57
|
+
# end
|
|
58
|
+
#
|
|
59
|
+
# def postgres_install
|
|
60
|
+
# installed = package_installed "#{USER_LOCAL_BIN}/postgres"
|
|
61
|
+
#
|
|
62
|
+
# if installed
|
|
63
|
+
# puts "postgres already installed."
|
|
64
|
+
# else
|
|
65
|
+
# run(server_info, "postgres", env)
|
|
66
|
+
# end
|
|
67
|
+
# end
|
|
68
|
+
#
|
|
69
|
+
# def postgres_restart
|
|
70
|
+
# started = service_started("homebrew.mxcl.postgres")
|
|
71
|
+
#
|
|
72
|
+
# run(server_info, "postgres_restart", env.merge({started: started}))
|
|
73
|
+
# end
|
|
74
|
+
#
|
|
75
|
+
# def postgres_stop
|
|
76
|
+
# run server_info, "postgres_stop", env
|
|
77
|
+
# end
|
|
78
|
+
#
|
|
79
|
+
# def postgres_start
|
|
80
|
+
# run server_info, "postgres_start", env
|
|
81
|
+
# end
|
|
82
|
+
#
|
|
83
|
+
# def ruby_install
|
|
84
|
+
# installed = package_installed "#{ENV['HOME']}/.rvm/rubies/ruby-1.9.3-p429/bin/ruby"
|
|
85
|
+
#
|
|
86
|
+
# if installed
|
|
87
|
+
# puts "ruby already installed."
|
|
88
|
+
# else
|
|
89
|
+
# run(server_info, "ruby", env)
|
|
90
|
+
# end
|
|
91
|
+
# end
|
|
92
|
+
#
|
|
93
|
+
# def jenkins_install
|
|
94
|
+
# installed = package_installed "/usr/local/opt/jenkins/libexec/jenkins.war"
|
|
95
|
+
#
|
|
96
|
+
# if installed
|
|
97
|
+
# puts "jenkins already installed."
|
|
98
|
+
# else
|
|
99
|
+
# run(server_info, "jenkins", env)
|
|
100
|
+
# end
|
|
101
|
+
# end
|
|
102
|
+
#
|
|
103
|
+
# def jenkins_restart
|
|
104
|
+
# started = service_started("homebrew.mxcl.jenkins")
|
|
105
|
+
#
|
|
106
|
+
# run(server_info, "jenkins_restart", env.merge({started: started}))
|
|
107
|
+
# end
|
|
108
|
+
#
|
|
109
|
+
# def selenium_install
|
|
110
|
+
# installed = package_installed "/usr/local/opt/selenium-server-standalone/selenium-server-standalone*.jar"
|
|
111
|
+
#
|
|
112
|
+
# if installed
|
|
113
|
+
# puts "selenium already installed."
|
|
114
|
+
# else
|
|
115
|
+
# run(server_info, "selenium", env)
|
|
116
|
+
# end
|
|
117
|
+
# end
|
|
118
|
+
#
|
|
119
|
+
# def selenium_restart
|
|
120
|
+
# started = service_started("homebrew.mxcl.selenium-server-standalone")
|
|
121
|
+
#
|
|
122
|
+
# run(server_info, "selenium_restart", env.merge({started: started}))
|
|
123
|
+
# end
|
|
124
|
+
#
|
|
125
|
+
# def postgres_create user, schemas
|
|
126
|
+
# create_postgres_user user, schemas.first
|
|
127
|
+
#
|
|
128
|
+
# schemas.each do |schema|
|
|
129
|
+
# create_postgres_schema user, schema
|
|
130
|
+
# end
|
|
131
|
+
# end
|
|
132
|
+
#
|
|
133
|
+
# def postgres_drop user, schemas
|
|
134
|
+
# schemas.each do |schema|
|
|
135
|
+
# drop_postgres_schema schema
|
|
136
|
+
# end
|
|
137
|
+
#
|
|
138
|
+
# drop_postgres_user user, schemas.first
|
|
139
|
+
# end
|
|
140
|
+
#
|
|
141
|
+
# def postgres_test schema
|
|
142
|
+
# result = get_postgres_schemas schema
|
|
143
|
+
#
|
|
144
|
+
# puts result
|
|
145
|
+
# end
|
|
146
|
+
#
|
|
147
|
+
# def package_installed package_path
|
|
148
|
+
# result = run server_info.merge(:suppress_output => true, :capture_output => true),
|
|
149
|
+
# "package_installed", env.merge({package_path: package_path})
|
|
150
|
+
#
|
|
151
|
+
# result.chomp == package_path
|
|
152
|
+
# end
|
|
153
|
+
|
|
154
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
[prepare]
|
|
4
|
+
|
|
5
|
+
apt-get update
|
|
6
|
+
|
|
7
|
+
sudo apt-get install -y curl
|
|
8
|
+
sudo apt-get install -y g++
|
|
9
|
+
sudo apt-get install -y subversion
|
|
10
|
+
|
|
11
|
+
######
|
|
12
|
+
[rvm]
|
|
13
|
+
|
|
14
|
+
PATH=$PATH:/usr/local/bin
|
|
15
|
+
|
|
16
|
+
curl -L https://get.rvm.io | bash
|
|
17
|
+
|
|
18
|
+
chown -R vagrant /usr/local/rvm
|
|
19
|
+
chown -R vagrant /opt/vagrant_ruby
|
|
20
|
+
|
|
21
|
+
cd /home/vagrant
|
|
22
|
+
source /usr/local/rvm/scripts/rvm
|
|
23
|
+
|
|
24
|
+
######
|
|
25
|
+
[git]
|
|
26
|
+
|
|
27
|
+
apt-get install git
|
|
28
|
+
|
|
29
|
+
######
|
|
30
|
+
[package_installed]
|
|
31
|
+
|
|
32
|
+
ls #{package_path}
|
|
33
|
+
|
|
34
|
+
[jenkins]
|
|
35
|
+
|
|
36
|
+
PATH=$PATH:/usr/local/bin
|
|
37
|
+
USER_HOME="#{node.home}"
|
|
38
|
+
|
|
39
|
+
apt-get install jenkins
|
|
40
|
+
|
|
41
|
+
[postgres]
|
|
42
|
+
|
|
43
|
+
POSTGRES_USER='postgres'
|
|
44
|
+
POSTGRES_PASSWORD='postgres'
|
|
45
|
+
|
|
46
|
+
APP_USER='ruby_dev'
|
|
47
|
+
APP_HOME='/home/vagrant/linux_ruby_dev_install'
|
|
48
|
+
|
|
49
|
+
TEST_DB_SCHEMA='ruby_dev_test'
|
|
50
|
+
DEV_DB_SCHEMA='ruby_dev_dev'
|
|
51
|
+
PROD_DB_SCHEMA='ruby_dev_prod'
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
sudo apt-get install -y postgresql-client
|
|
55
|
+
sudo apt-get install -y libpq-dev
|
|
56
|
+
sudo apt-get install -y postgresql
|
|
57
|
+
|
|
58
|
+
sudo usermod --password $POSTGRES_USER $POSTGRES_PASSWORD
|
|
59
|
+
|
|
60
|
+
sudo -u postgres psql -c "CREATE USER $APP_USER WITH PASSWORD '$APP_USER'"
|
|
61
|
+
|
|
62
|
+
ENCODING_STRING="WITH ENCODING = 'UTF-8' LC_CTYPE = 'en_US.utf8' LC_COLLATE = 'en_US.utf8' OWNER $POSTGRES_USER TEMPLATE template0"
|
|
63
|
+
|
|
64
|
+
sudo -u postgres psql -c "CREATE DATABASE $DEV_DB_SCHEMA $ENCODING_STRING"
|
|
65
|
+
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DEV_DB_SCHEMA to $APP_USER"
|
|
66
|
+
|
|
67
|
+
sudo -u postgres psql -c "CREATE DATABASE $TEST_DB_SCHEMA $ENCODING_STRING"
|
|
68
|
+
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $TEST_DB_SCHEMA to $APP_USER"
|
|
69
|
+
|
|
70
|
+
sudo -u postgres psql -c "CREATE DATABASE $PROD_DB_SCHEMA $ENCODING_STRING"
|
|
71
|
+
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $PROD_DB_SCHEMA to $APP_USER"
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
[mysql]
|
|
75
|
+
|
|
76
|
+
MYSQL_SERVER_VERSION='5.5'
|
|
77
|
+
|
|
78
|
+
MYSQL_USER='root'
|
|
79
|
+
MYSQL_PASSWORD='root'
|
|
80
|
+
|
|
81
|
+
APP_USER='ruby_dev'
|
|
82
|
+
|
|
83
|
+
TEST_DB_SCHEMA='ruby_dev_test'
|
|
84
|
+
DEV_DB_SCHEMA='ruby_dev_dev'
|
|
85
|
+
PROD_DB_SCHEMA='ruby_dev_prod'
|
|
86
|
+
|
|
87
|
+
sudo apt-get install -y libmysqlclient-dev ruby-dev
|
|
88
|
+
|
|
89
|
+
sudo apt-get install debconf-utils
|
|
90
|
+
sudo apt-get install -y mysql-client
|
|
91
|
+
|
|
92
|
+
sudo debconf-set-selections <<< "mysql-server-$MYSQL_SERVER_VERSION mysql-server/root_password password $MYSQL_PASSWORD"
|
|
93
|
+
sudo debconf-set-selections <<< "mysql-server-$MYSQL_SERVER_VERSION mysql-server/root_password_again password $MYSQL_PASSWORD"
|
|
94
|
+
|
|
95
|
+
apt-get -y install mysql-server
|
|
96
|
+
|
|
97
|
+
mysql -h localhost -u $MYSQL_USER -p"$MYSQL_PASSWORD" -e "CREATE USER '$APP_USER'@'localhost' IDENTIFIED BY '$APP_USER';"
|
|
98
|
+
|
|
99
|
+
mysql -h localhost -u $MYSQL_USER -p"$MYSQL_PASSWORD" -e "grant all privileges on *.* to '$APP_USER'@'localhost' identified by '$APP_USER' with grant option;"
|
|
100
|
+
mysql -h localhost -u $MYSQL_USER -p"$MYSQL_PASSWORD" -e "grant all privileges on *.* to '$APP_USER'@'%' identified by '$APP_USER' with grant option;"
|
|
101
|
+
|
|
102
|
+
mysql -h localhost -u $MYSQL_USER -p"$MYSQL_PASSWORD" -e "create database $TEST_DB_SCHEMA;"
|
|
103
|
+
mysql -h localhost -u $MYSQL_USER -p"$MYSQL_PASSWORD" -e "create database $DEV_DB_SCHEMA;"
|
|
104
|
+
mysql -h localhost -u $MYSQL_USER -p"$MYSQL_PASSWORD" -e "create database $PROD_DB_SCHEMA;"
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
cd $APP_HOME
|
|
114
|
+
|
|
115
|
+
bundle install --without=production
|
|
116
|
+
|
|
117
|
+
# rake db:migrate
|
|
118
|
+
# rails s
|
|
119
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'linux_ruby_dev_install/linux_installer'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/lib/linux_ruby_dev_install/version')
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "linux_ruby_dev_install"
|
|
7
|
+
spec.summary = %q{Library for building Linux computer provisioning}
|
|
8
|
+
spec.description = %q{Library for building Linux computer provisioning}
|
|
9
|
+
spec.email = "alexander.shvets@gmail.com"
|
|
10
|
+
spec.authors = ["Alexander Shvets"]
|
|
11
|
+
spec.homepage = "http://github.com/shvets/linux_ruby_dev_install"
|
|
12
|
+
|
|
13
|
+
spec.files = `git ls-files`.split($\)
|
|
14
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
15
|
+
spec.require_paths = ["lib"]
|
|
16
|
+
spec.version = LinuxRubyDevInstall::VERSION
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<%= project_dependencies %>
|
|
20
|
+
end
|
|
21
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
|
2
|
+
|
|
3
|
+
require 'thor'
|
|
4
|
+
require 'executable'
|
|
5
|
+
|
|
6
|
+
load 'thor/linux_install.thor'
|
|
7
|
+
|
|
8
|
+
class MyExecutable
|
|
9
|
+
include Executable
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# $ vagrant box add precise64 http://files.vagrantup.com/precise64.box
|
|
13
|
+
# $ vagrant init precise64
|
|
14
|
+
# $ vagrant up
|
|
15
|
+
# $ vagrant reload
|
|
16
|
+
# $ vagrant provision
|
|
17
|
+
# $ vagrant suspend
|
|
18
|
+
# $ vagrant halt
|
|
19
|
+
# $ vagrant destroy
|
|
20
|
+
# $ vagrant box remove precise64
|
|
21
|
+
#
|
|
22
|
+
# $ vagrant ssh
|
|
23
|
+
# $ ssh vagrant@127.0.0.1 -p 2222
|
|
24
|
+
|
|
25
|
+
# ```bash
|
|
26
|
+
# vagrant ssh
|
|
27
|
+
#
|
|
28
|
+
# cd /vagrant
|
|
29
|
+
#
|
|
30
|
+
# rake db:dev:reset
|
|
31
|
+
#
|
|
32
|
+
# rspec
|
|
33
|
+
#
|
|
34
|
+
# ASSET_HOST=http://22.22.22.22:3000 rails s
|
|
35
|
+
# ```
|
|
36
|
+
#
|
|
37
|
+
# * and then access it from the browser within [host computer](http://22.22.22.22:3000/triton):
|
|
38
|
+
#
|
|
39
|
+
# ```
|
|
40
|
+
# open http://22.22.22.22:3000/triton
|
|
41
|
+
# ```
|
|
42
|
+
|
|
43
|
+
# $ vagrant package --vagrantfile Vagrantfile --output linux_ruby_dev_install-linux.box
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
describe "Linux" do
|
|
48
|
+
|
|
49
|
+
subject { MyExecutable.new }
|
|
50
|
+
|
|
51
|
+
# before :all do
|
|
52
|
+
## @password ||= HighLine.new.ask("Enter password for #{ENV['USER']}: ") { |q| q.echo = '*' }
|
|
53
|
+
# end
|
|
54
|
+
|
|
55
|
+
describe "remote execution" do
|
|
56
|
+
before :all do
|
|
57
|
+
@remote_info = {
|
|
58
|
+
:domain => "127.0.0.1",
|
|
59
|
+
:user => "vagrant",
|
|
60
|
+
:password => "vagrant",
|
|
61
|
+
:port => "2222",
|
|
62
|
+
:remote => true,
|
|
63
|
+
:capture_output => true
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it "executes commands from :script parameter" do
|
|
68
|
+
result = subject.execute @remote_info.merge(:script => "whoami")
|
|
69
|
+
|
|
70
|
+
result.should == "vagrant"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it "should" do
|
|
74
|
+
# result = subject.execute @remote_info.merge(:script => "whoami")
|
|
75
|
+
#
|
|
76
|
+
# result.should == "vagrant"
|
|
77
|
+
puts Linux.new.test
|
|
78
|
+
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
#it "should execute commands from the block of code" do
|
|
83
|
+
# result = subject.execute @remote_info do
|
|
84
|
+
# %Q(
|
|
85
|
+
# whoami
|
|
86
|
+
# )
|
|
87
|
+
# end
|
|
88
|
+
#
|
|
89
|
+
# result.should == ENV['USER']
|
|
90
|
+
#end
|
|
91
|
+
#
|
|
92
|
+
#it "should execute sudo command" do
|
|
93
|
+
# result = subject.execute @remote_info.merge(:sudo => true, :password => @password, :suppress_output => false) do
|
|
94
|
+
# %Q(
|
|
95
|
+
# ~/apache-tomcat-7.0.34/bin/shutdown.sh
|
|
96
|
+
# )
|
|
97
|
+
# end
|
|
98
|
+
#
|
|
99
|
+
# p result
|
|
100
|
+
#end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$: << File.expand_path('../lib', File.dirname(__FILE__))
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
$: << File.expand_path(File.dirname(__FILE__) + '/../lib')
|
|
2
|
+
|
|
3
|
+
require 'linux_ruby_dev_install/linux_installer'
|
|
4
|
+
|
|
5
|
+
class LinuxInstall < Thor
|
|
6
|
+
attr_reader :installer
|
|
7
|
+
|
|
8
|
+
def initialize *params
|
|
9
|
+
@installer = LinuxInstaller.new ".linux_install.json", "linux_scripts.sh"
|
|
10
|
+
|
|
11
|
+
super *params
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
desc "all", "Installs all required packages"
|
|
15
|
+
def all
|
|
16
|
+
invoke :prepare
|
|
17
|
+
|
|
18
|
+
invoke :npm
|
|
19
|
+
|
|
20
|
+
# invoke :rvm
|
|
21
|
+
# invoke :qt
|
|
22
|
+
|
|
23
|
+
#invoke :mysql
|
|
24
|
+
#invoke :mysql_restart
|
|
25
|
+
|
|
26
|
+
# invoke :init_launch_agent
|
|
27
|
+
#
|
|
28
|
+
# invoke :postgres
|
|
29
|
+
# invoke :postgres_restart
|
|
30
|
+
#
|
|
31
|
+
# invoke :jenkins
|
|
32
|
+
# invoke :jenkins_restart
|
|
33
|
+
#
|
|
34
|
+
# invoke :selenium
|
|
35
|
+
#
|
|
36
|
+
# invoke :ruby
|
|
37
|
+
#
|
|
38
|
+
# invoke :postgres_create
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
desc "prepare", "prepare"
|
|
42
|
+
def prepare
|
|
43
|
+
installer.prepare
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# desc "brew", "Installs homebrew"
|
|
47
|
+
# def brew
|
|
48
|
+
# installer.homebrew_install
|
|
49
|
+
# end
|
|
50
|
+
#
|
|
51
|
+
# desc "rvm", "Installs rvm"
|
|
52
|
+
# def rvm
|
|
53
|
+
# installer.rvm_install
|
|
54
|
+
# end
|
|
55
|
+
|
|
56
|
+
desc "npm", "Installs npm"
|
|
57
|
+
def npm
|
|
58
|
+
installer.npm_install
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# desc "qt", "Installs qt"
|
|
62
|
+
# def qt
|
|
63
|
+
# installer.qt_install
|
|
64
|
+
# end
|
|
65
|
+
#
|
|
66
|
+
# desc "init_launch_agent", "Inits launch agent"
|
|
67
|
+
# def init_launch_agent
|
|
68
|
+
# installer.init_launch_agent
|
|
69
|
+
# end
|
|
70
|
+
#
|
|
71
|
+
# desc "mysql", "Installs mysql server"
|
|
72
|
+
# def mysql
|
|
73
|
+
# installer.mysql_install
|
|
74
|
+
# end
|
|
75
|
+
#
|
|
76
|
+
# # brew uninstall mysql
|
|
77
|
+
#
|
|
78
|
+
# desc "mysql_restart", "Restarts mysql server"
|
|
79
|
+
# def mysql_restart
|
|
80
|
+
# installer.mysql_restart
|
|
81
|
+
# end
|
|
82
|
+
#
|
|
83
|
+
# desc "postgres", "Installs postgres server"
|
|
84
|
+
# def postgres
|
|
85
|
+
# installer.postgres_install
|
|
86
|
+
# end
|
|
87
|
+
#
|
|
88
|
+
# desc "postgres_restart", "Restarts postgres server"
|
|
89
|
+
# def postgres_restart
|
|
90
|
+
# installer.postgres_restart
|
|
91
|
+
# end
|
|
92
|
+
#
|
|
93
|
+
# desc "postgres_stop", "Stop postgres server"
|
|
94
|
+
# def postgres_stop
|
|
95
|
+
# installer.postgres_stop
|
|
96
|
+
# end
|
|
97
|
+
#
|
|
98
|
+
# desc "postgres_start", "Start postgres server"
|
|
99
|
+
# def postgres_start
|
|
100
|
+
# installer.postgres_start
|
|
101
|
+
# end
|
|
102
|
+
#
|
|
103
|
+
# desc "ruby", "Installs ruby"
|
|
104
|
+
# def ruby
|
|
105
|
+
# installer.ruby_install
|
|
106
|
+
# end
|
|
107
|
+
#
|
|
108
|
+
# desc "jenkins", "Installs jenkins server"
|
|
109
|
+
# def jenkins
|
|
110
|
+
# installer.jenkins_install
|
|
111
|
+
# end
|
|
112
|
+
#
|
|
113
|
+
# desc "jenkins_restart", "Restart jenkins server"
|
|
114
|
+
# def jenkins_restart
|
|
115
|
+
# installer.jenkins_restart
|
|
116
|
+
# end
|
|
117
|
+
#
|
|
118
|
+
# desc "selenium", "Installs selenium server"
|
|
119
|
+
# def selenium
|
|
120
|
+
# installer.selenium_install
|
|
121
|
+
# end
|
|
122
|
+
#
|
|
123
|
+
# desc "selenium_restart", "Restarts selenium server"
|
|
124
|
+
# def selenium_restart
|
|
125
|
+
# installer.selenium_restart
|
|
126
|
+
# end
|
|
127
|
+
#
|
|
128
|
+
# desc "postgres_create", "Initializes postgres project schemas"
|
|
129
|
+
# def postgres_create
|
|
130
|
+
# installer.postgres_create env["app_user"], env["app_schemas"]
|
|
131
|
+
# end
|
|
132
|
+
#
|
|
133
|
+
# desc "postgres_drop", "Drops postgres project schemas"
|
|
134
|
+
# def postgres_drop
|
|
135
|
+
# installer.postgres_drop env["app_user"], env["app_schemas"]
|
|
136
|
+
# end
|
|
137
|
+
#
|
|
138
|
+
# desc "postgres_test", "Test postgres schemas"
|
|
139
|
+
# def postgres_test
|
|
140
|
+
# installer.postgres_test env["app_user"]
|
|
141
|
+
# end
|
|
142
|
+
#
|
|
143
|
+
# desc "test", "test"
|
|
144
|
+
# def test
|
|
145
|
+
# puts "test"
|
|
146
|
+
# end
|
|
147
|
+
|
|
148
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: linux_ruby_dev_install
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.9.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Alexander Shvets
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: text-interpolator
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ~>
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ~>
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: script_executor
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ~>
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.3'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ~>
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.3'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: thor
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ~>
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0.19'
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ~>
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0.19'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: json_pure
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ~>
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '1.8'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ~>
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '1.8'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: gemspec_deps_gen
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ~>
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '1.1'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ~>
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '1.1'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: gemcutter
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ~>
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0.7'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ~>
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0.7'
|
|
97
|
+
description: Library for building Linux computer provisioning
|
|
98
|
+
email: alexander.shvets@gmail.com
|
|
99
|
+
executables: []
|
|
100
|
+
extensions: []
|
|
101
|
+
extra_rdoc_files: []
|
|
102
|
+
files:
|
|
103
|
+
- .gitignore
|
|
104
|
+
- .idea/.name
|
|
105
|
+
- .idea/.rakeTasks
|
|
106
|
+
- .idea/encodings.xml
|
|
107
|
+
- .idea/linux_ruby_dev_install.iml
|
|
108
|
+
- .idea/misc.xml
|
|
109
|
+
- .idea/modules.xml
|
|
110
|
+
- .idea/scopes/scope_settings.xml
|
|
111
|
+
- .idea/vcs.xml
|
|
112
|
+
- .linux_install.json
|
|
113
|
+
- .ruby-gemset
|
|
114
|
+
- .ruby-version
|
|
115
|
+
- CHANGES
|
|
116
|
+
- Gemfile
|
|
117
|
+
- Gemfile.lock
|
|
118
|
+
- LICENSE
|
|
119
|
+
- README.md
|
|
120
|
+
- Rakefile
|
|
121
|
+
- Thorfile
|
|
122
|
+
- Vagrantfile
|
|
123
|
+
- bootstrap.sh
|
|
124
|
+
- lib/linux_ruby_dev_install.rb
|
|
125
|
+
- lib/linux_ruby_dev_install/generic_installer.rb
|
|
126
|
+
- lib/linux_ruby_dev_install/linux_installer.rb
|
|
127
|
+
- lib/linux_ruby_dev_install/linux_scripts.sh
|
|
128
|
+
- lib/linux_ruby_dev_install/version.rb
|
|
129
|
+
- linux_ruby_dev_install.gemspec.erb
|
|
130
|
+
- spec/linux_installer_spec.rb
|
|
131
|
+
- spec/spec_helper.rb
|
|
132
|
+
- thor/linux_install.thor
|
|
133
|
+
homepage: http://github.com/shvets/linux_ruby_dev_install
|
|
134
|
+
licenses: []
|
|
135
|
+
metadata: {}
|
|
136
|
+
post_install_message:
|
|
137
|
+
rdoc_options: []
|
|
138
|
+
require_paths:
|
|
139
|
+
- lib
|
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
|
+
requirements:
|
|
142
|
+
- - ! '>='
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: '0'
|
|
145
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
|
+
requirements:
|
|
147
|
+
- - ! '>='
|
|
148
|
+
- !ruby/object:Gem::Version
|
|
149
|
+
version: '0'
|
|
150
|
+
requirements: []
|
|
151
|
+
rubyforge_project:
|
|
152
|
+
rubygems_version: 2.2.2
|
|
153
|
+
signing_key:
|
|
154
|
+
specification_version: 4
|
|
155
|
+
summary: Library for building Linux computer provisioning
|
|
156
|
+
test_files:
|
|
157
|
+
- spec/linux_installer_spec.rb
|
|
158
|
+
- spec/spec_helper.rb
|