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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
- metadata.gz: 104eae3fd531c8505cdc096f0f8f393db8b4baa2
4
- data.tar.gz: 57835b9a5b8d2afe3f83c02014a1e18231b76375
3
+ metadata.gz: 1bd1489c00876b7c9ab12807d47716466f3040c6
4
+ data.tar.gz: cfd8a4a6c773f096d2e8e32ab4aba5e3703dbcb6
5
5
  !binary "U0hBNTEy":
6
- metadata.gz: f4d70fef6d3fe0b19b478c5c20a8f32cb74b4888076fd33a40c47542d5dc307a6d3a99e5a2cde30a652b770dce19f9e068a723d672a018bb799300d26b09dcea
7
- data.tar.gz: 010cadc4fda76d0716b665b98912588d8a1fddcf88c0555b701884e612103f334ca4d682965a9a8870270d4df563c38a24da11ed27d08c359acd053b76139336
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
- ## Example of a Capfile
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
- - `/home/#{user}/apps/#{application}.#{stage}`
55
- - or `/home/#{user}/apps/#{application}` if the multistage ext is not
56
- loaded.
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
- The last one implements the atomic symlink as suggested in the
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 **files:download** task will rsync files from the first web server in
69
- `shared/your/directory` to a local temporary directory `tmp/capistrano-chocopoche/files/your/directory`.
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 **files:upload** task will do the opposite of the **files:download** task.
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
- The **files:create_symlinks** creates symlinks from the shared to the current.
74
- The equivalent for the Capfile example:
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.1"
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-chocopoche
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corentin Merot