sunzi-rails 0.2.19 → 0.2.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 +4 -4
- data/.ruby-version +1 -1
- data/README.md +2 -3
- data/lib/sunzi/version.rb +2 -2
- data/lib/templates/create/recipes/analysers.sh +3 -1
- data/lib/templates/create/recipes/libraries.sh +1 -0
- data/lib/templates/create/recipes/monit.sh +10 -0
- data/lib/templates/create/recipes/passenger.sh +5 -3
- data/lib/templates/create/recipes/postgres.sh +1 -1
- data/lib/templates/create/recipes/ruby.sh +26 -6
- data/lib/templates/create/roles/deployer.sh +15 -0
- metadata +9 -11
- data/lib/templates/create/recipes/user.sh +0 -23
- data/lib/templates/create/roles/admin.sh +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '03049a27d05453db457ad4c76ff6017e5ff1f044'
|
4
|
+
data.tar.gz: bd53f7cb8e0f7326a16123c26bf7ed6de8873281
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc351baace7b14c6caf42bb0691a7e450d354906527209c3dac1a209ec33456e17ee0202bafa18d63432e8f1a65ed2e679604e78ba69d92ecade1978cda8dcdf
|
7
|
+
data.tar.gz: e25eefa4bcaebfa46265dd7ed5bf8ddc5912ccf0da2d4c21c9e96228a821048f810383751bc118c119800979dcdc2d113e87be7ead04fd06d029dc3ce530e584
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.0
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ Go into your `config/deploy.rb` and make sure to have these set:
|
|
37
37
|
|
38
38
|
```ruby
|
39
39
|
set :ruby_version, IO.read("#{File.dirname(__FILE__)}/../.ruby-version").strip
|
40
|
-
set :admin_name, '
|
40
|
+
set :admin_name, 'deployer'
|
41
41
|
set :deployer_name, 'deployer'
|
42
42
|
```
|
43
43
|
|
@@ -76,8 +76,7 @@ It's important to note that `deploy.rb` and `deploy/[stage].rb` are loaded in th
|
|
76
76
|
Go into the project directory, then run `sunzi-cap deploy`:
|
77
77
|
|
78
78
|
```bash
|
79
|
-
$ sunzi-cap deploy staging
|
80
|
-
$ sunzi-cap deploy staging deployer
|
79
|
+
$ sunzi-cap deploy staging deployer --sudo
|
81
80
|
```
|
82
81
|
|
83
82
|
Now, what it actually does is:
|
data/lib/sunzi/version.rb
CHANGED
@@ -4,13 +4,15 @@ if sunzi.to_be_done "install analysers"; then
|
|
4
4
|
|
5
5
|
sunzi.mute "apt-get update"
|
6
6
|
|
7
|
-
sunzi.install "goaccess"
|
7
|
+
sunzi.install "goaccess"
|
8
8
|
sunzi.install "iotop"
|
9
9
|
sunzi.install "iftop"
|
10
10
|
sunzi.install "ifstat"
|
11
11
|
sunzi.install "nethogs"
|
12
12
|
sunzi.install "sysstat"
|
13
13
|
|
14
|
+
pip install ngxtop
|
15
|
+
|
14
16
|
sed -i 's/#time-format %H:%M:%S/time-format %H:%M:%S/' /etc/goaccess.conf
|
15
17
|
sed -i 's|#date-format %d/%b/%Y|date-format %d/%b/%Y|' /etc/goaccess.conf
|
16
18
|
sed -i 's/#log-format %h %\^\[%d:%t %\^\] "%r" %s %b "%R" "%u"/log-format %h - %\^ \[%d:%t %\^\] "%r" %s %b "%R" "%u" %T %\^/' /etc/goaccess.conf
|
@@ -6,11 +6,13 @@ if sunzi.to_be_done "install passenger"; then
|
|
6
6
|
sunzi.mute "apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7"
|
7
7
|
sunzi.install "apt-transport-https"
|
8
8
|
sunzi.install "ca-certificates"
|
9
|
-
|
9
|
+
|
10
|
+
sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger xenial main > /etc/apt/sources.list.d/passenger.list'
|
10
11
|
sunzi.mute "apt-get update"
|
11
12
|
|
12
|
-
|
13
|
-
sunzi.install "passenger"
|
13
|
+
# Install Passenger + Nginx
|
14
|
+
sunzi.install "nginx-extras passenger"
|
15
|
+
sunzi.sudo_mute "service nginx start"
|
14
16
|
|
15
17
|
sed -i -e "s|# passenger_root|passenger_root|g" /etc/nginx/nginx.conf
|
16
18
|
sed -i -e "s|# passenger_ruby /usr/bin/passenger_free_ruby|passenger_ruby $RBENV_PATH/shims/ruby|g" /etc/nginx/nginx.conf
|
@@ -7,7 +7,7 @@ if sunzi.to_be_done "install postgres"; then
|
|
7
7
|
sunzi.install "postgresql-contrib"
|
8
8
|
sunzi.install "libpq-dev"
|
9
9
|
|
10
|
-
sudo -u postgres psql -c "create user $DB_USER with password '$DB_PWD';"
|
10
|
+
# sudo -u postgres psql -c "create user $DB_USER with password '$DB_PWD';"
|
11
11
|
sudo -u postgres psql -c "create database $DB_NAME owner $DB_USER;"
|
12
12
|
|
13
13
|
sunzi.done "install postgres"
|
@@ -6,23 +6,43 @@ PROFILE=$DEPLOYER_PATH/.bashrc
|
|
6
6
|
RUBY_VERSION=<%= @attributes.ruby_version %>
|
7
7
|
RBENV_EXPORT_PATH="export PATH=\"$RBENV_PATH/bin:$PLUGINS_PATH/ruby-build/bin:$PATH\""
|
8
8
|
RBENV_INIT='eval "$(rbenv init -)"'
|
9
|
+
RUBY_VERSION_PATH="$RBENV_PATH/versions/$RUBY_VERSION"
|
9
10
|
|
10
11
|
if sunzi.to_be_done "install ruby"; then
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
|
13
|
+
if ! [ -d "$RBENV_PATH" ]
|
14
|
+
then
|
15
|
+
git clone git://github.com/sstephenson/rbenv.git $RBENV_PATH
|
16
|
+
git clone git://github.com/sstephenson/ruby-build.git $PLUGINS_PATH/ruby-build
|
17
|
+
git clone git://github.com/sstephenson/rbenv-gem-rehash.git $PLUGINS_PATH/rbenv-gem-rehash
|
18
|
+
git clone git://github.com/dcarley/rbenv-sudo.git $PLUGINS_PATH/rbenv-sudo
|
19
|
+
fi
|
20
|
+
|
21
|
+
# Change user and group to deployer to allow gem installs
|
22
|
+
chown -R deployer:deployer $DEPLOYER_PATH/.rbenv
|
15
23
|
|
16
24
|
eval $RBENV_EXPORT_PATH
|
17
25
|
eval $RBENV_INIT
|
18
26
|
echo $RBENV_EXPORT_PATH >> $PROFILE
|
19
27
|
echo $RBENV_INIT >> $PROFILE
|
20
28
|
|
21
|
-
|
29
|
+
if [ -d "$RUBY_VERSION_PATH" ]
|
30
|
+
then
|
31
|
+
echo 'deleting existing ruby version $RUBY_VERSION_PATH'
|
32
|
+
rm -R $RUBY_VERSION_PATH
|
33
|
+
fi
|
34
|
+
|
35
|
+
echo 'installing ruby version $RUBY_VERSION'
|
36
|
+
rbenv install -v $RUBY_VERSION
|
37
|
+
|
38
|
+
echo 'setting global for ruby version $RUBY_VERSION'
|
22
39
|
rbenv global $RUBY_VERSION
|
40
|
+
|
41
|
+
echo 'setting doc for deployer'
|
23
42
|
echo 'gem: --no-ri --no-rdoc' > $DEPLOYER_PATH/.gemrc
|
43
|
+
|
44
|
+
echo 'install bundler'
|
24
45
|
gem install bundler
|
25
|
-
gem install backup
|
26
46
|
|
27
47
|
sunzi.done "install ruby"
|
28
48
|
fi
|
@@ -2,6 +2,21 @@ sunzi.setup_progress
|
|
2
2
|
|
3
3
|
start=$(sunzi.start_time)
|
4
4
|
|
5
|
+
source recipes/setup.sh
|
6
|
+
source recipes/libraries.sh
|
5
7
|
source recipes/ruby.sh
|
8
|
+
source recipes/nodejs.sh
|
9
|
+
<% case @attributes.db_adapter -%>
|
10
|
+
<% when 'postgresql' -%>
|
11
|
+
source recipes/postgres.sh
|
12
|
+
<% when 'mysql', 'mysql2' -%>
|
13
|
+
source recipes/mysql.sh
|
14
|
+
<% end -%>
|
15
|
+
source recipes/passenger.sh
|
16
|
+
source recipes/logrotate.sh
|
17
|
+
source recipes/noatime.sh
|
18
|
+
source recipes/monit.sh
|
6
19
|
|
7
20
|
sunzi.elapsed_time $start
|
21
|
+
|
22
|
+
# reboot
|
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.
|
4
|
+
version: 0.2.20
|
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:
|
12
|
+
date: 2017-01-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -17,20 +17,20 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 4.2.6
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 4.2.0
|
23
|
+
version: 4.2.6.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
28
|
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
30
|
+
version: 4.2.6
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.2.0
|
33
|
+
version: 4.2.6.0
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: thor
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- lib/templates/create/recipes/analysers.sh
|
131
131
|
- lib/templates/create/recipes/libraries.sh
|
132
132
|
- lib/templates/create/recipes/logrotate.sh
|
133
|
+
- lib/templates/create/recipes/monit.sh
|
133
134
|
- lib/templates/create/recipes/mysql.sh
|
134
135
|
- lib/templates/create/recipes/noatime.sh
|
135
136
|
- lib/templates/create/recipes/nodejs.sh
|
@@ -139,8 +140,6 @@ files:
|
|
139
140
|
- lib/templates/create/recipes/setup.sh
|
140
141
|
- lib/templates/create/recipes/sunzi.sh
|
141
142
|
- lib/templates/create/recipes/update.sh
|
142
|
-
- lib/templates/create/recipes/user.sh
|
143
|
-
- lib/templates/create/roles/admin.sh
|
144
143
|
- lib/templates/create/roles/deployer.sh
|
145
144
|
- lib/templates/create/roles/updater.sh
|
146
145
|
- lib/templates/create/sunzi.yml
|
@@ -157,7 +156,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
157
156
|
requirements:
|
158
157
|
- - ">="
|
159
158
|
- !ruby/object:Gem::Version
|
160
|
-
version: 2.
|
159
|
+
version: 2.4.0
|
161
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
161
|
requirements:
|
163
162
|
- - ">="
|
@@ -165,9 +164,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
164
|
version: '0'
|
166
165
|
requirements: []
|
167
166
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.6.8
|
169
168
|
signing_key:
|
170
169
|
specification_version: 4
|
171
170
|
summary: Server provisioning utility for minimalists
|
172
171
|
test_files: []
|
173
|
-
has_rdoc:
|
@@ -1,23 +0,0 @@
|
|
1
|
-
DEPLOYER_NAME=<%= @attributes.deployer_name %>
|
2
|
-
DEPLOYER_PWD=<%= @attributes.deployer_password %>
|
3
|
-
DEPLOYER_PATH=/home/$DEPLOYER_NAME
|
4
|
-
|
5
|
-
if sunzi.to_be_done "create deployer"; then
|
6
|
-
adduser $DEPLOYER_NAME --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password
|
7
|
-
echo "$DEPLOYER_NAME:$DEPLOYER_PWD" | sudo chpasswd
|
8
|
-
adduser $DEPLOYER_NAME sudo
|
9
|
-
|
10
|
-
mkdir $DEPLOYER_PATH/.ssh
|
11
|
-
chmod 700 $DEPLOYER_PATH/.ssh
|
12
|
-
|
13
|
-
mv files/authorized_keys $DEPLOYER_PATH/.ssh/authorized_keys
|
14
|
-
chmod 644 $DEPLOYER_PATH/.ssh/authorized_keys
|
15
|
-
|
16
|
-
chown -R $DEPLOYER_NAME:$DEPLOYER_NAME $DEPLOYER_PATH
|
17
|
-
|
18
|
-
mv files/sudoers /etc/sudoers.d/$DEPLOYER_NAME
|
19
|
-
chown root:root /etc/sudoers.d/$DEPLOYER_NAME
|
20
|
-
chmod 0440 /etc/sudoers.d/$DEPLOYER_NAME
|
21
|
-
|
22
|
-
sunzi.done "create deployer"
|
23
|
-
fi
|
@@ -1,22 +0,0 @@
|
|
1
|
-
sunzi.setup_progress
|
2
|
-
|
3
|
-
start=$(sunzi.start_time)
|
4
|
-
|
5
|
-
source recipes/setup.sh
|
6
|
-
source recipes/libraries.sh
|
7
|
-
source recipes/nodejs.sh
|
8
|
-
<% case @attributes.db_adapter -%>
|
9
|
-
<% when 'postgresql' -%>
|
10
|
-
source recipes/postgres.sh
|
11
|
-
<% when 'mysql', 'mysql2' -%>
|
12
|
-
source recipes/mysql.sh
|
13
|
-
<% end -%>
|
14
|
-
source recipes/passenger.sh
|
15
|
-
source recipes/user.sh
|
16
|
-
source recipes/analysers.sh
|
17
|
-
source recipes/logrotate.sh
|
18
|
-
source recipes/noatime.sh
|
19
|
-
|
20
|
-
sunzi.elapsed_time $start
|
21
|
-
|
22
|
-
reboot
|