linux_provision 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +20 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/linux_provision.iml +102 -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_provision.json +23 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGES +6 -0
- data/Gemfile +26 -0
- data/Gemfile.lock +46 -0
- data/LICENSE +21 -0
- data/README.md +38 -0
- data/Rakefile +39 -0
- data/Thorfile +19 -0
- data/Vagrantfile +155 -0
- data/lib/linux_provision.rb +1 -0
- data/lib/linux_provision/generic_provision.rb +66 -0
- data/lib/linux_provision/linux_provision.rb +175 -0
- data/lib/linux_provision/linux_provision_scripts.sh +172 -0
- data/lib/linux_provision/version.rb +3 -0
- data/linux_provision.gemspec.erb +21 -0
- data/spec/linux_install_spec.rb +15 -0
- data/spec/linux_provision_spec.rb +13 -0
- data/spec/spec_helper.rb +1 -0
- data/thor/linux_install.thor +147 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MjQ3ZjY4ODIxNTczNTVjNTY1MmZjZjcxMDViNWE1MjJmM2U2MGEzMw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NDk2NjcxODg1ZjlhMzRmODY0ZDg3MjEzYWM0Y2U2OTRjZjFlNzUyZQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ODQ0OTM3ZGVlNzdjMGNhMTJjYmRhOWUwN2E5YmU1OTgxYjAwYWFiZmY0OTYz
|
10
|
+
YzE5ZDI0NDQ0ODUyY2NjMWI4ZWU5NjBkODc5MTM5MmQzOWQwMDE5ZGRiYmYw
|
11
|
+
YTYwZWFiNDU5YTAyMjIwOGMzNDgxYmJjYTYyMzZjZTM0MmM0M2Y=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZjAyNTEyNjM4YjU3YTRlNzk4ODJlMDhmY2M5OGI5OTA4NGIwNTM5NDllZmVh
|
14
|
+
ZGNiYzFhMGUwY2M3ZWQ2YTVhNjEzYjNhZGYwYjcxNzYxODFmYjA2NjE5NTc4
|
15
|
+
YjA3MjA1YTY0ZWE3ODZiOTczYWM0MWVkOTNjZmRjOWZmZDZjYjE=
|
data/.gitignore
ADDED
data/.idea/.name
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
linux_provision
|
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" /></Settings>
|
data/.idea/encodings.xml
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<configuration default="false" name="LinuxProvision#test calls test method: linux_provision" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
5
|
+
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
6
|
+
<module name="linux_provision" />
|
7
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
8
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
9
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
10
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
11
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
12
|
+
<envs>
|
13
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
14
|
+
</envs>
|
15
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
16
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
17
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
18
|
+
<COVERAGE_PATTERN ENABLED="true">
|
19
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
20
|
+
</COVERAGE_PATTERN>
|
21
|
+
</EXTENSION>
|
22
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
23
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
24
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/linux_provision_spec.rb" />
|
25
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
26
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
27
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="LinuxProvision#test calls test method" />
|
28
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
29
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
30
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
31
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
|
32
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
33
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
34
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
35
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
36
|
+
<RunnerSettings RunnerId="RubyDebugRunner" />
|
37
|
+
<RunnerSettings RunnerId="RubyRunner" />
|
38
|
+
<ConfigurationWrapper RunnerId="RubyDebugRunner" />
|
39
|
+
<ConfigurationWrapper RunnerId="RubyRunner" />
|
40
|
+
<method />
|
41
|
+
</configuration>
|
42
|
+
<configuration default="false" name="LinuxInstall#test: linux_provision" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
43
|
+
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
44
|
+
<module name="linux_provision" />
|
45
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
46
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
47
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
48
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
49
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
50
|
+
<envs>
|
51
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
52
|
+
</envs>
|
53
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="false" />
|
54
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
55
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
56
|
+
<COVERAGE_PATTERN ENABLED="true">
|
57
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
58
|
+
</COVERAGE_PATTERN>
|
59
|
+
</EXTENSION>
|
60
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
61
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
62
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/linux_install_spec.rb" />
|
63
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
64
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
65
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="LinuxInstall#test" />
|
66
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
67
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
68
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
69
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
|
70
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
71
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
72
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
73
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
74
|
+
<RunnerSettings RunnerId="RubyRunner" />
|
75
|
+
<ConfigurationWrapper RunnerId="RubyRunner" />
|
76
|
+
<method />
|
77
|
+
</configuration>
|
78
|
+
</component>
|
79
|
+
<component name="NewModuleRootManager">
|
80
|
+
<content url="file://$MODULE_DIR$" />
|
81
|
+
<orderEntry type="jdk" jdkName="RVM: ruby-1.9.3-p545 [linux_provision]" jdkType="RUBY_SDK" />
|
82
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
83
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.6.2, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
84
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
85
|
+
<orderEntry type="library" scope="PROVIDED" name="file_utils (v1.0.7, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
86
|
+
<orderEntry type="library" scope="PROVIDED" name="gemcutter (v0.7.1, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
87
|
+
<orderEntry type="library" scope="PROVIDED" name="gemspec_deps_gen (v1.1.2, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
88
|
+
<orderEntry type="library" scope="PROVIDED" name="highline (v1.6.21, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
89
|
+
<orderEntry type="library" scope="PROVIDED" name="json_pure (v1.8.1, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
90
|
+
<orderEntry type="library" scope="PROVIDED" name="metaclass (v0.0.4, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
91
|
+
<orderEntry type="library" scope="PROVIDED" name="mocha (v1.1.0, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
92
|
+
<orderEntry type="library" scope="PROVIDED" name="net-ssh (v2.9.1, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
93
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.0.0, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
94
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.0.0, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
95
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.0.0, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
96
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.0.1, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
97
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.0.0, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
98
|
+
<orderEntry type="library" scope="PROVIDED" name="text-interpolator (v1.1.4, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
99
|
+
<orderEntry type="library" scope="PROVIDED" name="thor (v0.19.1, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
100
|
+
</component>
|
101
|
+
</module>
|
102
|
+
|
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 [script_executor]" 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_provision.iml" filepath="$PROJECT_DIR$/.idea/linux_provision.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
9
|
+
|
data/.idea/vcs.xml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"node": {
|
3
|
+
"domain": "22.22.22.22",
|
4
|
+
"user": "vagrant",
|
5
|
+
"password": "vagrant",
|
6
|
+
"home": "/home/vagrant",
|
7
|
+
"port": "2222",
|
8
|
+
"remote": true
|
9
|
+
},
|
10
|
+
|
11
|
+
"postgres": {
|
12
|
+
"hostname": "localhost", "user": "postgres", "password": "postgres",
|
13
|
+
"app_user": "ruby_dev",
|
14
|
+
"app_schemas": ["ruby_dev_test", "ruby_dev_dev", "ruby_dev_prod"]
|
15
|
+
},
|
16
|
+
|
17
|
+
"mysql": {
|
18
|
+
"hostname": "localhost", "user": "root", "password": "root",
|
19
|
+
"app_user": "ruby_dev",
|
20
|
+
"app_schemas": ["ruby_dev_test", "ruby_dev_dev", "ruby_dev_prod"]
|
21
|
+
}
|
22
|
+
|
23
|
+
}
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
linux_provision
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-1.9.3
|
data/CHANGES
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
group :default do
|
4
|
+
gem "text-interpolator", "~>1.0"
|
5
|
+
gem "script_executor", "~>1.4"
|
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
|
+
# group :debug do
|
21
|
+
# gem "ruby-debug-base19x", "0.11.30.pre15"
|
22
|
+
# gem "ruby-debug-ide", "0.4.23.beta1"
|
23
|
+
# end
|
24
|
+
|
25
|
+
|
26
|
+
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,46 @@
|
|
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.1.0)
|
14
|
+
metaclass (~> 0.0.1)
|
15
|
+
net-ssh (2.9.1)
|
16
|
+
rspec (3.0.0)
|
17
|
+
rspec-core (~> 3.0.0)
|
18
|
+
rspec-expectations (~> 3.0.0)
|
19
|
+
rspec-mocks (~> 3.0.0)
|
20
|
+
rspec-core (3.0.0)
|
21
|
+
rspec-support (~> 3.0.0)
|
22
|
+
rspec-expectations (3.0.0)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.0.0)
|
25
|
+
rspec-mocks (3.0.1)
|
26
|
+
rspec-support (~> 3.0.0)
|
27
|
+
rspec-support (3.0.0)
|
28
|
+
script_executor (1.4.2)
|
29
|
+
highline (~> 1.6)
|
30
|
+
net-ssh (~> 2.8)
|
31
|
+
text-interpolator (~> 1.0)
|
32
|
+
text-interpolator (1.1.4)
|
33
|
+
thor (0.19.1)
|
34
|
+
|
35
|
+
PLATFORMS
|
36
|
+
ruby
|
37
|
+
|
38
|
+
DEPENDENCIES
|
39
|
+
gemcutter (~> 0.7)
|
40
|
+
gemspec_deps_gen (~> 1.1)
|
41
|
+
json_pure (~> 1.8)
|
42
|
+
mocha
|
43
|
+
rspec
|
44
|
+
script_executor (~> 1.4)
|
45
|
+
text-interpolator (~> 1.0)
|
46
|
+
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
@@ -0,0 +1,38 @@
|
|
1
|
+
# Linux Provision
|
2
|
+
|
3
|
+
Library and thor tasks for provisioning of Linux computer initial setup for Ruby/Rails development
|
4
|
+
|
5
|
+
|
6
|
+
# $ vagrant box add precise64 http://files.vagrantup.com/precise64.box
|
7
|
+
# $ vagrant init precise64
|
8
|
+
# $ vagrant up
|
9
|
+
# $ vagrant reload
|
10
|
+
# $ vagrant provision
|
11
|
+
# $ vagrant suspend
|
12
|
+
# $ vagrant halt
|
13
|
+
# $ vagrant destroy
|
14
|
+
# $ vagrant box remove precise64
|
15
|
+
#
|
16
|
+
# $ vagrant ssh
|
17
|
+
# $ ssh vagrant@127.0.0.1 -p 2222
|
18
|
+
|
19
|
+
# ```bash
|
20
|
+
# vagrant ssh
|
21
|
+
#
|
22
|
+
# cd /vagrant
|
23
|
+
#
|
24
|
+
# rake db:dev:reset
|
25
|
+
#
|
26
|
+
# rspec
|
27
|
+
#
|
28
|
+
# ASSET_HOST=http://22.22.22.22:3000 rails s
|
29
|
+
# ```
|
30
|
+
#
|
31
|
+
# * and then access it from the browser within [host computer](http://22.22.22.22:3000/app):
|
32
|
+
#
|
33
|
+
# ```
|
34
|
+
# open http://22.22.22.22:3000/app
|
35
|
+
# ```
|
36
|
+
|
37
|
+
# $ vagrant package --vagrantfile Vagrantfile --output linux_provision.box
|
38
|
+
|
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_provision/version"
|
7
|
+
require "gemspec_deps_gen/gemspec_deps_gen"
|
8
|
+
|
9
|
+
version = LinuxProvision::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: 3001, 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_provision", "/home/vagrant/linux_provision"
|
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
|