sunzi-rails 0.2.15 → 0.2.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7352a278de207b6cb7fc6f7f6036737098a38778
4
- data.tar.gz: f389f62f048975d04d7f76cd4840304eae8201fd
3
+ metadata.gz: cd0647135cab2984456b5b16552e119fcac36910
4
+ data.tar.gz: 5d75cef20a7a01c113d1d3dfa87e72b3e9f538e4
5
5
  SHA512:
6
- metadata.gz: ed4626cbfd6f70ac9fb06639a06b2be7707c37a73123a8f98405e3401e2789bf412c9fa55f665cd71fb1b5cb6faef7a2cdeaa93e0864a38c8937a47db4619b16
7
- data.tar.gz: c22f84f8597fe50e63d2417928ced30de234342a6c3a6cdaf75f54b82ba4cf0d582733be54aed5560e8b9413c7ccbc9a06e1e887f6c67d273003b5d1037887e6
6
+ metadata.gz: dae65e6a0d65e9788c53bc3ae5213922ec1e83f05ca91d9c49146f4acebe2d3dc91d504fb16c07092c4b19f6af6c0d0666904a810f6f1010d093996c5a175229
7
+ data.tar.gz: 8c4aa0f48fbfe6934801d88b24bf245df81716985d6aae466769e5ea53ca9fc661ebafee17eed158f06306155bd23e7efe2b848c236a2304fe6996d0b0c6b043
data/README.md CHANGED
@@ -60,7 +60,7 @@ Finally, add `/compiled` to your `.gitignore` file.
60
60
 
61
61
  All those settings can be overriden in your `sunzi.yml` file within `attributes`.
62
62
 
63
- Also, contextual attributes are available through `@attributes`:
63
+ Also, deploy.rb, deploy/[stage].rb, database.yml (prefixed with `db_`), secrets.yml and contextual attributes (prefixed with `env_`) are available through `@attributes`:
64
64
 
65
65
  ```ruby
66
66
  @attributes.env_stage
data/lib/sunzi/cli.rb CHANGED
@@ -103,18 +103,14 @@ module Sunzi
103
103
 
104
104
  @config = YAML.load(File.read(based("sunzi.yml")))
105
105
 
106
- @attributes = Database.load_env(@stage)
107
- .merge(cap.slice(:ruby_version, :deployer_name))
108
- .merge(Secrets.load_env(@stage).slice(:deployer_password, :deployer_public_key))
109
- .merge(
110
- env_stage: @stage,
111
- env_role: @role,
112
- env_sudo: options.sudo?,
113
- env_user: @user,
114
- env_host: @host,
115
- env_port: @port
116
- )
117
- .merge(@config['attributes'] || {})
106
+ @attributes = cap.merge(Database.load_env(@stage)).merge(Secrets.load_env(@stage)).merge(
107
+ env_stage: @stage,
108
+ env_role: @role,
109
+ env_sudo: options.sudo?,
110
+ env_user: @user,
111
+ env_host: @host,
112
+ env_port: @port
113
+ ).merge(@config['attributes'] || {})
118
114
  end
119
115
 
120
116
  def compile_attributes
data/lib/sunzi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Sunzi
2
- VERSION = "0.2.15"
2
+ VERSION = "0.2.16"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
4
  RAILS_VERSION = "4.2"
5
5
  end
@@ -0,0 +1,9 @@
1
+ <%= @attributes.deploy_to %>/current/log/*.log {
2
+ weekly
3
+ missingok
4
+ rotate 6
5
+ compress
6
+ delaycompress
7
+ notifempty
8
+ copytruncate
9
+ }
@@ -0,0 +1,15 @@
1
+ if sunzi.to_be_done "install analysers"; then
2
+ echo "deb http://deb.goaccess.io/ $(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/goaccess.list
3
+ wget -O - http://deb.goaccess.io/gnugpg.key | apt-key add -
4
+
5
+ sunzi.mute "apt-get update"
6
+
7
+ sunzi.install "goaccess"
8
+ sunzi.install "iotop"
9
+ sunzi.install "sysstat"
10
+
11
+ sed -i 's/ENABLED="false"/ENABLED="true"/' /etc/default/sysstat
12
+ /etc/init.d/sysstat restart
13
+
14
+ sunzi.done "install analysers"
15
+ fi
@@ -0,0 +1,7 @@
1
+ if sunzi.to_be_done "setup logrotate"; then
2
+ mv files/rails_logs /etc/logrotate.d/rails_logs
3
+ chown root:root /etc/logrotate.d/rails_logs
4
+ chmod 0644 /etc/logrotate.d/rails_logs
5
+
6
+ sunzi.done "setup logrotate"
7
+ fi
@@ -13,7 +13,8 @@ source recipes/mysql.sh
13
13
  <% end -%>
14
14
  source recipes/passenger.sh
15
15
  source recipes/user.sh
16
- source recipes/sysstat.sh
16
+ source recipes/analysers.sh
17
+ source recipes/logrotate.sh
17
18
 
18
19
  sunzi.elapsed_time $start
19
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunzi-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
4
+ version: 0.2.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-26 00:00:00.000000000 Z
12
+ date: 2016-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -124,9 +124,12 @@ files:
124
124
  - lib/sunzi/utility.rb
125
125
  - lib/sunzi/version.rb
126
126
  - lib/templates/create/files/authorized_keys
127
+ - lib/templates/create/files/rails_logs
127
128
  - lib/templates/create/files/sudoers
128
129
  - lib/templates/create/install.sh
130
+ - lib/templates/create/recipes/analysers.sh
129
131
  - lib/templates/create/recipes/libraries.sh
132
+ - lib/templates/create/recipes/logrotate.sh
130
133
  - lib/templates/create/recipes/mysql.sh
131
134
  - lib/templates/create/recipes/nodejs.sh
132
135
  - lib/templates/create/recipes/passenger.sh
@@ -134,7 +137,6 @@ files:
134
137
  - lib/templates/create/recipes/ruby.sh
135
138
  - lib/templates/create/recipes/setup.sh
136
139
  - lib/templates/create/recipes/sunzi.sh
137
- - lib/templates/create/recipes/sysstat.sh
138
140
  - lib/templates/create/recipes/update.sh
139
141
  - lib/templates/create/recipes/user.sh
140
142
  - lib/templates/create/roles/admin.sh
@@ -167,3 +169,4 @@ signing_key:
167
169
  specification_version: 4
168
170
  summary: Server provisioning utility for minimalists
169
171
  test_files: []
172
+ has_rdoc:
@@ -1,9 +0,0 @@
1
- if sunzi.to_be_done "install sysstat"; then
2
- sunzi.install "sysstat"
3
- sunzi.install "iotop"
4
-
5
- sed -i 's/ENABLED="false"/ENABLED="true"/' /etc/default/sysstat
6
- /etc/init.d/sysstat restart
7
-
8
- sunzi.done "install sysstat"
9
- fi