deprec 3.1.0.rc2 → 3.1.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +1 -1
- data/docs/GETTING_STARTED +83 -0
- data/docs/TODO.txt +12 -0
- data/lib/deprec/cap/callbacks/asset_pipeline.rb +52 -51
- data/lib/deprec/version.rb +1 -1
- metadata +3 -1
data/COPYING
CHANGED
@@ -0,0 +1,83 @@
|
|
1
|
+
== Installation and initial server setup for deprec2
|
2
|
+
|
3
|
+
Install deprec with the following command (requires ruby and rubygems installed)
|
4
|
+
|
5
|
+
sudo gem install deprec
|
6
|
+
|
7
|
+
Let's create a directory to manage all our host config details
|
8
|
+
This supports as many hosts as you need to manage and will be the dir
|
9
|
+
you run your deprec commands from when managing the servers. Note that
|
10
|
+
you don't need to do this if you just want to deploy a single Ruby on
|
11
|
+
Rails application. In this case the config/ dir in your project can
|
12
|
+
serve the same purpose. For those who aren't interested in Ruby on Rails
|
13
|
+
or want to use deprec for more than just deploying one rails app, the
|
14
|
+
following may come in handy.
|
15
|
+
|
16
|
+
mkdir -p sys/config # change 'sys' to whatever you want
|
17
|
+
cd sys #
|
18
|
+
depify . # create Capfile and config/deploy.rb
|
19
|
+
cap deprec:ssh:config_gen # generates ssh server configs
|
20
|
+
|
21
|
+
If you have an authorized_keys file, copy it to a location where deprec
|
22
|
+
can find it. We name these files using the username of their owner.
|
23
|
+
|
24
|
+
cp ~/.ssh/authorized_keys config/ssh/authorized_keys/${USER}
|
25
|
+
|
26
|
+
Deprec will then offer to copy it out to remote hosts when
|
27
|
+
you setup new accounts for yourself. If you don't have authorized_keys,
|
28
|
+
copy out your id_rsa.pub or id_dsa.pub file. You can also put the
|
29
|
+
authorized_keys of colleagues in this dir and deprec will offer to
|
30
|
+
copy them out when creating accounts for them too.
|
31
|
+
|
32
|
+
Change the root password you received for your new slice.
|
33
|
+
|
34
|
+
cap deprec:users:passwd USER=root HOSTS=<your.slice.address>
|
35
|
+
|
36
|
+
Enter user to change password for |root|
|
37
|
+
Password:
|
38
|
+
Enter new UNIX password:
|
39
|
+
Retype new UNIX password:
|
40
|
+
|
41
|
+
|
42
|
+
Create an account with sudo access for myself:
|
43
|
+
|
44
|
+
cap deprec:users:add USER=root
|
45
|
+
|
46
|
+
Enter userid for new user |root|
|
47
|
+
mbailey
|
48
|
+
Should this be an admin account? |no|
|
49
|
+
yes
|
50
|
+
I've found an authorized_keys file for mbailey. Should I copy it out? |yes|
|
51
|
+
Password:
|
52
|
+
Setting pasword for new account
|
53
|
+
Enter new UNIX password:
|
54
|
+
Retype new UNIX password:
|
55
|
+
|
56
|
+
|
57
|
+
Create another account without sudo access for a colleague.
|
58
|
+
Notice how I longer need to specify USER=root? That's because I'm using the
|
59
|
+
account I just created (mbailey).
|
60
|
+
|
61
|
+
cap deprec:users:add
|
62
|
+
|
63
|
+
Enter userid for new user |mbailey|
|
64
|
+
ben
|
65
|
+
Should this be an admin account? |no|
|
66
|
+
Password:
|
67
|
+
Setting pasword for new account
|
68
|
+
Enter new UNIX password:
|
69
|
+
Retype new UNIX password:
|
70
|
+
|
71
|
+
I prefer to disallow ssh password based login for security reasons. I also
|
72
|
+
turn off DNS lookups by sshd as they are often responsible for a 2 second
|
73
|
+
lag on login. Be warned that turning off ssh passwords will prevent someone
|
74
|
+
without an ssh key setup from logging in so use this with caution. Deprec
|
75
|
+
makes it painless to upload their key when you create their account though
|
76
|
+
so you've got no excuse to leave passwords turned on.
|
77
|
+
|
78
|
+
You can upload the ssh configs currently residing in config/ssh/etc/ssh by
|
79
|
+
running this:
|
80
|
+
|
81
|
+
cap deprec:ssh:config
|
82
|
+
|
83
|
+
You can now continue to the other READMEs
|
data/docs/TODO.txt
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
deprec/TODO.txt
|
2
|
+
===============
|
3
|
+
|
4
|
+
* new wordpress
|
5
|
+
* get rid of run_method - s/send(run_method, "/run "#{sudo} /
|
6
|
+
* clean out stale tasks (from cap -T)
|
7
|
+
|
8
|
+
# Add option to symlink apache vhosts
|
9
|
+
#
|
10
|
+
# This will make updating with deploys easier
|
11
|
+
#
|
12
|
+
ln -sf /srv/brandish/current/config/uat/passenger/apache_vhost brandish
|
@@ -2,67 +2,68 @@
|
|
2
2
|
#
|
3
3
|
# Capistrano::Configuration.instance(:must_exist).load do
|
4
4
|
# require 'capistrano/recipes/deploy'
|
5
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
5
6
|
|
6
|
-
def _cset(name, *args, &block)
|
7
|
-
|
8
|
-
|
7
|
+
def _cset(name, *args, &block)
|
8
|
+
unless exists?(name)
|
9
|
+
set(name, *args, &block)
|
10
|
+
end
|
9
11
|
end
|
10
|
-
end
|
11
12
|
|
12
|
-
_cset :asset_env, "RAILS_GROUPS=assets"
|
13
|
-
_cset :rails_env, "production"
|
13
|
+
_cset :asset_env, "RAILS_GROUPS=assets"
|
14
|
+
_cset :rails_env, "production"
|
14
15
|
|
15
|
-
# rails-3.1 does not use asset timestamps
|
16
|
-
set :normalize_asset_timestamps, false
|
16
|
+
# rails-3.1 does not use asset timestamps
|
17
|
+
set :normalize_asset_timestamps, false
|
17
18
|
|
18
|
-
after 'deploy:update_code', 'deploy:assets:symlink'
|
19
|
-
after 'deploy:update_code', 'deploy:assets:precompile'
|
19
|
+
after 'deploy:update_code', 'deploy:assets:symlink'
|
20
|
+
after 'deploy:update_code', 'deploy:assets:precompile'
|
20
21
|
|
21
|
-
namespace :deploy do
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
22
|
+
namespace :deploy do
|
23
|
+
namespace :assets do
|
24
|
+
desc <<-DESC
|
25
|
+
[internal] This task will set up a symlink to the shared directory \
|
26
|
+
for the assets directory. Assets are shared across deploys to avoid \
|
27
|
+
mid-deploy mismatches between old application html asking for assets \
|
28
|
+
and getting a 404 file not found error.
|
29
|
+
DESC
|
30
|
+
task :symlink, :roles => :web, :except => { :no_release => true } do
|
31
|
+
run <<-CMD
|
32
|
+
rm -rf #{latest_release}/public/assets &&
|
33
|
+
mkdir -p #{latest_release}/public &&
|
34
|
+
mkdir -p #{shared_path}/assets &&
|
35
|
+
ln -s #{shared_path}/assets #{latest_release}/public/assets
|
36
|
+
CMD
|
37
|
+
end
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
desc <<-DESC
|
40
|
+
Run the asset precompilation rake task. You can specify the full path \
|
41
|
+
to the rake executable by setting the rake variable. You can also \
|
42
|
+
specify additional environment variables to pass to rake via the \
|
43
|
+
asset_env variable. The defaults are:
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
set :rake, "rake"
|
46
|
+
set :rails_env, "production"
|
47
|
+
set :asset_env, "RAILS_GROUPS=assets"
|
48
|
+
DESC
|
49
|
+
task :precompile, :roles => :web, :except => { :no_release => true } do
|
50
|
+
run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile"
|
51
|
+
end
|
51
52
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
53
|
+
desc <<-DESC
|
54
|
+
Run the asset clean rake task. Use with caution, this will delete \
|
55
|
+
all of your compiled assets. You can specify the full path \
|
56
|
+
to the rake executable by setting the rake variable. You can also \
|
57
|
+
specify additional environment variables to pass to rake via the \
|
58
|
+
asset_env variable. The defaults are:
|
58
59
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
set :rake, "rake"
|
61
|
+
set :rails_env, "production"
|
62
|
+
set :asset_env, "RAILS_GROUPS=assets"
|
63
|
+
DESC
|
64
|
+
task :clean, :roles => :web, :except => { :no_release => true } do
|
65
|
+
run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:clean"
|
66
|
+
end
|
65
67
|
end
|
66
68
|
end
|
67
69
|
end
|
68
|
-
end
|
data/lib/deprec/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: deprec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 6
|
5
|
-
version: 3.1.0.
|
5
|
+
version: 3.1.0.rc3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mike Bailey
|
@@ -56,9 +56,11 @@ extra_rdoc_files: []
|
|
56
56
|
files:
|
57
57
|
- bin/hosts.rb
|
58
58
|
- bin/depify
|
59
|
+
- docs/TODO.txt
|
59
60
|
- docs/README.rails
|
60
61
|
- docs/config_gen_explained.txt
|
61
62
|
- docs/old/deprec_banner.gif
|
63
|
+
- docs/GETTING_STARTED
|
62
64
|
- docs/deprec_cmd_completion.sh
|
63
65
|
- docs/deprec-1.x/deprec-1.x.quickstart
|
64
66
|
- docs/deprec-1.x/notes.txt
|