linux_provision 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.idea/linux_provision.iml +46 -0
- data/CHANGES +7 -0
- data/lib/linux_provision/generic_provision.rb +6 -2
- data/lib/linux_provision/linux_provision.rb +14 -0
- data/lib/linux_provision/linux_provision_scripts.sh +4 -0
- data/lib/linux_provision/version.rb +1 -1
- data/linux_provision.gemspec +29 -0
- data/linux_provision.gemspec.erb +1 -0
- data/spec/linux_provision_spec.rb +1 -1
- data/thor/linux_install.thor +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTI2ODAyMmI0MGY4MzMxNWU2ODc0MjNjMDY2YTgyNTRhZWY2NDYyMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODhlYTM4N2U0ZTkwYTcyYzY4OGYzYTUzY2UyYTdmNGY4YWJmMjBjMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjFhNzI2MzliMDY0MTViYWFkMmE5NDMxM2ZiNTJiOWMyN2M0YTkwMjcyYmEx
|
10
|
+
M2Q4YWU5MmU0ODZiYjBkMmE5NGU0NjgwZmNkZmVlOWEyMjcwY2NlODEwMmE0
|
11
|
+
Njg2MjU3NDg5M2FiZmEyNTg5MGNhNDczZmIzMTc1ZmFhNjFkMDQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2Y4MDM3ZjJiZTViZjNjZDFlODZmM2JjOGEyYTk2Yjc1ZTI0Y2FiY2VhNGEw
|
14
|
+
MzAzODk0OWU4YmM2MWUwMTI4NTI0YzA0ZWM3NTgxNGFkZjdiYjgxZWIyMzUz
|
15
|
+
ODFkMDRjMDUxMGQ4ZTUxODZlMDZjZTQ0OWI0ZDJhYWI2NzQ1YWU=
|
data/.idea/linux_provision.iml
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="FacetManager">
|
4
|
+
<facet type="gem" name="Gem">
|
5
|
+
<configuration>
|
6
|
+
<option name="GEM_APP_ROOT_PATH" value="" />
|
7
|
+
<option name="GEM_APP_TEST_PATH" value="" />
|
8
|
+
<option name="GEM_APP_LIB_PATH" value="" />
|
9
|
+
</configuration>
|
10
|
+
</facet>
|
11
|
+
</component>
|
3
12
|
<component name="ModuleRunConfigurationManager">
|
4
13
|
<configuration default="false" name="LinuxProvision#test calls test method: linux_provision" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
5
14
|
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
@@ -75,6 +84,42 @@
|
|
75
84
|
<ConfigurationWrapper RunnerId="RubyRunner" />
|
76
85
|
<method />
|
77
86
|
</configuration>
|
87
|
+
<configuration default="false" name="LinuxProvision#test: linux_provision" type="RSpecRunConfigurationType" factoryName="RSpec" temporary="true">
|
88
|
+
<predefined_log_file id="RUBY_RSPEC" enabled="true" />
|
89
|
+
<module name="linux_provision" />
|
90
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUBY_ARGS" VALUE="-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)" />
|
91
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="WORK DIR" VALUE="$MODULE_DIR$" />
|
92
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SHOULD_USE_SDK" VALUE="false" />
|
93
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ALTERN_SDK_NAME" VALUE="" />
|
94
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="myPassParentEnvs" VALUE="true" />
|
95
|
+
<envs>
|
96
|
+
<env name="JRUBY_OPTS" value="-X+O" />
|
97
|
+
</envs>
|
98
|
+
<EXTENSION ID="BundlerRunConfigurationExtension" bundleExecEnabled="true" />
|
99
|
+
<EXTENSION ID="JRubyRunConfigurationExtension" NailgunExecEnabled="false" />
|
100
|
+
<EXTENSION ID="RubyCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" track_test_folders="true" runner="rcov">
|
101
|
+
<COVERAGE_PATTERN ENABLED="true">
|
102
|
+
<PATTERN REGEXPS="/.rvm/" INCLUDED="false" />
|
103
|
+
</COVERAGE_PATTERN>
|
104
|
+
</EXTENSION>
|
105
|
+
<EXTENSION ID="org.jetbrains.plugins.ruby.motion.run.MotionSimulatorRunExtension" />
|
106
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TESTS_FOLDER_PATH" VALUE="" />
|
107
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_SCRIPT_PATH" VALUE="$MODULE_DIR$/spec/linux_provision_spec.rb" />
|
108
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_RUNNER_PATH" VALUE="" />
|
109
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_FILE_MASK" VALUE="**/*_spec.rb" />
|
110
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_EXAMPLE_NAME" VALUE="LinuxProvision#test" />
|
111
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="TEST_TEST_TYPE" VALUE="TEST_SCRIPT" />
|
112
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPEC_ARGS" VALUE="" />
|
113
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="RUNNER_VERSION" VALUE="" />
|
114
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="USE_CUSTOM_SPEC_RUNNER" VALUE="false" />
|
115
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="DRB" VALUE="false" />
|
116
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="ZEUS" VALUE="false" />
|
117
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="SPRING" VALUE="false" />
|
118
|
+
<RSPEC_RUN_CONFIG_SETTINGS_ID NAME="FULL_BACKTRACE" VALUE="false" />
|
119
|
+
<RunnerSettings RunnerId="RubyRunner" />
|
120
|
+
<ConfigurationWrapper RunnerId="RubyRunner" />
|
121
|
+
<method />
|
122
|
+
</configuration>
|
78
123
|
</component>
|
79
124
|
<component name="NewModuleRootManager">
|
80
125
|
<content url="file://$MODULE_DIR$" />
|
@@ -95,6 +140,7 @@
|
|
95
140
|
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.0.0, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
96
141
|
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.0.1, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
97
142
|
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.0.0, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
143
|
+
<orderEntry type="library" scope="PROVIDED" name="script_executor (v1.4.2, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
98
144
|
<orderEntry type="library" scope="PROVIDED" name="text-interpolator (v1.1.4, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
99
145
|
<orderEntry type="library" scope="PROVIDED" name="thor (v0.19.1, RVM: ruby-1.9.3-p545 [linux_provision]) [gem]" level="application" />
|
100
146
|
</component>
|
data/CHANGES
CHANGED
@@ -10,12 +10,16 @@ class GenericProvision
|
|
10
10
|
|
11
11
|
attr_reader :interpolator, :env, :script_list, :server_info
|
12
12
|
|
13
|
-
def initialize config_file_name,
|
13
|
+
def initialize config_file_name, scripts_file_names
|
14
14
|
@interpolator = TextInterpolator.new
|
15
15
|
|
16
16
|
@env = read_config(config_file_name)
|
17
17
|
|
18
|
-
@script_list =
|
18
|
+
@script_list = {}
|
19
|
+
|
20
|
+
scripts_file_names.each do |name|
|
21
|
+
@script_list.merge!(scripts(name))
|
22
|
+
end
|
19
23
|
|
20
24
|
# create_script_methods parent, self
|
21
25
|
|
@@ -4,6 +4,12 @@ class LinuxProvision < GenericProvision
|
|
4
4
|
|
5
5
|
USER_LOCAL_BIN = "/usr/local/bin"
|
6
6
|
|
7
|
+
def initialize config_file_name=".linux_provision.json", scripts_file_names=[]
|
8
|
+
scripts_file_names << (File.expand_path("linux_provision_scripts.sh", File.dirname(__FILE__)))
|
9
|
+
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
7
13
|
def postgres_create_schemas
|
8
14
|
env[:postgres][:app_schemas].each do |schema|
|
9
15
|
run(server_info, "postgres_create_schema", env.merge(schema: schema))
|
@@ -15,6 +21,14 @@ class LinuxProvision < GenericProvision
|
|
15
21
|
run(server_info, "mysql_create_schema", env.merge(schema: schema))
|
16
22
|
end
|
17
23
|
end
|
24
|
+
|
25
|
+
def create_postgres_user app_user, schema
|
26
|
+
run("create_postgres_user", binding)
|
27
|
+
end
|
28
|
+
|
29
|
+
# execute(server_info) { "/usr/local/bin/dropuser #{app_user}" }
|
30
|
+
# execute(server_info) { "/usr/local/bin/dropdb #{schema}" }
|
31
|
+
|
18
32
|
private
|
19
33
|
|
20
34
|
def method_missing(method, *args, &block)
|
@@ -32,6 +32,8 @@ source $USER_HOME/.rvm/scripts/rvm
|
|
32
32
|
##############################
|
33
33
|
[ruby]
|
34
34
|
|
35
|
+
USER_HOME="#{node.home}"
|
36
|
+
|
35
37
|
source $USER_HOME/.rvm/scripts/rvm
|
36
38
|
|
37
39
|
rvm install ruby-1.9.3
|
@@ -158,6 +160,8 @@ mysql -h $HOST_NAME -u $MYSQL_USER -p"$MYSQL_PASSWORD" -e "create database $SCHE
|
|
158
160
|
##############################
|
159
161
|
[project]
|
160
162
|
|
163
|
+
USER_HOME="#{node.home}"
|
164
|
+
|
161
165
|
APP_HOME='$USER_HOME/linux_provision'
|
162
166
|
|
163
167
|
cd $APP_HOME
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/lib/linux_provision/version')
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "linux_provision"
|
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_provision"
|
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 = LinuxProvision::VERSION
|
17
|
+
spec.license = "MIT"
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
spec.add_runtime_dependency "text-interpolator", ["~> 1.0"]
|
22
|
+
spec.add_runtime_dependency "script_executor", ["~> 1.4"]
|
23
|
+
spec.add_runtime_dependency "thor", ["~> 0.19"]
|
24
|
+
spec.add_runtime_dependency "json_pure", ["~> 1.8"]
|
25
|
+
spec.add_development_dependency "gemspec_deps_gen", ["~> 1.1"]
|
26
|
+
spec.add_development_dependency "gemcutter", ["~> 0.7"]
|
27
|
+
|
28
|
+
end
|
29
|
+
|
data/linux_provision.gemspec.erb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('spec_helper', File.dirname(__FILE__))
|
|
3
3
|
require 'linux_provision/linux_provision'
|
4
4
|
|
5
5
|
describe LinuxProvision do
|
6
|
-
subject { LinuxProvision.new ".linux_provision.json", "linux_provision_scripts.sh"}
|
6
|
+
# subject { LinuxProvision.new ".linux_provision.json", "linux_provision_scripts.sh"}
|
7
7
|
|
8
8
|
describe "#test" do
|
9
9
|
it "calls test method" do
|
data/thor/linux_install.thor
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linux_provision
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Shvets
|
@@ -125,13 +125,15 @@ files:
|
|
125
125
|
- lib/linux_provision/linux_provision.rb
|
126
126
|
- lib/linux_provision/linux_provision_scripts.sh
|
127
127
|
- lib/linux_provision/version.rb
|
128
|
+
- linux_provision.gemspec
|
128
129
|
- linux_provision.gemspec.erb
|
129
130
|
- spec/linux_install_spec.rb
|
130
131
|
- spec/linux_provision_spec.rb
|
131
132
|
- spec/spec_helper.rb
|
132
133
|
- thor/linux_install.thor
|
133
134
|
homepage: http://github.com/shvets/linux_provision
|
134
|
-
licenses:
|
135
|
+
licenses:
|
136
|
+
- MIT
|
135
137
|
metadata: {}
|
136
138
|
post_install_message:
|
137
139
|
rdoc_options: []
|