daddy 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/itamae/cookbooks/bazel/install.rb +5 -18
  3. data/itamae/cookbooks/epel/install.rb +0 -4
  4. data/itamae/cookbooks/mongodb/install.rb +17 -0
  5. data/itamae/cookbooks/nginx/install.rb +10 -8
  6. data/itamae/cookbooks/nginx/nginx-1.13.12_sha256sum.txt +1 -0
  7. data/itamae/cookbooks/nginx/nginx-1.14.0_sha256sum.txt +1 -0
  8. data/itamae/cookbooks/selenium/chromedriver.rb +11 -7
  9. data/itamae/cookbooks/selenium/chromedriver_linux64-2.37_sha256sum.txt +1 -0
  10. data/itamae/cookbooks/selenium/chromedriver_linux64-2.40_sha256sum.txt +1 -0
  11. data/itamae/cookbooks/tensorflow/install.rb +7 -5
  12. data/itamae/environments/base.rb +24 -0
  13. data/itamae/environments/nodejs.rb +2 -0
  14. data/itamae/environments/nodejs/install.rb +11 -0
  15. data/itamae/environments/nodejs/templates/etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL.erb +29 -0
  16. data/itamae/environments/nodejs/templates/etc/yum.repos.d/nodesource.repo.erb +15 -0
  17. data/itamae/environments/ruby.rb +3 -0
  18. data/itamae/environments/ruby/install.rb +38 -0
  19. data/itamae/environments/ruby/ruby-2.5.1.tar.gz_sha256sum.txt +1 -0
  20. data/itamae/templates/etc/yum.repos.d/mongodb-org.repo.erb +6 -0
  21. data/itamae/templates/etc/yum.repos.d/vbatts-bazel.repo.erb +10 -0
  22. data/lib/daddy/cucumber/rails.rb +0 -3
  23. data/lib/daddy/itamae.rb +5 -4
  24. data/lib/daddy/itamae/ext/{file.rb → resource/file.rb} +0 -0
  25. data/lib/daddy/itamae/ext/{remote_file.rb → resource/remote_file.rb} +1 -1
  26. data/lib/daddy/version.rb +6 -12
  27. data/lib/tasks/dad.rake +16 -1
  28. data/lib/tasks/locale/en.yml +0 -2
  29. data/lib/tasks/locale/ja.yml +0 -2
  30. data/lib/tasks/nginx.rake +1 -0
  31. data/lib/tasks/task_helper.rb +7 -1
  32. metadata +38 -16
  33. data/bin/dad +0 -45
  34. data/itamae/cookbooks/bazel/bazel-0.8.1_sha256sum.txt +0 -1
  35. data/itamae/cookbooks/mysql/install.rb +0 -58
  36. data/itamae/cookbooks/mysql/mysql_secure_installation.sh +0 -26
  37. data/itamae/templates/etc/my.cnf.d/daddy.cnf.erb +0 -5
  38. data/lib/tasks/mysql.rake +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df9b937c32b9dadfef306086ee594350e845a51130d3a4c98ced408a78ff7fca
4
- data.tar.gz: 22d56c90351d04b107eba2efe3ffa0c5dee447c2df69c9b4fa2ddc46ace6af3f
3
+ metadata.gz: acfe7a475c4513963432eab97a6c829a1e16b49afbb7055a24c5cff2f8a96403
4
+ data.tar.gz: 267d01e688b0dafcc61eaca0bd6fbd3b3461e7f3be685f7ccddcee4764de2205
5
5
  SHA512:
6
- metadata.gz: fe79926e324a6dc3fba62da82e67256ced4ebcecb199725c51db297db04fcf0a440f666f5d527033b4c45518c35bf5eab9bb966dee51d77d77029343caa47f36
7
- data.tar.gz: 58802d72bdf88fa654bf4a2b6f56ada91f6942e2c5dabd84a18dabafe70a81a621a3c8d3bf6060825410fc7005da43acdbcc4eccd7713fc7bffb7ae35c1cf5d5
6
+ metadata.gz: 95fffe3f79bb961157657f4d24e5210418dcf90e269b94b59f50bc23201a052a7886e6fc5b1b64bd326a44f1f0016fd05c05ed41c61e2ae4bbc1e1f9d1ddbb48
7
+ data.tar.gz: aa812b551d89005d333e89faa6207caaa237545ee8c84be1c470946d1a6998c2f7d646c4365f2f46cf70a5d63a7f493d89e8b2da5f34cc13c037d971c0658e0e
@@ -1,22 +1,9 @@
1
- directory 'tmp'
1
+ require 'daddy/itamae'
2
2
 
3
- execute "download bazel-#{Daddy::BAZEL_VERSION}" do
4
- cwd 'tmp'
5
- command <<-EOF
6
- wget https://github.com/bazelbuild/bazel/releases/download/#{Daddy::BAZEL_VERSION}/bazel-#{Daddy::BAZEL_VERSION}-dist.zip -O bazel-#{Daddy::BAZEL_VERSION}-dist.zip
7
- EOF
8
- not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "bazel-#{Daddy::BAZEL_VERSION}_sha256sum.txt")}"
3
+ template '/etc/yum.repos.d/vbatts-bazel.repo' do
4
+ user 'root'
9
5
  end
10
6
 
11
- execute "install bazel-#{Daddy::BAZEL_VERSION}" do
12
- cwd 'tmp'
13
- command <<-EOF
14
- rm -Rf bazel-#{Daddy::BAZEL_VERSION}/
15
- unzip bazel-#{Daddy::BAZEL_VERSION}-dist.zip -d bazel-#{Daddy::BAZEL_VERSION}
16
- pushd bazel-#{Daddy::BAZEL_VERSION}
17
- bash ./compile.sh
18
- sudo cp -f output/bazel /usr/local/bin/
19
- popd
20
- EOF
21
- not_if "which bazel && bazel version | grep 'Build label: #{Daddy::BAZEL_VERSION}-'"
7
+ package 'bazel' do
8
+ user 'root'
22
9
  end
@@ -9,7 +9,3 @@ end
9
9
  execute 'yum-config-manager --enable epel' do
10
10
  user 'root'
11
11
  end
12
-
13
- execute 'yum clean all && yum update -y' do
14
- user 'root'
15
- end
@@ -0,0 +1,17 @@
1
+ require 'daddy/itamae'
2
+
3
+ version = ENV['MONGO_VERSION'] || '3.6'
4
+
5
+ template '/etc/yum.repos.d/mongodb-org.repo' do
6
+ user 'root'
7
+ variables :version => version
8
+ end
9
+
10
+ package 'mongodb-org' do
11
+ user 'root'
12
+ end
13
+
14
+ service 'mongod' do
15
+ user 'root'
16
+ action ['enable', 'start']
17
+ end
@@ -1,5 +1,7 @@
1
1
  require 'daddy/itamae'
2
2
 
3
+ version = ENV['NGINX_VERSION']
4
+
3
5
  directory 'tmp'
4
6
 
5
7
  # install destination
@@ -21,9 +23,9 @@ end
21
23
  execute 'download nginx' do
22
24
  cwd 'tmp'
23
25
  command <<-EOF
24
- wget https://nginx.org/download/nginx-#{Daddy::NGINX_VERSION}.tar.gz
26
+ wget https://nginx.org/download/nginx-#{version}.tar.gz
25
27
  EOF
26
- not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "nginx-#{Daddy::NGINX_VERSION}_sha256sum.txt")}"
28
+ not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "nginx-#{version}_sha256sum.txt")}"
27
29
  end
28
30
 
29
31
  # module sources
@@ -34,11 +36,11 @@ include_recipe 'modules/passenger'
34
36
  execute 'build nginx' do
35
37
  cwd 'tmp'
36
38
  command <<-EOF
37
- rm -Rf nginx-#{Daddy::NGINX_VERSION}/
38
- tar zxf nginx-#{Daddy::NGINX_VERSION}.tar.gz
39
- pushd nginx-#{Daddy::NGINX_VERSION}
39
+ rm -Rf nginx-#{version}/
40
+ tar zxf nginx-#{version}.tar.gz
41
+ pushd nginx-#{version}
40
42
  sudo ./configure \
41
- --prefix=/opt/nginx/nginx-#{Daddy::NGINX_VERSION} \
43
+ --prefix=/opt/nginx/nginx-#{version} \
42
44
  --conf-path=/etc/nginx/nginx.conf \
43
45
  --pid-path=/run/nginx.pid \
44
46
  --with-http_ssl_module \
@@ -49,13 +51,13 @@ execute 'build nginx' do
49
51
  sudo make install
50
52
  popd
51
53
  EOF
52
- not_if "test -e /opt/nginx/nginx-#{Daddy::NGINX_VERSION}"
54
+ not_if "test -e /opt/nginx/nginx-#{version}"
53
55
  end
54
56
 
55
57
  link 'current' do
56
58
  user 'root'
57
59
  cwd '/opt/nginx'
58
- to "nginx-#{Daddy::NGINX_VERSION}"
60
+ to "nginx-#{version}"
59
61
  force true
60
62
  end
61
63
 
@@ -0,0 +1 @@
1
+ fb92f5602cdb8d3ab1ad47dbeca151b185d62eedb67d347bbe9d79c1438c85de nginx-1.13.12.tar.gz
@@ -0,0 +1 @@
1
+ 5d15becbf69aba1fe33f8d416d97edd95ea8919ea9ac519eff9bafebb6022cb5 nginx-1.14.0.tar.gz
@@ -1,19 +1,23 @@
1
+ require 'daddy'
2
+
1
3
  directory 'tmp'
2
4
 
3
- execute "download chromedriver-#{Daddy::CHROME_DRIVER_VERSION}" do
5
+ version = ENV['CHROME_DRIVER_VERSION'] || Daddy::CHROME_DRIVER_VERSION
6
+
7
+ execute "download chromedriver-#{version}" do
4
8
  cwd 'tmp'
5
9
  command <<-EOF
6
- curl -o chromedriver_linux64-#{Daddy::CHROME_DRIVER_VERSION}.zip \
7
- https://chromedriver.storage.googleapis.com/#{Daddy::CHROME_DRIVER_VERSION}/chromedriver_linux64.zip
10
+ curl -o chromedriver_linux64-#{version}.zip \
11
+ https://chromedriver.storage.googleapis.com/#{version}/chromedriver_linux64.zip
8
12
  EOF
9
- not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "chromedriver_linux64-#{Daddy::CHROME_DRIVER_VERSION}_sha256sum.txt")}"
13
+ not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "chromedriver_linux64-#{version}_sha256sum.txt")}"
10
14
  end
11
15
 
12
- execute "install chromedriver-#{Daddy::CHROME_DRIVER_VERSION}" do
16
+ execute "install chromedriver-#{version}" do
13
17
  cwd 'tmp'
14
18
  command <<-EOF
15
- unzip chromedriver_linux64-#{Daddy::CHROME_DRIVER_VERSION}.zip
19
+ unzip chromedriver_linux64-#{version}.zip
16
20
  sudo mv -f chromedriver /usr/local/bin/
17
21
  EOF
18
- not_if "/usr/local/bin/chromedriver -v | grep 'ChromeDriver 2.35'"
22
+ not_if "/usr/local/bin/chromedriver -v | grep 'ChromeDriver #{version}'"
19
23
  end
@@ -0,0 +1 @@
1
+ 94dfe45843a950e1452007850afbb58619882fec1ac9cdd534f3029fc9cf3edf chromedriver_linux64-2.37.zip
@@ -0,0 +1 @@
1
+ 2ad85db0d73e642af4698ed889977784640445e873ceb956f7a364fa824c631d chromedriver_linux64-2.40.zip
@@ -1,3 +1,5 @@
1
+ require 'daddy/itamae'
2
+
1
3
  directory '/opt/tensorflow' do
2
4
  user 'root'
3
5
  owner ENV['USER']
@@ -21,21 +23,21 @@ include_recipe '../bazel/install'
21
23
  end
22
24
  end
23
25
 
24
- git '/opt/tensorflow/r1.4' do
26
+ git '/opt/tensorflow/v1.8.0' do
25
27
  repository 'https://github.com/tensorflow/tensorflow'
26
- revision 'r1.4'
28
+ revision 'v1.8.0'
27
29
  end
28
30
 
29
31
  local_ruby_block 'install tensorflow' do
30
- cwd '/opt/tensorflow/r1.4'
32
+ cwd '/opt/tensorflow/v1.8.0'
31
33
  block do
32
34
  Itamae.logger.info ''
33
35
  Itamae.logger.info 'Run following commands to proceed.'
34
36
  Itamae.logger.info "\n\n" + <<-EOF
35
37
  PYTHON_BIN_PATH=/usr/local/bin/python3 ./configure
36
- bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
38
+ bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
37
39
  bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
38
- sudo pip3 install /tmp/tensorflow_pkg/tensorflow-1.4.1-cp36-cp36m-linux_x86_64.whl
40
+ sudo pip3 install /tmp/tensorflow_pkg/tensorflow-1.8.0-cp36-cp36m-linux_x86_64.whl
39
41
  EOF
40
42
  end
41
43
  end
@@ -0,0 +1,24 @@
1
+ %w{
2
+ ImageMagick-devel
3
+ autoconf
4
+ automake
5
+ epel-release
6
+ gcc
7
+ gcc-c++
8
+ graphviz
9
+ libcurl-devel
10
+ libffi-devel
11
+ libtool
12
+ libxml2-devel
13
+ libxslt-devel
14
+ libyaml-devel
15
+ mariadb-devel
16
+ openssl-devel
17
+ readline-devel
18
+ sqlite-devel
19
+ zlib-devel
20
+ }.each do |name|
21
+ package name do
22
+ user 'root'
23
+ end
24
+ end
@@ -0,0 +1,2 @@
1
+ include_recipe 'base'
2
+ include_recipe 'nodejs:install'
@@ -0,0 +1,11 @@
1
+ template '/etc/yum.repos.d/nodesource.repo' do
2
+ user 'root'
3
+ end
4
+
5
+ template '/etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL' do
6
+ user 'root'
7
+ end
8
+
9
+ package 'nodejs' do
10
+ user 'root'
11
+ end
@@ -0,0 +1,29 @@
1
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
2
+ Version: GnuPG v1
3
+
4
+ mQINBFQCN9QBEADv5QYOlCWNkI/oKST/GGpQkOZjFY2cbYdHuc2j8kyM4oeNluXq
5
+ puEYMHOoQvbJ3DFPvsv+jCruL7qjkel9YzaF6e3RN2ystP4YBjxyOT7Bb5EnjNNU
6
+ 6oScQJ50/+RmA4N3wzBrw5+x5KQGBfRU/k7JdDKO6SGY0zzdAo3jqp1nQ9Sf+Fmg
7
+ hsjDLVZTHorLPV3yPLb37QlvBB2YIRF+dL9l4wPAI/fGyWv+Qs7VlCZTyRAnKGbv
8
+ qN1LvlYoV9YqxaJYYJW+MQhn4706yNJAFeOZuKejEcnZTd/NBiAR91sVnsXKgW9e
9
+ yb4TZ7SqkmrJpuKJBpdPr1dgaK8dDmFh9Nlhpz6xZuYcKaDEDa5b3wymnixtwZf2
10
+ WyboChIlsHDajtXZt34xP9uUge1VHyk1o8AQUzKEpuepxxLnyXArLgvHaLhQnxPA
11
+ bQB43b4RbWYHPdB16ki2WoZX/DA4YEtfxg8GC3zXC2thMJnFburmts71iiYsxKBc
12
+ 6d7O8415xrErhk2/o2+bRhf+7qBQfW0oxQSEMBYbqP3hvhG1VWc9umjbCfMgHrHo
13
+ IzI7W+GbRdbSsdpY6JNKuCftVfIKXeXk5FbUUP9NzsG/nyGFORkq9y0AKmocx3TD
14
+ w9DRG2SmKIKBOG5PQuzuXqsdUaYcFpySXdPNQG2CPtguPhQivw4qM3pQpQARAQAB
15
+ tCNOb2RlU291cmNlIDxncGctcnBtQG5vZGVzb3VyY2UuY29tPokCOAQTAQIAIgUC
16
+ VAI31AIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQXdvo1DT6dN2uaA//
17
+ UwKsmnz4MCH7Jn/vG0OinGQTfSH5uvlH68yOZmKLnhtfiqUq1gZz734S75ExxGP4
18
+ SGFYeK9CqKFgoGbpjzLLc5kvA7GdDX3E/exEjYa+GrJ9uIOUtaCKstTD5fPVj2Wf
19
+ TZtK9v1F6iYKyPHdJnSc5p7AxbLZkarF1CPJQWv2iDrg3dO3Oy41aazRwxJe9hvI
20
+ a//XavnsW2TTeo8qfQ0qrs8vzt8bxJF+PkACmqQfbXAiflCct5XEUbhbX1b8KznP
21
+ ppd5PLrvRTjHnZi/QRjky0qsUOukGiQhT6iZeiOUcLPeD+f7tA7JBZ08XXRfnLLj
22
+ mqYbIHPFG4C/AM5RXu5OdCtFrZQsJgGQEeg/UxYEz5qqNljKjRZ8XsmcyeWouKFM
23
+ LuVr1ORF6crl8lAdT3RujP2MzY8cvxJQesYKdWqk3bPXI7oG/PRReoeN86TqraYO
24
+ UeTssVlw5lmJtAH+eHt3K6TSjd0rq1RY7xWfttD7L8ECfPmBzbL54MSmKx9MBz+o
25
+ a9vOWQ2LjIbR/6DEyQiDpGhQTM+r0/SVS/kqR/j0SEHvOql+sn9sK1/qR1h3JtgI
26
+ 6YF4IDXBE9s0RBCLbdxtVf3eAcbOnhkhefMtpURJLdVuU8HhMCiVUlHDUPHIuT5z
27
+ Lp+avdanIgi8Cnps/DpMI2KigEHW5mmqihXtfKj0jeE=
28
+ =9Bql
29
+ -----END PGP PUBLIC KEY BLOCK-----
@@ -0,0 +1,15 @@
1
+ [nodesource]
2
+ name=Node.js Packages for Enterprise Linux 7 - $basearch
3
+ baseurl=https://rpm.nodesource.com/pub/el/7/$basearch
4
+ failovermethod=priority
5
+ enabled=1
6
+ gpgcheck=1
7
+ gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
8
+
9
+ [nodesource-source]
10
+ name=Node.js for Enterprise Linux 7 - $basearch - Source
11
+ baseurl=https://rpm.nodesource.com/pub/el/7/SRPMS
12
+ failovermethod=priority
13
+ enabled=0
14
+ gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
15
+ gpgcheck=1
@@ -0,0 +1,3 @@
1
+ include_recipe 'base'
2
+ include_recipe 'nodejs/install'
3
+ include_recipe 'ruby/install'
@@ -0,0 +1,38 @@
1
+ version = ENV['RUBY_VERSION'] || '2.5.1'
2
+ short_version = version.split('.')[0..1].join('.')
3
+
4
+ directory 'tmp'
5
+
6
+ execute 'download ruby' do
7
+ cwd 'tmp'
8
+ command <<-EOF
9
+ rm -f ruby-#{version}.tar.gz
10
+ wget https://cache.ruby-lang.org/pub/ruby/#{short_version}/ruby-#{version}.tar.gz
11
+ EOF
12
+ not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "ruby-#{version}.tar.gz_sha256sum.txt")}"
13
+ end
14
+
15
+ execute 'install ruby' do
16
+ cwd 'tmp'
17
+ command <<-EOF
18
+ tar zxf ruby-#{version}.tar.gz
19
+ pushd ruby-#{version}
20
+ ./configure --disable-install-rdoc
21
+ make
22
+ sudo make install
23
+ popd
24
+ EOF
25
+ not_if "ruby -v | egrep \"ruby #{version}(p[0-9]+) \""
26
+ end
27
+
28
+ gem_package 'rubygems-update' do
29
+ user 'root'
30
+ end
31
+
32
+ gem_package 'bundler' do
33
+ user 'root'
34
+ end
35
+
36
+ gem_package 'itamae' do
37
+ user 'root'
38
+ end
@@ -0,0 +1 @@
1
+ dac81822325b79c3ba9532b048c2123357d3310b2b40024202f360251d9829b1 ruby-2.5.1.tar.gz
@@ -0,0 +1,6 @@
1
+ [mongodb-org]
2
+ name=MongoDB Repository
3
+ baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/<%= @version %>/x86_64/
4
+ gpgcheck=1
5
+ enabled=1
6
+ gpgkey=https://www.mongodb.org/static/pgp/server-<%= @version %>.asc
@@ -0,0 +1,10 @@
1
+ [vbatts-bazel]
2
+ name=Copr repo for bazel owned by vbatts
3
+ baseurl=https://copr-be.cloud.fedoraproject.org/results/vbatts/bazel/epel-7-$basearch/
4
+ type=rpm-md
5
+ skip_if_unavailable=True
6
+ gpgcheck=1
7
+ gpgkey=https://copr-be.cloud.fedoraproject.org/results/vbatts/bazel/pubkey.gpg
8
+ repo_gpgcheck=0
9
+ enabled=1
10
+ enabled_metadata=1
@@ -1,6 +1,3 @@
1
- require 'minitest'
2
- MultiTest.disable_autorun
3
-
4
1
  require 'closer'
5
2
 
6
3
  begin
@@ -1,10 +1,11 @@
1
- Dir[File.join(File.dirname(__FILE__), 'itamae', 'ext', '*.rb')].each do |f|
2
- require f
3
- end
4
-
1
+ require 'itamae'
5
2
  require_relative 'itamae/config'
6
3
  require_relative 'itamae/i18n'
7
4
 
5
+ Dir[File.join(File.dirname(__FILE__), 'itamae', 'ext', '**/*.rb')].each do |f|
6
+ require f
7
+ end
8
+
8
9
  Dir[File.join(File.dirname(__FILE__), 'itamae', 'env', '*.rb')].each do |f|
9
10
  require f
10
11
  end
@@ -19,7 +19,7 @@ module Itamae
19
19
  end
20
20
 
21
21
  def find_source_file_in_templates
22
- itamae_dir = ::File.expand_path('../../../../../itamae', __FILE__)
22
+ itamae_dir = ::File.expand_path('../../../../../../itamae', __FILE__)
23
23
  path = ::File.join(itamae_dir, source_file_dir, "#{attributes.path}.erb")
24
24
  if ::File.exist?(path)
25
25
  path
@@ -2,18 +2,12 @@ module Daddy
2
2
  VERSION = [
3
3
  VERSION_MAJOR = '0',
4
4
  VERSION_MINOR = '7',
5
- VERSION_REVISION = '0'
6
- ].join('.')
7
-
8
- BAZEL_VERSION = [
9
- BAZEL_VERSION_MAJOR = '0',
10
- BAZEL_VERSION_MINOR = '8',
11
- BAZEL_VERSION_REVISION = '1'
5
+ VERSION_REVISION = '1'
12
6
  ].join('.')
13
7
 
14
8
  CHROME_DRIVER_VERSION = [
15
9
  CHROME_DRIVER_VERSION_MAJOR = '2',
16
- CHROME_DRIVER_VERSION_MINOR = '35'
10
+ CHROME_DRIVER_VERSION_MINOR = '40'
17
11
  ].join('.')
18
12
 
19
13
  GECKO_DRIVER_VERSION = [
@@ -24,14 +18,14 @@ module Daddy
24
18
 
25
19
  NGINX_VERSION = [
26
20
  NGINX_VERSION_MAJOR = '1',
27
- NGINX_VERSION_MINOR = '13',
28
- NGINX_VERSION_REVISION = '9'
21
+ NGINX_VERSION_MINOR = '14',
22
+ NGINX_VERSION_REVISION = '0'
29
23
  ].join('.')
30
24
 
31
25
  PASSENGER_VERSION = [
32
26
  PASSENGER_VERSION_MAJOR = '5',
33
- PASSENGER_VERSION_MINOR = '2',
34
- PASSENGER_VERSION_REVISION = '0'
27
+ PASSENGER_VERSION_MINOR = '3',
28
+ PASSENGER_VERSION_REVISION = '2'
35
29
  ].join('.')
36
30
 
37
31
  PYTHON_VERSION = [
@@ -1,9 +1,24 @@
1
+ require 'daddy/itamae'
1
2
  require_relative 'task_helper'
2
3
 
3
4
  task :dad do
4
- `rake -aT`.force_encoding('UTF-8').split("\n").each do |line|
5
+ `rake -aT`.split("\n").each do |line|
5
6
  if /rake dad(:.*)?/ =~ line
6
7
  puts line
7
8
  end
8
9
  end
9
10
  end
11
+
12
+ namespace :dad do
13
+ Dir.glob('config/itamae/roles/*.rb').map{|path| File.basename(path, '.rb') }.each do |role|
14
+
15
+ namespace role do
16
+ desc "ロール #{role} のセットアップを行います。"
17
+ task :setup do
18
+ role_file = "config/itamae/roles/#{role}.rb"
19
+ fail unless system("bundle exec itamae local --ohai #{role_file}")
20
+ end
21
+ end
22
+
23
+ end
24
+ end
@@ -13,8 +13,6 @@ en:
13
13
  install: install Let's Eencrypt certbot
14
14
  memcached:
15
15
  install: install mecached
16
- mysql:
17
- install: install MySQL/MariaDB
18
16
  nginx:
19
17
  config:
20
18
  gitbucket: setting GitBucket as reverse proxy
@@ -13,8 +13,6 @@ ja:
13
13
  install: Let's Eencrypt の certbot をインストールします
14
14
  memcached:
15
15
  install: memcachedをインストールします
16
- mysql:
17
- install: MySQL/MariaDBをインストールします
18
16
  nginx:
19
17
  config:
20
18
  gitbucket: NginxにGitBucketのリバースプロキシを設定します
@@ -5,6 +5,7 @@ namespace :dad do
5
5
 
6
6
  desc I18n.t('nginx.install')
7
7
  task :install do
8
+ ask_env('NGINX_VERSION', default: Daddy::NGINX_VERSION)
8
9
  run_itamae 'nginx/install'
9
10
  end
10
11
 
@@ -98,7 +98,13 @@ def self.ask(prompt, options = {})
98
98
  raise "必須です。処理を中止します。"
99
99
  end
100
100
 
101
- answer.empty? ? nil : answer
101
+ answer.to_s.empty? ? nil : answer
102
+ end
103
+
104
+ def self.ask_env(key, options = {})
105
+ answer = ask(key, options)
106
+ ENV[key] ||= answer if answer
107
+ answer
102
108
  end
103
109
 
104
110
  def self.quiet?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: itamae-plugin-recipe-daddy
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: itamae-plugin-resource-pip
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -238,16 +252,16 @@ dependencies:
238
252
  name: simplecov
239
253
  requirement: !ruby/object:Gem::Requirement
240
254
  requirements:
241
- - - "~>"
255
+ - - ">="
242
256
  - !ruby/object:Gem::Version
243
- version: '0.16'
257
+ version: '0'
244
258
  type: :development
245
259
  prerelease: false
246
260
  version_requirements: !ruby/object:Gem::Requirement
247
261
  requirements:
248
- - - "~>"
262
+ - - ">="
249
263
  - !ruby/object:Gem::Version
250
- version: '0.16'
264
+ version: '0'
251
265
  - !ruby/object:Gem::Dependency
252
266
  name: simplecov-rcov
253
267
  requirement: !ruby/object:Gem::Requirement
@@ -264,8 +278,7 @@ dependencies:
264
278
  version: '0'
265
279
  description: Daddy helps me build web applications since daddy knows some good practices.
266
280
  email: ichylinux@gmail.com
267
- executables:
268
- - dad
281
+ executables: []
269
282
  extensions: []
270
283
  extra_rdoc_files: []
271
284
  files:
@@ -274,9 +287,7 @@ files:
274
287
  - app/assets/stylesheets/daddy.css
275
288
  - app/assets/stylesheets/datepicker.css.scss
276
289
  - app/assets/stylesheets/ympicker.css.scss
277
- - bin/dad
278
290
  - itamae/cookbooks/app_base_dir.rb
279
- - itamae/cookbooks/bazel/bazel-0.8.1_sha256sum.txt
280
291
  - itamae/cookbooks/bazel/install.rb
281
292
  - itamae/cookbooks/chrome/install.rb
282
293
  - itamae/cookbooks/docker/install.rb
@@ -289,8 +300,7 @@ files:
289
300
  - itamae/cookbooks/kvm/install.rb
290
301
  - itamae/cookbooks/letsencrypt/install.rb
291
302
  - itamae/cookbooks/memcached/install.rb
292
- - itamae/cookbooks/mysql/install.rb
293
- - itamae/cookbooks/mysql/mysql_secure_installation.sh
303
+ - itamae/cookbooks/mongodb/install.rb
294
304
  - itamae/cookbooks/netdata/install.rb
295
305
  - itamae/cookbooks/netdata/netdata-installer.sh
296
306
  - itamae/cookbooks/nginx/config/gitbucket.rb
@@ -301,8 +311,10 @@ files:
301
311
  - itamae/cookbooks/nginx/install.rb
302
312
  - itamae/cookbooks/nginx/modules/nginx-rtmp-module.rb
303
313
  - itamae/cookbooks/nginx/modules/passenger.rb
314
+ - itamae/cookbooks/nginx/nginx-1.13.12_sha256sum.txt
304
315
  - itamae/cookbooks/nginx/nginx-1.13.5_sha256sum.txt
305
316
  - itamae/cookbooks/nginx/nginx-1.13.9_sha256sum.txt
317
+ - itamae/cookbooks/nginx/nginx-1.14.0_sha256sum.txt
306
318
  - itamae/cookbooks/obs_studio/install.rb
307
319
  - itamae/cookbooks/phantomjs/install.rb
308
320
  - itamae/cookbooks/python/Python-3.6.3_sha256sum.txt
@@ -311,6 +323,8 @@ files:
311
323
  - itamae/cookbooks/sbt/install.rb
312
324
  - itamae/cookbooks/selenium/chromedriver.rb
313
325
  - itamae/cookbooks/selenium/chromedriver_linux64-2.35_sha256sum.txt
326
+ - itamae/cookbooks/selenium/chromedriver_linux64-2.37_sha256sum.txt
327
+ - itamae/cookbooks/selenium/chromedriver_linux64-2.40_sha256sum.txt
314
328
  - itamae/cookbooks/selenium/geckodriver-v0.19.1-linux64_sha256sum.txt
315
329
  - itamae/cookbooks/selenium/geckodriver.rb
316
330
  - itamae/cookbooks/tensorflow/install.rb
@@ -320,12 +334,19 @@ files:
320
334
  - itamae/cookbooks/unicorn/templates/systemd/app.service.erb
321
335
  - itamae/cookbooks/unicorn/templates/unicorn.rb.erb
322
336
  - itamae/cookbooks/vsftpd/install.rb
337
+ - itamae/environments/base.rb
338
+ - itamae/environments/nodejs.rb
339
+ - itamae/environments/nodejs/install.rb
340
+ - itamae/environments/nodejs/templates/etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL.erb
341
+ - itamae/environments/nodejs/templates/etc/yum.repos.d/nodesource.repo.erb
342
+ - itamae/environments/ruby.rb
343
+ - itamae/environments/ruby/install.rb
344
+ - itamae/environments/ruby/ruby-2.5.1.tar.gz_sha256sum.txt
323
345
  - itamae/locale/en.yml
324
346
  - itamae/locale/ja.yml
325
347
  - itamae/templates/etc/god/master.conf.erb
326
348
  - itamae/templates/etc/init.d/god.erb
327
349
  - itamae/templates/etc/logrotate.d/god.erb
328
- - itamae/templates/etc/my.cnf.d/daddy.cnf.erb
329
350
  - itamae/templates/etc/my.cnf.erb
330
351
  - itamae/templates/etc/nginx/conf.d/default.conf.erb
331
352
  - itamae/templates/etc/nginx/conf.d/servers/gitbucket.conf.erb
@@ -337,7 +358,9 @@ files:
337
358
  - itamae/templates/etc/vsftpd/vsftpd.conf.erb
338
359
  - itamae/templates/etc/yum.repos.d/google-chrome.repo.erb
339
360
  - itamae/templates/etc/yum.repos.d/jenkins.repo.erb
361
+ - itamae/templates/etc/yum.repos.d/mongodb-org.repo.erb
340
362
  - itamae/templates/etc/yum.repos.d/nginx.repo.erb
363
+ - itamae/templates/etc/yum.repos.d/vbatts-bazel.repo.erb
341
364
  - itamae/templates/lib/systemd/system/nginx.service.erb
342
365
  - lib/capistrano/daddy.rb
343
366
  - lib/capistrano/tasks/clear_cache.rake
@@ -365,8 +388,8 @@ files:
365
388
  - lib/daddy/itamae/env/app_name.rb
366
389
  - lib/daddy/itamae/env/dad_env.rb
367
390
  - lib/daddy/itamae/env/os_version.rb
368
- - lib/daddy/itamae/ext/file.rb
369
- - lib/daddy/itamae/ext/remote_file.rb
391
+ - lib/daddy/itamae/ext/resource/file.rb
392
+ - lib/daddy/itamae/ext/resource/remote_file.rb
370
393
  - lib/daddy/itamae/i18n.rb
371
394
  - lib/daddy/model.rb
372
395
  - lib/daddy/models/crud_extension.rb
@@ -416,7 +439,6 @@ files:
416
439
  - lib/tasks/locale/en.yml
417
440
  - lib/tasks/locale/ja.yml
418
441
  - lib/tasks/memcached.rake
419
- - lib/tasks/mysql.rake
420
442
  - lib/tasks/netdata.rake
421
443
  - lib/tasks/nginx.rake
422
444
  - lib/tasks/obs_studio.rake
data/bin/dad DELETED
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'erb'
4
-
5
- DADDY_HOME = File.dirname(File.dirname(__FILE__))
6
-
7
- case action = ARGV[0]
8
- when 'new'
9
- RAILS_VERSION = '4.2.8'
10
- puts "using rails #{RAILS_VERSION}"
11
-
12
- APP_NAME = ARGV[1]
13
-
14
- [
15
- "sudo gem install rails -v #{RAILS_VERSION} --no-document",
16
- "rails _#{RAILS_VERSION}_ new #{APP_NAME} -d mysql --skip-bundle",
17
- ].each do |command|
18
- puts command
19
- exit 1 unless system(command)
20
- end
21
-
22
- # Gemfile
23
- template = File.join(DADDY_HOME, 'templates', 'Gemfile.erb')
24
- gemfile = File.join(APP_NAME, 'Gemfile')
25
- File.write(gemfile, ERB.new(File.read(template)).result)
26
-
27
- [
28
- "bundle install --quiet",
29
- "bundle exec rake dad:mysql:install",
30
- "bundle exec rake dad:install",
31
- "bundle exec rake dad:db:config",
32
- "bundle exec rake dad:db:create",
33
- "bundle exec rake db:migrate",
34
- "bundle exec rails g controller welcome index --no-helper --no-assets",
35
- "echo '<h1>Welcome to #{APP_NAME}</h1>' > #{File.join('app', 'views', 'welcome', 'index.html.erb')}"
36
- ].each do |command|
37
- puts command
38
- exit 1 unless system("cd #{APP_NAME} && #{command}")
39
- end
40
-
41
- # routes
42
- template = File.join(DADDY_HOME, 'templates', 'config', 'routes.rb.erb')
43
- routes = File.join(APP_NAME, 'config', 'routes.rb')
44
- File.write(routes, ERB.new(File.read(template)).result)
45
- end
@@ -1 +0,0 @@
1
- dfd0761e0b7e36c1d74c928ad986500c905be5ebcfbc29914d574af1db7218cf bazel-0.8.1-dist.zip
@@ -1,58 +0,0 @@
1
- require 'daddy/itamae'
2
-
3
- case os_version
4
- when /rhel-6\.(.*?)/
5
- package 'mysql' do
6
- user 'root'
7
- end
8
-
9
- package 'mysql-server' do
10
- user 'root'
11
- end
12
-
13
- template '/etc/my.cnf' do
14
- user 'root'
15
- owner 'root'
16
- group 'root'
17
- mode '644'
18
- end
19
-
20
- service 'mysqld' do
21
- user 'root'
22
- action [:enable, :start]
23
- end
24
-
25
- when /rhel-7\.(.*?)/
26
- package 'mariadb' do
27
- user 'root'
28
- end
29
-
30
- package 'mariadb-server' do
31
- user 'root'
32
- end
33
-
34
- template '/etc/my.cnf.d/daddy.cnf' do
35
- user 'root'
36
- owner 'root'
37
- group 'root'
38
- mode '644'
39
- end
40
-
41
- service 'mariadb' do
42
- user 'root'
43
- action [:enable, :start]
44
- end
45
-
46
- else
47
- raise I18n.t('itamae.errors.unsupported_os_version', :os_version => os_version)
48
- end
49
-
50
- package 'expect' do
51
- user 'root'
52
- end
53
-
54
- execute 'mysql_secure_installation' do
55
- user 'root'
56
- command "bash #{File.join(File.dirname(__FILE__), 'mysql_secure_installation.sh')}"
57
- only_if "mysql -u root -e 'select 1;' && test $? -eq 0"
58
- end
@@ -1,26 +0,0 @@
1
- #!/bin/bash
2
-
3
- expect -c "
4
- set timeout 5
5
- spawn mysql_secure_installation
6
-
7
- expect \"Enter current password for root\"
8
- send \"\n\"
9
-
10
- expect \"Set root password?\"
11
- send \"n\n\"
12
-
13
- expect \"Remove anonymous users?\"
14
- send \"y\n\"
15
-
16
- expect \"Disallow root login remotely?\"
17
- send \"y\n\"
18
-
19
- expect \"Remove test database and access to it?\"
20
- send \"y\n\"
21
-
22
- expect \"Reload privilege tables now?\"
23
- send \"y\n\"
24
-
25
- interact
26
- "
@@ -1,5 +0,0 @@
1
- [mysqld]
2
- character-set-server = utf8
3
-
4
- [mysql]
5
- default-character-set = utf8
@@ -1,12 +0,0 @@
1
- require_relative 'task_helper'
2
-
3
- namespace :dad do
4
- namespace :mysql do
5
-
6
- desc I18n.t('mysql.install')
7
- task :install do
8
- run_itamae 'mysql/install'
9
- end
10
-
11
- end
12
- end