daddy 0.5.19 → 0.5.20

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a015413d54840a8ce3f6ffefb3b324c358fb3e32
4
- data.tar.gz: 1c58269ccedf012511082a91ec6b20b52be5f424
3
+ metadata.gz: 445dd5a5d4fda8391b21cd6897679a59f1fd9e23
4
+ data.tar.gz: c51526e5e37adfc961d6b913932b6b5103515a0c
5
5
  SHA512:
6
- metadata.gz: 67d9bae8805d7d65e5ac1a246f1d1fd3a9c2eb1d0cf02a58063b4b143e48704ae6f24931774c18a65029ca41dd1fdd529ec2f6857cd69222d4737ccea32a38c5
7
- data.tar.gz: 6bfe7b4bdfdb648faebb6e4fd68c9075fafb3c370bc97fb1873b8762ad7d318f4f650de25ccb0c7c1d3bbcec78b7373e6c50ab5682a34e37d8a2acb3e013d517
6
+ metadata.gz: '0669a19fd38c75ae0e60f31f479ff4d5ebcb0c4b647fe96662a7c0bebda2dd966731f7b3b945c73553aa884573af8452af58d94426ea7a2eeb1a47042b08a8c5'
7
+ data.tar.gz: bd56b2dee5328661252d4392c1a73009da2a346a0aa8b287892644f5b027b19abf38c6a27c0e51e7a3e72bfdcad5993685893b2cc3d6af43da2d51a65f0c3da4
@@ -0,0 +1,10 @@
1
+ require 'daddy/itamae'
2
+
3
+ package 'memcached' do
4
+ user 'root'
5
+ end
6
+
7
+ service 'memcached' do
8
+ user 'root'
9
+ action [:enable, :start]
10
+ end
@@ -47,6 +47,10 @@ else
47
47
  raise I18n.t('itamae.errors.unsupported_os_version', :os_version => os_version)
48
48
  end
49
49
 
50
+ package 'expect' do
51
+ user 'root'
52
+ end
53
+
50
54
  execute 'mysql_secure_installation' do
51
55
  user 'root'
52
56
  command "bash #{File.join(File.dirname(__FILE__), 'mysql_secure_installation.sh')}"
@@ -1,31 +1,72 @@
1
1
  require 'daddy/itamae'
2
2
 
3
- template '/etc/yum.repos.d/nginx.repo' do
3
+ dad_nginx_checksum = File.join(File.dirname(__FILE__), 'sha256sum.txt')
4
+
5
+ directory 'tmp'
6
+
7
+ # nginx source
8
+ execute 'download nginx' do
9
+ cwd 'tmp'
10
+ command <<-EOF
11
+ wget https://nginx.org/download/nginx-1.11.10.tar.gz
12
+ EOF
13
+ not_if "sha256sum -c #{dad_nginx_checksum}"
14
+ end
15
+
16
+ # nginx-rtmp-module source
17
+ directory '/opt/nginx-rtmp-module' do
18
+ user 'root'
19
+ owner ENV['USER']
20
+ group ENV['USER']
21
+ mode '755'
22
+ end
23
+ git '/opt/nginx-rtmp-module/v1.1.11' do
24
+ repository 'https://github.com/arut/nginx-rtmp-module.git'
25
+ revision 'v1.1.11'
26
+ end
27
+
28
+ # build
29
+ execute 'build nginx' do
30
+ cwd 'tmp'
31
+ command <<-EOF
32
+ rm -Rf nginx-1.11.10
33
+ tar zxf nginx-1.11.10.tar.gz
34
+ cd nginx-1.11.10
35
+ ./configure \
36
+ --prefix=/opt/nginx-1.11.10 \
37
+ --conf-path=/etc/nginx/nginx.conf \
38
+ --pid-path=/run/nginx.pid \
39
+ --with-http_ssl_module \
40
+ --add-module=/opt/nginx-rtmp-module/v1.1.11
41
+ make
42
+ sudo make install
43
+ sudo ln -snf /opt/nginx-1.11.10 /opt/nginx
44
+ EOF
45
+ not_if "test -e /opt/nginx"
46
+ end
47
+
48
+ directory '/etc/nginx/conf.d' do
4
49
  user 'root'
5
50
  owner 'root'
6
51
  group 'root'
7
- mode '644'
52
+ mode '755'
8
53
  end
9
54
 
10
- package 'nginx' do
55
+ template '/etc/nginx/nginx.conf' do
11
56
  user 'root'
12
57
  end
13
58
 
14
- template '/etc/nginx/nginx.conf' do
59
+ template '/lib/systemd/system/nginx.service' do
15
60
  user 'root'
16
- owner 'root'
17
- group 'root'
18
- mode '644'
19
61
  end
20
62
 
21
- template '/etc/nginx/conf.d/default.conf' do
63
+ execute 'systemctl daemon-reload' do
22
64
  user 'root'
23
- owner 'root'
24
- group 'root'
25
- mode '644'
65
+ subscribes :run, 'template[/lib/systemd/system/nginx.service]'
66
+ action :nothing
26
67
  end
27
68
 
28
69
  service 'nginx' do
29
70
  user 'root'
30
71
  action :enable
31
- end
72
+ end
@@ -0,0 +1 @@
1
+ 778b3cabb07633f754cd9dee32fc8e22582bce22bfa407be76a806abd935533d nginx-1.11.10.tar.gz
@@ -0,0 +1,119 @@
1
+
2
+ #user nobody;
3
+ worker_processes 1;
4
+
5
+ #error_log logs/error.log;
6
+ #error_log logs/error.log notice;
7
+ #error_log logs/error.log info;
8
+
9
+ #pid logs/nginx.pid;
10
+
11
+
12
+ events {
13
+ worker_connections 1024;
14
+ }
15
+
16
+
17
+ http {
18
+ include mime.types;
19
+ default_type application/octet-stream;
20
+ ssl_protocols TLSv1.1 TLSv1.2;
21
+
22
+ #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
23
+ # '$status $body_bytes_sent "$http_referer" '
24
+ # '"$http_user_agent" "$http_x_forwarded_for"';
25
+
26
+ #access_log logs/access.log main;
27
+
28
+ sendfile on;
29
+ #tcp_nopush on;
30
+
31
+ #keepalive_timeout 0;
32
+ keepalive_timeout 65;
33
+
34
+ #gzip on;
35
+
36
+ server {
37
+ listen 80;
38
+ server_name localhost;
39
+
40
+ #charset koi8-r;
41
+
42
+ #access_log logs/host.access.log main;
43
+
44
+ location / {
45
+ root html;
46
+ index index.html index.htm;
47
+ }
48
+
49
+ #error_page 404 /404.html;
50
+
51
+ # redirect server error pages to the static page /50x.html
52
+ #
53
+ error_page 500 502 503 504 /50x.html;
54
+ location = /50x.html {
55
+ root html;
56
+ }
57
+
58
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
59
+ #
60
+ #location ~ \.php$ {
61
+ # proxy_pass http://127.0.0.1;
62
+ #}
63
+
64
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
65
+ #
66
+ #location ~ \.php$ {
67
+ # root html;
68
+ # fastcgi_pass 127.0.0.1:9000;
69
+ # fastcgi_index index.php;
70
+ # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
71
+ # include fastcgi_params;
72
+ #}
73
+
74
+ # deny access to .htaccess files, if Apache's document root
75
+ # concurs with nginx's one
76
+ #
77
+ #location ~ /\.ht {
78
+ # deny all;
79
+ #}
80
+ }
81
+
82
+
83
+ # another virtual host using mix of IP-, name-, and port-based configuration
84
+ #
85
+ #server {
86
+ # listen 8000;
87
+ # listen somename:8080;
88
+ # server_name somename alias another.alias;
89
+
90
+ # location / {
91
+ # root html;
92
+ # index index.html index.htm;
93
+ # }
94
+ #}
95
+
96
+
97
+ # HTTPS server
98
+ #
99
+ #server {
100
+ # listen 443 ssl;
101
+ # server_name localhost;
102
+
103
+ # ssl_certificate cert.pem;
104
+ # ssl_certificate_key cert.key;
105
+
106
+ # ssl_session_cache shared:SSL:1m;
107
+ # ssl_session_timeout 5m;
108
+
109
+ # ssl_ciphers HIGH:!aNULL:!MD5;
110
+ # ssl_prefer_server_ciphers on;
111
+
112
+ # location / {
113
+ # root html;
114
+ # index index.html index.htm;
115
+ # }
116
+ #}
117
+
118
+ include conf.d/*.conf;
119
+ }
@@ -0,0 +1,15 @@
1
+ [Unit]
2
+ Description=The NGINX HTTP and reverse proxy server
3
+ After=syslog.target network.target remote-fs.target nss-lookup.target
4
+
5
+ [Service]
6
+ Type=forking
7
+ PIDFile=/run/nginx.pid
8
+ ExecStartPre=/opt/nginx/sbin/nginx -t
9
+ ExecStart=/opt/nginx/sbin/nginx
10
+ ExecReload=/bin/kill -s HUP $MAINPID
11
+ ExecStop=/bin/kill -s QUIT $MAINPID
12
+ PrivateTmp=true
13
+
14
+ [Install]
15
+ WantedBy=multi-user.target
@@ -0,0 +1,45 @@
1
+ require 'daddy/itamae'
2
+
3
+ # build environment
4
+ %w{ gcc gcc-c++ gcc-objc cmake git }.each do |name|
5
+ package name do
6
+ user 'root'
7
+ end
8
+ end
9
+
10
+ # required packages
11
+ %w{
12
+ libX11-devel mesa-libGL-devel libv4l-devel
13
+ pulseaudio-libs-devel x264-devel freetype-devel
14
+ fontconfig-devel libXcomposite-devel libXinerama-devel
15
+ qt5-qtbase-devel qt5-qtx11extras-devel libcurl-devel
16
+ systemd-devel ffmpeg-devel
17
+ }.each do |name|
18
+ package name do
19
+ user 'root'
20
+ end
21
+ end
22
+
23
+ # clone source
24
+ directory '/opt/obs-studio' do
25
+ user 'root'
26
+ owner ENV['USER']
27
+ group ENV['USER']
28
+ mode '755'
29
+ end
30
+ directory '/opt/obs-studio/src'
31
+ git '/opt/obs-studio/src/obs-studio' do
32
+ repository 'https://github.com/jp9000/obs-studio.git'
33
+ revision '18.0.1'
34
+ end
35
+
36
+ # build
37
+ directory '/opt/obs-studio/src/obs-studio/build'
38
+ execute 'build' do
39
+ cwd '/opt/obs-studio/src/obs-studio'
40
+ command <<-EOF
41
+ cmake -DUNIX_STRUCTURE=0 -DCMAKE_INSTALL_PREFIX="/opt/obs-studio"
42
+ make -j4
43
+ make install
44
+ EOF
45
+ end
@@ -0,0 +1,10 @@
1
+ require 'daddy/itamae'
2
+
3
+ package 'redis' do
4
+ user 'root'
5
+ end
6
+
7
+ service 'redis' do
8
+ user 'root'
9
+ action [:enable, :start]
10
+ end
@@ -19,14 +19,22 @@ if ENV['COVERAGE']
19
19
  end
20
20
  end
21
21
 
22
- case ENV['FORMAT'].to_s.downcase
23
- when 'junit'
24
- MiniTest::Reporters.use! [
25
- MiniTest::Reporters::DefaultReporter.new,
26
- MiniTest::Reporters::JUnitReporter.new
27
- ]
28
- else
29
- MiniTest::Reporters.use! [
30
- MiniTest::Reporters::DefaultReporter.new(:color => true),
31
- ]
22
+ if ENV['FORMAT']
23
+ begin
24
+ require 'minitest/reporters'
25
+
26
+ case ENV['FORMAT'].to_s.downcase
27
+ when 'junit'
28
+ MiniTest::Reporters.use! [
29
+ MiniTest::Reporters::DefaultReporter.new,
30
+ MiniTest::Reporters::JUnitReporter.new
31
+ ]
32
+ else
33
+ MiniTest::Reporters.use! [
34
+ MiniTest::Reporters::DefaultReporter.new(:color => true),
35
+ ]
36
+ end
37
+ rescue LoadError => e
38
+ raise 'minitest-reporters not found.'
39
+ end
32
40
  end
data/lib/daddy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Daddy
2
- VERSION = '0.5.19'
2
+ VERSION = '0.5.20'
3
3
  end
@@ -9,8 +9,14 @@ en:
9
9
  install: install Jenkins plugins
10
10
  letsencrypt:
11
11
  install: install Let's Eencrypt certbot
12
+ memcached:
13
+ install: install mecached
12
14
  nginx:
13
15
  install: install Nginx
16
+ obs_studio:
17
+ install: install OBS-Studio
18
+ redis:
19
+ install: install Redis
14
20
  unicorn:
15
21
  install: install application as unicorn service
16
22
  vsftpd:
@@ -9,8 +9,14 @@ ja:
9
9
  install: Jenkinsプラグインをインストールします
10
10
  letsencrypt:
11
11
  install: Let's Eencrypt の certbot をインストールします
12
+ memcached:
13
+ install: memcachedをインストールします
12
14
  nginx:
13
15
  install: Nginxをインストールします
16
+ obs_studio:
17
+ install: OBS-Studioをインストールします
18
+ redis:
19
+ install: Redisをインストールします
14
20
  unicorn:
15
21
  install: アプリをUnicornサービスとしてインストールします
16
22
  vsftpd:
@@ -0,0 +1,12 @@
1
+ require_relative 'task_helper'
2
+
3
+ namespace :dad do
4
+ namespace :memcached do
5
+
6
+ desc I18n.t('memcached.install')
7
+ task :install do
8
+ run_itamae 'memcached/install'
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require_relative 'task_helper'
2
+
3
+ namespace :dad do
4
+ namespace :obs_studio do
5
+
6
+ desc I18n.t('obs_studio.install')
7
+ task :install do
8
+ run_itamae 'obs_studio/install'
9
+ end
10
+
11
+ end
12
+ end
data/lib/tasks/redis.rake CHANGED
@@ -3,23 +3,9 @@ require 'rake'
3
3
  namespace :dad do
4
4
  namespace :redis do
5
5
 
6
- desc "Redisをインストールします。"
6
+ desc I18n.t('redis.install')
7
7
  task :install do
8
- script = <<-EOF
9
- #!/bin/bash
10
-
11
- if [ -e /var/run/redis/redis.pid ]; then
12
- sudo /etc/init.d/redis stop
13
- fi
14
-
15
- sudo yum --enablerepo=epel install redis
16
- sudo /sbin/chkconfig redis on
17
- sudo /etc/init.d/redis start
18
- EOF
19
-
20
- tmpfile = File.join(Rails.root, 'tmp', 'dad-redis-install-' + Daddy::Utils::StringUtils.current_time + '.sh')
21
- File.write(tmpfile, ERB.new(script).result)
22
- fail unless system("bash #{tmpfile}")
8
+ run_itamae 'redis/install'
23
9
  end
24
10
 
25
11
  end
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.5.19
4
+ version: 0.5.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-16 00:00:00.000000000 Z
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -260,14 +260,20 @@ files:
260
260
  - itamae/cookbooks/jenkins/install.rb
261
261
  - itamae/cookbooks/jenkins/plugins/install.rb
262
262
  - itamae/cookbooks/letsencrypt/install.rb
263
+ - itamae/cookbooks/memcached/install.rb
263
264
  - itamae/cookbooks/mysql/install.rb
264
265
  - itamae/cookbooks/mysql/mysql_secure_installation.sh
265
266
  - itamae/cookbooks/netdata/install.rb
266
267
  - itamae/cookbooks/netdata/netdata-installer.sh
267
268
  - itamae/cookbooks/nginx/config.rb
268
269
  - itamae/cookbooks/nginx/install.rb
270
+ - itamae/cookbooks/nginx/sha256sum.txt
269
271
  - itamae/cookbooks/nginx/templates/app.conf.erb
272
+ - itamae/cookbooks/nginx/templates/etc/nginx/nginx.conf.erb
273
+ - itamae/cookbooks/nginx/templates/lib/systemd/system/nginx.service.erb
274
+ - itamae/cookbooks/obs_studio/install.rb
270
275
  - itamae/cookbooks/phantomjs/install.rb
276
+ - itamae/cookbooks/redis/install.rb
271
277
  - itamae/cookbooks/unicorn/install.rb
272
278
  - itamae/cookbooks/unicorn/templates/init.d/app.erb
273
279
  - itamae/cookbooks/unicorn/templates/systemd/app.service.erb
@@ -362,9 +368,11 @@ files:
362
368
  - lib/tasks/letsencrypt.rake
363
369
  - lib/tasks/locale/en.yml
364
370
  - lib/tasks/locale/ja.yml
371
+ - lib/tasks/memcached.rake
365
372
  - lib/tasks/mysql.rake
366
373
  - lib/tasks/netdata.rake
367
374
  - lib/tasks/nginx.rake
375
+ - lib/tasks/obs_studio.rake
368
376
  - lib/tasks/phantomjs.rake
369
377
  - lib/tasks/publish.rake
370
378
  - lib/tasks/rails_erd.rake
@@ -408,7 +416,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
408
416
  version: '0'
409
417
  requirements: []
410
418
  rubyforge_project:
411
- rubygems_version: 2.6.4
419
+ rubygems_version: 2.6.11
412
420
  signing_key:
413
421
  specification_version: 4
414
422
  summary: My rails dad