caravan 1.0.0.beta2 → 1.0.0
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 +35 -8
- data/docs/_data/changelog.yml +4 -0
- data/lib/caravan.rb +6 -0
- data/lib/caravan/config_migration.rb +18 -0
- data/lib/caravan/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efaf466d751de96761ef5b56ac0c094d25b6e9b7
|
4
|
+
data.tar.gz: f5f89e2d237318f784fe9ed68c9283f5c7304a43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 485a7fd945e11422273985d868218b0d1418598ab0c7f40501e942d565faf50229fd8d9a1ff5f47295c4ddeec0923c240535ce7bc5f5683e1ca8f20ddbf0afa7
|
7
|
+
data.tar.gz: 98a1b9ec9e4044506835e5c11cc1c707bd56507d7c8fa4be5e74a68cae61040476af378792a07e4a51c9c0e535562bc78a7c5ab4710a3a27bb566a29226f73e8
|
data/README.md
CHANGED
@@ -31,6 +31,7 @@ $ caravan --help
|
|
31
31
|
-o, --once Deploy for once
|
32
32
|
-b, --debug Debug mode
|
33
33
|
-l, --load YAML_FILE YAML file (Default: ./caravan.yml)
|
34
|
+
-c, --spec SPEC_NAME Spec name (Default: master)
|
34
35
|
--version Show version
|
35
36
|
```
|
36
37
|
|
@@ -65,13 +66,14 @@ $ caravan --init
|
|
65
66
|
|
66
67
|
A `caravan.yml` will be generated as `/path/to/src/caravan.yml`. You may specify any options in command arguments except source path.
|
67
68
|
|
68
|
-
```
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
- ".
|
69
|
+
```yaml
|
70
|
+
master:
|
71
|
+
debug: false
|
72
|
+
deploy_mode: rsync_local
|
73
|
+
incremental: true
|
74
|
+
exclude:
|
75
|
+
- ".git"
|
76
|
+
- ".svn"
|
75
77
|
```
|
76
78
|
|
77
79
|
You may also write `src` and `dst` to `caravan.yml`. Hence, deployment made even easier.
|
@@ -86,6 +88,31 @@ $ caravan
|
|
86
88
|
$ caravan --load my-caravan.yml
|
87
89
|
```
|
88
90
|
|
91
|
+
`caravan.yml` can work with multi specs. The default spec is `master` and you may declare others.
|
92
|
+
|
93
|
+
```yaml
|
94
|
+
master:
|
95
|
+
src: .
|
96
|
+
dst: /path/to/dst
|
97
|
+
debug: false
|
98
|
+
deploy_mode: rsync_local
|
99
|
+
incremental: true
|
100
|
+
exclude:
|
101
|
+
- ".git"
|
102
|
+
- ".svn"
|
103
|
+
debugmode:
|
104
|
+
src: .
|
105
|
+
dst: /path/to/dst
|
106
|
+
debug: true
|
107
|
+
deploy_mode: rsync
|
108
|
+
incremental: true
|
109
|
+
```
|
110
|
+
|
111
|
+
```
|
112
|
+
$ caravan -c master
|
113
|
+
$ caravan -c debugmode
|
114
|
+
```
|
115
|
+
|
89
116
|
### Deploy Modes
|
90
117
|
|
91
118
|
* Shell
|
@@ -108,7 +135,7 @@ $ caravan --load my-caravan.yml
|
|
108
135
|
- [x] `before_deploy`
|
109
136
|
- [x] `after_deploy`
|
110
137
|
- [x] `before_destroy`
|
111
|
-
- [
|
138
|
+
- [x] Multiple deployment configurations
|
112
139
|
- [ ] Extension to deploy methods
|
113
140
|
|
114
141
|
## License
|
data/docs/_data/changelog.yml
CHANGED
data/lib/caravan.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "caravan/command"
|
2
2
|
require "caravan/config"
|
3
|
+
require "caravan/config_migration"
|
3
4
|
require "caravan/deploy"
|
4
5
|
require "caravan/deploy_methods/shell"
|
5
6
|
require "caravan/deploy_methods/scp"
|
@@ -75,6 +76,11 @@ module Caravan
|
|
75
76
|
src_path = '.' if src_path.nil?
|
76
77
|
user_config_path = File.join(File.expand_path(src_path), yaml_name)
|
77
78
|
conf = Caravan::Config.from(user_config_path)
|
79
|
+
Caravan::Message.warn(
|
80
|
+
"Caravan now support multiple specs in `caravan.yml`. " \
|
81
|
+
"The default spec is `master`. " \
|
82
|
+
"And we detect that you may need to migrate."
|
83
|
+
) if Caravan::ConfigMigration.need_migrate?(conf)
|
78
84
|
conf
|
79
85
|
end
|
80
86
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Caravan
|
2
|
+
class ConfigMigration
|
3
|
+
class << self
|
4
|
+
def need_migrate?(conf)
|
5
|
+
return true if conf.nil? || conf.empty?
|
6
|
+
|
7
|
+
if !conf.key?("src") ||
|
8
|
+
!conf.key?("dst") ||
|
9
|
+
!conf.key?("deploy_mode")
|
10
|
+
Caravan::Message.debug("Conf may need migrate.")
|
11
|
+
return true
|
12
|
+
end
|
13
|
+
|
14
|
+
false
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/caravan/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caravan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Zhang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: listen
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- lib/caravan.rb
|
143
143
|
- lib/caravan/command.rb
|
144
144
|
- lib/caravan/config.rb
|
145
|
+
- lib/caravan/config_migration.rb
|
145
146
|
- lib/caravan/deploy.rb
|
146
147
|
- lib/caravan/deploy_methods/rsync.rb
|
147
148
|
- lib/caravan/deploy_methods/rsync_local.rb
|
@@ -164,9 +165,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
165
|
version: 2.3.0
|
165
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
167
|
requirements:
|
167
|
-
- - "
|
168
|
+
- - ">="
|
168
169
|
- !ruby/object:Gem::Version
|
169
|
-
version:
|
170
|
+
version: '0'
|
170
171
|
requirements: []
|
171
172
|
rubyforge_project:
|
172
173
|
rubygems_version: 2.6.11
|