capistrano-chocopoche 0.0.1 → 0.0.2
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/README.md +82 -16
- data/capistrano-chocopoche.gemspec +1 -1
- data/lib/capistrano-chocopoche/railsless-deploy.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1bd1489c00876b7c9ab12807d47716466f3040c6
|
|
4
|
+
data.tar.gz: cfd8a4a6c773f096d2e8e32ab4aba5e3703dbcb6
|
|
5
5
|
!binary "U0hBNTEy":
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc676969d37f7523d4ed8b775bd4fb4700a23dfe0409e35456f0ae8eb16b8af022d5b43b5f2762c3689cff4770eeb95bacfd0028da89a2b682aad4522f4131fa
|
|
7
|
+
data.tar.gz: 9d643175726549773759b31b9c259c42f5ffb7af7594031552a172664e6fee202f049e38f58c1df7ef9c72f18a3d040f4e18ed8e0248f2317f1ef0a37d1b5c97
|
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@ My capistrano poche contains:
|
|
|
9
9
|
|
|
10
10
|
$ gem install capistrano-chocopoche
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Capfile example
|
|
13
13
|
|
|
14
14
|
```ruby
|
|
15
15
|
# Capistrao defaults
|
|
@@ -34,11 +34,12 @@ ssh_options[:forward_agent] = true
|
|
|
34
34
|
set :files_directories, [ 'public/upload' ]
|
|
35
35
|
set :files_symlinks, [ 'public/upload' ]
|
|
36
36
|
|
|
37
|
-
# Server config, won't be here in case of multistage
|
|
38
|
-
server 'localhost', :app, :web, :db, :primary => true
|
|
37
|
+
# # Server config, won't be here in case of multistage
|
|
38
|
+
# server 'localhost', :app, :web, :db, :primary => true
|
|
39
39
|
|
|
40
40
|
# # default settings
|
|
41
41
|
# set :files_tmp_dir, 'tmp/capistrano-chocopoche/files'
|
|
42
|
+
# set :deploy_to, '/home/#{user}/apps/#{application}[.#{stage}]'
|
|
42
43
|
```
|
|
43
44
|
|
|
44
45
|
## Railsless-deploy
|
|
@@ -51,30 +52,95 @@ This script requires the default capistrano tasks to be loaded, then it will:
|
|
|
51
52
|
- empty rails vars: `shared_children`
|
|
52
53
|
- override the `deploy_to` var to:
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
- `/home/#{user}/apps/#{application}.#{stage}`
|
|
56
|
+
- or `/home/#{user}/apps/#{application}` if the multistage ext is not
|
|
57
|
+
loaded.
|
|
57
58
|
|
|
58
59
|
Therefore the multistage ext must be required before the railsless-deploy.
|
|
59
60
|
|
|
60
|
-
- override symlinks related tasks to use relative paths: create_symlink
|
|
61
|
-
rollback:revision
|
|
61
|
+
- override symlinks related tasks to use relative paths: `create_symlink`,
|
|
62
|
+
`rollback:revision`
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
Also the last one implements the atomic symlink as suggested in
|
|
64
65
|
[issue #346](https://github.com/capistrano/capistrano/issues/346).
|
|
65
66
|
|
|
66
67
|
## Files
|
|
67
68
|
|
|
68
|
-
The
|
|
69
|
-
|
|
69
|
+
The `download` and `upload` tasks use a temporary directory as pivot, so you are
|
|
70
|
+
able to sync from a stage to another.
|
|
70
71
|
|
|
71
|
-
The
|
|
72
|
+
The following scenario assumes that all commands are launched from the dev stage,
|
|
73
|
+
that you have 3 environements and that `:files_directories` and `:files_symlinks`
|
|
74
|
+
are set as in the example:
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
- dev: may only contains the cap recipe
|
|
77
|
+
- staging: a stage without files and symlinks
|
|
78
|
+
- prod: a stage with files and symlinks. Prod looks like:
|
|
79
|
+
|
|
80
|
+
my-project.prod/
|
|
81
|
+
├── current/
|
|
82
|
+
│ └── public/
|
|
83
|
+
│ └── upload/ => symlink to my-project/shared/public/upload/
|
|
84
|
+
└── shared/
|
|
85
|
+
└── public/
|
|
86
|
+
└── upload/ => git ignores that folder
|
|
87
|
+
├── file1.png
|
|
88
|
+
├── file2.png
|
|
89
|
+
...
|
|
90
|
+
|
|
91
|
+
### Download
|
|
92
|
+
|
|
93
|
+
Download `prod:my-project/shared/public/upload` to `dev:my-project/tmp/capistrano-chocopoche/files/public/upload`:
|
|
94
|
+
|
|
95
|
+
$ cap prod files:download
|
|
96
|
+
|
|
97
|
+
Gives:
|
|
98
|
+
|
|
99
|
+
my-project.dev/
|
|
100
|
+
├── current/
|
|
101
|
+
├── shared/
|
|
102
|
+
└── tmp/
|
|
103
|
+
└── capistrano-chocopoche/
|
|
104
|
+
└── files/
|
|
105
|
+
└── public/
|
|
106
|
+
└── upload/
|
|
107
|
+
├── file1.png
|
|
108
|
+
├── file2.png
|
|
109
|
+
...
|
|
110
|
+
|
|
111
|
+
### Upload
|
|
112
|
+
|
|
113
|
+
Upload `dev:my-project/tmp/capistrano-chocopoche/files/public/upload` to `staging:my-project/shared/public/upload`:
|
|
114
|
+
|
|
115
|
+
$cap staging files:upload
|
|
116
|
+
|
|
117
|
+
Gives:
|
|
118
|
+
|
|
119
|
+
my-project.staging/
|
|
120
|
+
├── current/
|
|
121
|
+
└── shared/
|
|
122
|
+
└── public/
|
|
123
|
+
└── upload/
|
|
124
|
+
├── file1.png
|
|
125
|
+
├── file2.png
|
|
126
|
+
...
|
|
127
|
+
|
|
128
|
+
### Symlink
|
|
129
|
+
|
|
130
|
+
Create a symlink from `staging:my-project/shared/public/upload/` to `staging:my-project/current/public/upload/`:
|
|
131
|
+
|
|
132
|
+
$ cap staging files:create_symlinks
|
|
133
|
+
|
|
134
|
+
Gives:
|
|
135
|
+
|
|
136
|
+
my-project.staging/
|
|
137
|
+
├── current/
|
|
138
|
+
│ └── public/
|
|
139
|
+
│ └── upload/ => symlink to my-project/shared/public/upload/
|
|
140
|
+
└── shared/
|
|
141
|
+
└── public/
|
|
142
|
+
└── upload/ => git ignores that folder
|
|
75
143
|
|
|
76
|
-
$ mkdir -p #{current_path}/public
|
|
77
|
-
$ ln -fs #{shared_path}/public/upload #{current_path}/public
|
|
78
144
|
|
|
79
145
|
## License
|
|
80
146
|
|
|
@@ -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 = "capistrano-chocopoche"
|
|
7
|
-
spec.version = "0.0.
|
|
7
|
+
spec.version = "0.0.2"
|
|
8
8
|
spec.authors = ["Corentin Merot"]
|
|
9
9
|
spec.email = ["cmerot@themarqueeblink.com"]
|
|
10
10
|
spec.description = %q{Capistrano recipes, with another railsless-deploy and a files utility.}
|
|
@@ -16,12 +16,13 @@ configuration.load do
|
|
|
16
16
|
# Remove rails specific vars
|
|
17
17
|
unset :rails_env
|
|
18
18
|
|
|
19
|
+
# Empty shared children
|
|
20
|
+
set :shared_children, []
|
|
21
|
+
|
|
19
22
|
# Override `deploy to` to a more common path
|
|
20
23
|
if exists?(:stages)
|
|
21
|
-
logger.important "YYYYYYYYY"
|
|
22
24
|
set(:deploy_to) { "/home/#{user}/apps/#{application}.#{stage}" }
|
|
23
25
|
else
|
|
24
|
-
logger.important "NOOOOOOOO"
|
|
25
26
|
set(:deploy_to) { "/home/#{user}/apps/#{application}" }
|
|
26
27
|
end
|
|
27
28
|
|