capistrano3-ubuntu-server-prepare 0.0.4 → 0.0.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 583701c11eb0e32240dd49f1173737e8990833f8
|
4
|
+
data.tar.gz: 2f79e06d5b224218dff79da08cf3c2aa8f3a1fba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7eee19267314b91b0f6c6c163f35785da218064d5f6433a87413ea862e729617143cde068a8563d416f177f8547eb0d6568919d4ed0f14be2f0d9b3f1ef898f
|
7
|
+
data.tar.gz: f6c903187aafb6941240b0b88be073a95686d09797432ddc17b5c8a8ba6296771c05ee1e3b70e21c598ebfba656bae52cbeceeef481dffaa7a54e51a32e5440a
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "capistrano3-ubuntu-server-prepare"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.5"
|
8
8
|
spec.authors = ["goooseman"]
|
9
9
|
spec.email = ["inbox@goooseman.ru"]
|
10
10
|
spec.summary = "A task for Capistrano v3 to prepare Ubuntu 14.04 server for first deployment"
|
Binary file
|
@@ -279,113 +279,9 @@ namespace :ubuntu_server_prepare do
|
|
279
279
|
execute "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3"
|
280
280
|
execute "\\curl -sSL https://get.rvm.io | bash -s stable --rails --gems=bundler --autolibs=read-fail"
|
281
281
|
end
|
282
|
-
<<<<<<< HEAD
|
283
|
-
end
|
284
|
-
|
285
|
-
execute "mkdir -p ~/sources/nginx/conf"
|
286
|
-
user = capture("echo $USER")
|
287
|
-
if fetch :pagespeed_install
|
288
|
-
upload! 'config/production/nginx/nginx_with_pagespeed.conf', "/home/#{user}/sources/nginx/conf/nginx.conf"
|
289
|
-
else
|
290
|
-
upload! 'config/production/nginx/nginx.conf', "/home/#{user}/sources/nginx/conf/nginx.conf"
|
291
|
-
end
|
292
|
-
upload! 'config/production/nginx/upstart.conf', "/home/#{user}/sources/nginx/conf/"
|
293
|
-
execute sudo_command + "cp -f ~/sources/nginx/conf/upstart.conf /etc/init/nginx.conf"
|
294
|
-
execute sudo_command + "cp -f ~/sources/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf"
|
295
|
-
nginx_status = capture(sudo_command + "status nginx")
|
296
|
-
if nginx_status == 'nginx stop/waiting'
|
297
|
-
execute sudo_command + "start nginx"
|
298
|
-
else
|
299
|
-
execute sudo_command + 'restart nginx'
|
300
|
-
end
|
301
|
-
=======
|
302
|
-
>>>>>>> 3b841ddc013973d608456aa8839726cdf98cb11e
|
303
282
|
end
|
304
283
|
|
305
284
|
|
306
|
-
<<<<<<< HEAD
|
307
|
-
execute sudo_command + "apt-get install -y postgresql-9.3 postgresql-server-dev-9.3"
|
308
|
-
execute sudo_command + "-u postgres psql -c \"create user #{fetch :postgre_username} with password '#{fetch :postgre_password}';\""
|
309
|
-
execute sudo_command + "-u postgres psql -c \"alter role #{fetch :postgre_username} superuser createrole createdb replication;\""
|
310
|
-
end
|
311
|
-
end
|
312
|
-
|
313
|
-
desc 'Install Redis'
|
314
|
-
task :redis_install do
|
315
|
-
on roles(:all) do
|
316
|
-
execute "mkdir -p ~/sources/redis"
|
317
|
-
execute sudo_command + "apt-get install -y tcl8.5"
|
318
|
-
within "~/sources/redis" do
|
319
|
-
execute :wget, "http://download.redis.io/redis-stable.tar.gz"
|
320
|
-
execute :tar, "xvzf redis-stable.tar.gz"
|
321
|
-
end
|
322
|
-
within "~/sources/redis/redis-stable" do
|
323
|
-
execute :make
|
324
|
-
end
|
325
|
-
execute sudo_command + "cp -f ~/sources/redis/redis-stable/src/redis-server /usr/local/bin/"
|
326
|
-
execute sudo_command + "cp -f ~/sources/redis/redis-stable/src/redis-cli /usr/local/bin/"
|
327
|
-
execute sudo_command + "mkdir -p /etc/redis/"
|
328
|
-
execute sudo_command + "cp ~/sources/redis/redis-stable/redis.conf /etc/redis/"
|
329
|
-
end
|
330
|
-
end
|
331
|
-
|
332
|
-
desc 'Configure Redis'
|
333
|
-
task :redis_conf do
|
334
|
-
on roles(:all) do
|
335
|
-
user = capture("echo $USER")
|
336
|
-
execute sudo_command + "mkdir -p /var/www/other"
|
337
|
-
execute sudo_command + "mkdir -p /var/www/log"
|
338
|
-
execute sudo_command + "chgrp -R web /var/www"
|
339
|
-
execute sudo_command + "chmod -R 775 /var/www"
|
340
|
-
execute sudo_command + "chown -R #{user} /var/www"
|
341
|
-
execute "mkdir -p ~/sources/redis/conf"
|
342
|
-
|
343
|
-
upload! 'config/production/redis/redis.conf', "/home/#{user}/sources/redis/conf/"
|
344
|
-
upload! 'config/production/redis/upstart.conf', "/home/#{user}/sources/redis/conf/"
|
345
|
-
execute sudo_command + "cp -f ~/sources/redis/conf/upstart.conf /etc/init/redis-server.conf"
|
346
|
-
execute sudo_command + "cp -f ~/sources/redis/conf/redis.conf /etc/redis/"
|
347
|
-
|
348
|
-
redis_status = capture(sudo_command + "status redis-server")
|
349
|
-
if redis_status == 'redis-server stop/waiting'
|
350
|
-
execute sudo_command + "start redis-server"
|
351
|
-
else
|
352
|
-
execute sudo_command + 'restart redis-server'
|
353
|
-
end
|
354
|
-
end
|
355
|
-
end
|
356
|
-
|
357
|
-
desc 'Install RVM with rails'
|
358
|
-
task :rvm_install do
|
359
|
-
on roles(:all) do
|
360
|
-
execute sudo_command + 'apt-get -y install git curl python-software-properties software-properties-common'
|
361
|
-
execute sudo_command + 'add-apt-repository -y ppa:chris-lea/node.js'
|
362
|
-
execute sudo_command + 'apt-get update'
|
363
|
-
execute sudo_command + 'apt-get -y install nodejs gawk g++ gcc make libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev'
|
364
|
-
execute "gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3"
|
365
|
-
execute "\\curl -sSL https://get.rvm.io | bash -s stable --rails --gems=bundler --autolibs=read-fail"
|
366
|
-
end
|
367
|
-
end
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
desc 'Push ssh key to server'
|
372
|
-
task :push_ssh_keys do
|
373
|
-
on roles(:all) do
|
374
|
-
files = Dir.glob(Dir.home() + '/.ssh/*').select { |f| f !~ /\.pub|known|config/ }.map {|f| f.gsub!(Dir.home(), '~')}
|
375
|
-
set :key_localtion, ask("private key location (for example: #{files.join(', ')})", '~/.ssh/id_rsa') if !fetch :key_localtion
|
376
|
-
home = Dir.home()
|
377
|
-
key_location = fetch(:key_localtion).gsub('~', home)
|
378
|
-
until File.exists? key_location
|
379
|
-
set :key_localtion, ask("private key location (for example: #{files.join(', ')})", '~/.ssh/id_rsa')
|
380
|
-
key_location = fetch(:key_localtion).gsub('~', home)
|
381
|
-
end
|
382
|
-
execute "mkdir -p ~/.ssh"
|
383
|
-
user = capture("echo $USER")
|
384
|
-
upload! key_location, "/home/#{user}/.ssh/git_key"
|
385
|
-
upload! key_location + '.pub', "/home/#{user}/.ssh/git_key.pub"
|
386
|
-
execute "echo 'IdentityFile ~/.ssh/git_key' >> ~/.ssh/config"
|
387
|
-
execute "chmod -f 600 ~/.ssh/*"
|
388
|
-
=======
|
389
285
|
|
390
286
|
desc 'Push ssh key to server'
|
391
287
|
task :push_ssh_keys do
|
@@ -405,7 +301,6 @@ namespace :ubuntu_server_prepare do
|
|
405
301
|
execute "echo 'IdentityFile ~/.ssh/git_key' >> ~/.ssh/config"
|
406
302
|
execute "chmod -f 600 ~/.ssh/*"
|
407
303
|
end
|
408
|
-
>>>>>>> 3b841ddc013973d608456aa8839726cdf98cb11e
|
409
304
|
end
|
410
305
|
|
411
306
|
desc 'Install additional packages'
|
@@ -442,4 +337,4 @@ namespace :ubuntu_server_prepare do
|
|
442
337
|
end
|
443
338
|
|
444
339
|
end
|
445
|
-
task :ubuntu_server_prepare => "ubuntu_server_prepare:default"
|
340
|
+
task :ubuntu_server_prepare => "ubuntu_server_prepare:default"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano3-ubuntu-server-prepare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goooseman
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- capistrano3-ubuntu-server-prepare-0.0.1.gem
|
90
90
|
- capistrano3-ubuntu-server-prepare-0.0.2.gem
|
91
91
|
- capistrano3-ubuntu-server-prepare-0.0.3.gem
|
92
|
+
- capistrano3-ubuntu-server-prepare-0.0.4.gem
|
92
93
|
- config/production/nginx/nginx.conf
|
93
94
|
- config/production/nginx/nginx_with_pagespeed.conf
|
94
95
|
- config/production/nginx/upstart.conf
|