caravan 1.0.0.beta2 → 1.0.0

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: d017a8b8af8b87855f90a5351fb3afb88bda4ec1
4
- data.tar.gz: 5251a04d7f2728f8748a37c87ec3f747a6569b0c
3
+ metadata.gz: efaf466d751de96761ef5b56ac0c094d25b6e9b7
4
+ data.tar.gz: f5f89e2d237318f784fe9ed68c9283f5c7304a43
5
5
  SHA512:
6
- metadata.gz: a5d7aa9f5e8e9e9573541802bd8f9ff0077c1566d372253120d78c830c2afe2d080debf315e735075b26144c82d8de79238e9dfc5404cdeb0618eddb174c797f
7
- data.tar.gz: 63df7c716b601fb623d7ff1ca017bb376ebb5e35cb77019d0341102f74bab431fca071b00734e193f7f8d2e2bf1844f1a61f490f51312db081e11f03480af5a4
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
- debug: false
70
- deploy_mode: rsync_local
71
- incremental: true
72
- exclude:
73
- - ".git"
74
- - ".svn"
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
- - [ ] ~~Multiple deployment configurations~~
138
+ - [x] Multiple deployment configurations
112
139
  - [ ] Extension to deploy methods
113
140
 
114
141
  ## License
@@ -1,3 +1,7 @@
1
+ - version: "1.0.0"
2
+ changes:
3
+ - text: "Multiple specs support"
4
+ hash: e583bb8
1
5
  - version: "0.7.0"
2
6
  changes:
3
7
  - text: "Specify caravan.yml's name"
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Caravan
2
- VERSION = "1.0.0.beta2".freeze
2
+ VERSION = "1.0.0".freeze
3
3
  end
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.beta2
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-03 00:00:00.000000000 Z
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: 1.3.1
170
+ version: '0'
170
171
  requirements: []
171
172
  rubyforge_project:
172
173
  rubygems_version: 2.6.11