daddy 0.5.10 → 0.5.11

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: db70066d2a9e10ed814aaae0ce58e5138584bf03
4
- data.tar.gz: 0f213755b5c314da4411776e90ebbb9d4401b378
3
+ metadata.gz: 6308ad7d7552c30d5902d7b5ae50e68b94a6ef9e
4
+ data.tar.gz: 2676b801407bbaa36218ff66eefe66c1b96a0231
5
5
  SHA512:
6
- metadata.gz: 68f91cc8832c19adb4422bed1a300297189487f5a9e0421717b311ff1501466a91943e739d5d3b611ed8a4b7d0e5572d56adaca62cb3b5b77549ec7de0248836
7
- data.tar.gz: 7dd6fa6711ff3615bfb02d2b645570dd9fe4a51f62ac0b64db9c9951dfcd810c42c7df2eb176b62dbfb59a7c009872bb19c6d1ef8408ac515cd152d49666ab33
6
+ metadata.gz: 930548cd6b99fa4a6a13a4326cadd7b3d2497dff2342285b89fc12419d445c1a96bdd9e44fd18ee45aab4c3e511e2fe07db1c7ee80afb6771828f68ca3588fab
7
+ data.tar.gz: 4c1ba131807d6b44453b4ce054dd6244087bf3b27f10a487b785b6b808e7db9e394e98cb4b737875881d42eff4ec42f9afdd1df1310bcea464d32d5bcdd75e72
@@ -13,7 +13,7 @@ when /rhel-7\.(.*?)/
13
13
  user 'root'
14
14
  end
15
15
  else
16
- raise "サポートしていないOSバージョンです。#{@os_version}"
16
+ raise I18n.t('itamae.errors.unsupported_os_version', :os_version => @os_version)
17
17
  end
18
18
 
19
19
  execute 'rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key' do
@@ -45,10 +45,7 @@ service 'jenkins' do
45
45
  action [:enable, :start]
46
46
  end
47
47
 
48
- directory 'tmp'
49
-
50
48
  execute "wait until jenkins starts" do
51
- cwd 'tmp'
52
49
  command <<-EOF
53
50
  wget --retry-connrefused -t 10 #{ENV['DAD_JENKINS_URL']} ||
54
51
  wget -t 10 #{ENV['DAD_JENKINS_URL']} ||
@@ -56,37 +53,51 @@ execute "wait until jenkins starts" do
56
53
  EOF
57
54
  end
58
55
 
59
- execute 'wget jenkins-cli.jar' do
60
- cwd 'tmp'
61
- command "wget #{ENV['DAD_JENKINS_URL']}/jnlpJars/jenkins-cli.jar"
62
- not_if 'test -e jenkins-cli.jar'
56
+ directory '/var/lib/jenkins/.ssh' do
57
+ user 'root'
58
+ owner 'jenkins'
59
+ group 'jenkins'
60
+ mode '700'
61
+ end
62
+
63
+ execute "ssh-keygen -f id_rsa -q -N ''" do
64
+ user 'jenkins'
65
+ cwd '/var/lib/jenkins/.ssh'
66
+ not_if 'test -e id_rsa'
63
67
  end
64
68
 
65
- directory '/var/lib/jenkins/plugins' do
69
+ file '/var/lib/jenkins/.ssh/authorized_keys' do
66
70
  user 'root'
67
- group 'jenkins'
68
- owner 'jenkins'
69
71
  end
70
72
 
71
- @plugins = [
72
- {:name => 'ansicolor', :version => nil},
73
- {:name => 'build-pipeline-plugin', :version => nil},
74
- {:name => 'git', :version => nil},
75
- {:name => 'git-client', :version => nil},
76
- {:name => 'rake', :version => nil},
77
- {:name => 'rubyMetrics', :version => nil},
78
- {:name => 'htmlpublisher', :version => nil},
79
- {:name => 'reverse-proxy-auth-plugin', :version => nil},
80
- {:name => 'thinBackup', :version => nil}
81
- ]
82
- @plugins.each do |plugin|
83
- execute "/var/lib/jenkins/plugins/#{plugin[:name]}" do
84
- cwd 'tmp'
85
- command "java -jar jenkins-cli.jar -s #{ENV['DAD_JENKINS_URL']} install-plugin #{plugin[:name]}"
73
+ %w{ authorized_keys id_rsa id_rsa.pub }.each do |name|
74
+ file name do
75
+ cwd '/var/lib/jenkins/.ssh'
76
+ user 'root'
77
+ owner 'jenkins'
78
+ group 'jenkins'
79
+ mode '600'
86
80
  end
87
81
  end
88
82
 
89
- execute 'restart jenkins' do
90
- cwd 'tmp'
91
- command "java -jar jenkins-cli.jar -s #{ENV['DAD_JENKINS_URL']} safe-restart"
83
+ execute 'add public key' do
84
+ user 'root'
85
+ cwd '/var/lib/jenkins/.ssh'
86
+ command 'cat id_rsa.pub >> authorized_keys'
87
+ not_if "cat authorized_keys | grep \"`cat id_rsa.pub`\""
88
+ end
89
+
90
+ execute '/etc/init.d/jenkins restart' do
91
+ user 'root'
92
+ end
93
+
94
+ local_ruby_block 'post install message' do
95
+ block do
96
+ message = I18n.t('itamae.messages.jenkins.after_install',
97
+ :jenkins_url => ENV['DAD_JENKINS_URL'],
98
+ :public_key => `sudo cat /var/lib/jenkins/.ssh/id_rsa.pub`)
99
+ message.split("\n").each do |line|
100
+ Itamae.logger.info line
101
+ end
102
+ end
92
103
  end
@@ -0,0 +1,42 @@
1
+ require 'daddy/itamae'
2
+
3
+ ENV['DAD_JENKINS_URL'] ||= 'http://localhost:8080'
4
+
5
+ execute 'wget jenkins-cli.jar' do
6
+ cwd '/tmp'
7
+ command "wget #{ENV['DAD_JENKINS_URL']}/jnlpJars/jenkins-cli.jar"
8
+ not_if 'test -e jenkins-cli.jar'
9
+ end
10
+
11
+ directory '/var/lib/jenkins/plugins' do
12
+ user 'root'
13
+ group 'jenkins'
14
+ owner 'jenkins'
15
+ end
16
+
17
+ @plugins = [
18
+ {:name => 'ansicolor', :version => nil},
19
+ {:name => 'build-pipeline-plugin', :version => nil},
20
+ {:name => 'git', :version => nil},
21
+ {:name => 'git-client', :version => nil},
22
+ {:name => 'rake', :version => nil},
23
+ {:name => 'rubyMetrics', :version => nil},
24
+ {:name => 'htmlpublisher', :version => nil},
25
+ {:name => 'reverse-proxy-auth-plugin', :version => nil},
26
+ {:name => 'thinBackup', :version => nil}
27
+ ]
28
+ @plugins.each do |plugin|
29
+ options = "-s #{ENV['DAD_JENKINS_URL']} -i /var/lib/jenkins/.ssh/id_rsa"
30
+ execute "/var/lib/jenkins/plugins/#{plugin[:name]}" do
31
+ cwd '/tmp'
32
+ user 'jenkins'
33
+ command "java -jar jenkins-cli.jar #{options} install-plugin #{plugin[:name]}"
34
+ not_if "java -jar jenkins-cli.jar #{options} list-plugins | grep #{plugin[:name]}"
35
+ end
36
+ end
37
+
38
+ execute 'restart jenkins' do
39
+ cwd '/tmp'
40
+ user 'jenkins'
41
+ command "java -jar jenkins-cli.jar -s #{ENV['DAD_JENKINS_URL']} -i /var/lib/jenkins/.ssh/id_rsa safe-restart"
42
+ end
@@ -0,0 +1,24 @@
1
+ require 'daddy/itamae'
2
+
3
+ %w{ zlib-devel gcc make git autoconf autogen automake pkgconfig }.each do |name|
4
+ package name do
5
+ user 'root'
6
+ end
7
+ end
8
+
9
+ directory '/opt/src' do
10
+ user 'root'
11
+ owner ENV['USER']
12
+ group ENV['USER']
13
+ end
14
+
15
+ git 'netdata' do
16
+ destination '/opt/src/netdata'
17
+ repository 'https://github.com/firehol/netdata.git'
18
+ end
19
+
20
+ execute 'netdata-installer.sh' do
21
+ user 'root'
22
+ cwd '/tmp/netdata'
23
+ command "bash #{File.join(File.dirname(__FILE__), 'netdata-installer.sh')}"
24
+ end
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+ expect -c "
4
+ spawn ./netdata-installer.sh --install /opt
5
+ expect \"Press Control-C and run the same command with --help for help.\"
6
+ send \"\n\"
7
+ interact
8
+ "
data/itamae/locale/en.yml CHANGED
@@ -1,4 +1,13 @@
1
1
  en:
2
2
  itamae:
3
3
  errors:
4
- unsupported_os_version: unsupported os version. %{os_version}
4
+ unsupported_os_version: unsupported os version. %{os_version}
5
+ messages:
6
+ jenkins:
7
+ after_install: |
8
+ installation completed.
9
+ access %{jenkins_url} and add first user.
10
+ use public key below.
11
+
12
+ %{public_key}
13
+
data/itamae/locale/ja.yml CHANGED
@@ -1,4 +1,13 @@
1
1
  ja:
2
2
  itamae:
3
3
  errors:
4
- unsupported_os_version: サポートしていないOSバージョンです。%{os_version}
4
+ unsupported_os_version: サポートしていないOSバージョンです。%{os_version}
5
+ messages:
6
+ jenkins:
7
+ after_install: |
8
+ インストールが完了しました。
9
+ %{jenkins_url} にアクセスし、最初のユーザを登録します。
10
+ 下記公開鍵を設定します。
11
+
12
+ %{public_key}
13
+
@@ -44,8 +44,9 @@ JENKINS_USER="jenkins"
44
44
  #
45
45
  # Options to pass to java when running Jenkins.
46
46
  #
47
- JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true ${JENKINS_JAVA_OPTIONS}"
47
+ JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
48
48
  JENKINS_JAVA_OPTIONS="-Dhudson.model.DirectoryBrowserSupport.CSP=\"sandbox allow-same-origin allow-scripts; default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline';\" ${JENKINS_JAVA_OPTIONS}"
49
+ JENKINS_JAVA_OPTIONS="-Dhudson.diyChunking=false ${JENKINS_JAVA_OPTIONS}"
49
50
 
50
51
  ## Type: integer(0:65535)
51
52
  ## Default: 8080
@@ -101,24 +102,6 @@ JENKINS_HTTPS_KEYSTORE_PASSWORD=""
101
102
  #
102
103
  JENKINS_HTTPS_LISTEN_ADDRESS=""
103
104
 
104
- ## Type: integer(0:65535)
105
- ## Default: 8009
106
- ## ServiceRestart: jenkins
107
- #
108
- # Ajp13 Port Jenkins is listening on.
109
- # Set to -1 to disable
110
- #
111
- JENKINS_AJP_PORT="-1"
112
-
113
- ## Type: string
114
- ## Default: ""
115
- ## ServiceRestart: jenkins
116
- #
117
- # IP address Jenkins listens on for Ajp13 requests.
118
- # Default is all interfaces (0.0.0.0).
119
- #
120
- JENKINS_AJP_LISTEN_ADDRESS=""
121
-
122
105
  ## Type: integer(1:9)
123
106
  ## Default: 5
124
107
  ## ServiceRestart: jenkins
data/lib/daddy/itamae.rb CHANGED
@@ -36,7 +36,7 @@ end
36
36
 
37
37
  require 'i18n'
38
38
  I18n.available_locales = [:en, :ja]
39
- I18n.default_locale = ENV['LANG'].start_with?('ja_') ? :ja : en
39
+ I18n.default_locale = ENV['LANG'].start_with?('ja_') ? :ja : :en
40
40
  I18n.load_path += Dir.glob(File.expand_path('../../../itamae/locale/*.yml', __FILE__))
41
41
 
42
42
  Dir[File.join(File.dirname(__FILE__), 'itamae', '*.rb')].each do |f|
data/lib/daddy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Daddy
2
- VERSION = '0.5.10'
2
+ VERSION = '0.5.11'
3
3
  end
@@ -3,13 +3,13 @@ require_relative 'task_helper'
3
3
  namespace :dad do
4
4
  namespace :jenkins do
5
5
 
6
- desc 'Jenkinsをインストールします。'
6
+ desc I18n.t('jenkins.install')
7
7
  task :install do
8
8
  run_itamae 'jenkins/install'
9
9
  end
10
10
 
11
11
  namespace :nginx do
12
- desc 'Nginxの設定を行います。'
12
+ desc 'Nginxの設定を行います'
13
13
  task :config do
14
14
  @server_name = ask('server_name', :required => true)
15
15
  @ssl_certificate = ask('ssl_certificate')
@@ -23,5 +23,12 @@ namespace :dad do
23
23
  end
24
24
  end
25
25
 
26
+ namespace :plugins do
27
+ desc I18n.t('jenkins.plugins.install')
28
+ task :install do
29
+ run_itamae 'jenkins/plugins/install'
30
+ end
31
+ end
32
+
26
33
  end
27
34
  end
@@ -1,3 +1,7 @@
1
1
  en:
2
2
  god:
3
- install: install God
3
+ install: install God
4
+ jenkins:
5
+ install: install Jenkins
6
+ plugins:
7
+ install: install Jenkins plugins
@@ -1,3 +1,7 @@
1
- en:
1
+ ja:
2
2
  god:
3
- install: God をインストールします
3
+ install: God をインストールします
4
+ jenkins:
5
+ install: Jenkinsをインストールします
6
+ plugins:
7
+ install: Jenkinsプラグインをインストールします
@@ -0,0 +1,12 @@
1
+ require_relative 'task_helper'
2
+
3
+ namespace :dad do
4
+ namespace :netdata do
5
+
6
+ desc 'netdataをインストールします。'
7
+ task :install do
8
+ run_itamae 'netdata/install'
9
+ end
10
+
11
+ end
12
+ 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.10
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - ichy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-26 00:00:00.000000000 Z
11
+ date: 2016-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.6'
19
+ version: '2.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.6'
26
+ version: '2.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: closer
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.0'
55
- - !ruby/object:Gem::Dependency
56
- name: database_cleaner
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.5'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.5'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: faraday
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -112,16 +98,16 @@ dependencies:
112
98
  name: itamae
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - "~>"
101
+ - - '='
116
102
  - !ruby/object:Gem::Version
117
- version: '1.9'
103
+ version: 1.9.4
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - "~>"
108
+ - - '='
123
109
  - !ruby/object:Gem::Version
124
- version: '1.9'
110
+ version: 1.9.4
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: ohai
127
113
  requirement: !ruby/object:Gem::Requirement
@@ -234,6 +220,20 @@ dependencies:
234
220
  - - "~>"
235
221
  - !ruby/object:Gem::Version
236
222
  version: '0.2'
223
+ - !ruby/object:Gem::Dependency
224
+ name: database_cleaner
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '1.5'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '1.5'
237
237
  description: Daddy helps me build web applications since daddy knows some good practices.
238
238
  email: ichylinux@gmail.com
239
239
  executables:
@@ -251,8 +251,11 @@ files:
251
251
  - itamae/cookbooks/docker/registry/install.rb
252
252
  - itamae/cookbooks/god/install.rb
253
253
  - itamae/cookbooks/jenkins/install.rb
254
+ - itamae/cookbooks/jenkins/plugins/install.rb
254
255
  - itamae/cookbooks/mysql/install.rb
255
256
  - itamae/cookbooks/mysql/mysql_secure_installation.sh
257
+ - itamae/cookbooks/netdata/install.rb
258
+ - itamae/cookbooks/netdata/netdata-installer.sh
256
259
  - itamae/cookbooks/phantomjs/install.rb
257
260
  - itamae/locale/en.yml
258
261
  - itamae/locale/ja.yml
@@ -334,6 +337,7 @@ files:
334
337
  - lib/tasks/locale/en.yml
335
338
  - lib/tasks/locale/ja.yml
336
339
  - lib/tasks/mysql.rake
340
+ - lib/tasks/netdata.rake
337
341
  - lib/tasks/nginx.rake
338
342
  - lib/tasks/nginx/app.conf.erb
339
343
  - lib/tasks/nginx/empty.conf.erb
@@ -382,7 +386,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
382
386
  version: '0'
383
387
  requirements: []
384
388
  rubyforge_project:
385
- rubygems_version: 2.6.2
389
+ rubygems_version: 2.6.4
386
390
  signing_key:
387
391
  specification_version: 4
388
392
  summary: My rails dad