knife-pinnings 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/chef/knife/pinnings_promote.rb +6 -6
- data/lib/knife-pinnings/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0b94a3ccd1734401c8be4e7c0c03cff2b2402d2
|
4
|
+
data.tar.gz: 2901f932dcc37602e9755a336b742368f2fc552c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2457459da364e27ee43226b151d2fb7dea2957e355c82695b21453e7bc5cc9724cac747d9cd32eddc1d0842ce8202a2a5a0f10495aeaddc506039a0d0c5c3bc4
|
7
|
+
data.tar.gz: 75fc85d6d67f0d7caee9dcd5bc7f21abd0a62b26958239adc0cd0a1edccadcce07b2602aa033b157a5f3bb0c92697e72eafaf32c4c1ff0c8934aeb206e9352b1
|
data/README.md
CHANGED
@@ -43,13 +43,16 @@ To find cookbooks in acceptance or production with names beginning with app_
|
|
43
43
|
### Comparing environments
|
44
44
|
To get a color coded comparison grid showing whats not up to date and whats missing.
|
45
45
|
|
46
|
-
knife compare
|
46
|
+
knife pinnings compare ['environmnet_regex'] ['cookbook_regex']
|
47
47
|
|
48
|
+
To compare the versions of skunk app cookbooks in dev, acceptance and production
|
49
|
+
|
50
|
+
knife pinnings compare '(^dev$|^acceptance$|^production$)' '^skunk_app.*'
|
48
51
|
|
49
52
|
### Promoting pinnings between environments
|
50
53
|
Promote pinnings from one environment to another.
|
51
54
|
|
52
|
-
knife pinnings promote ENV1 ENV2
|
55
|
+
knife pinnings promote ENV1 ENV2 ['cookbook_regex']
|
53
56
|
|
54
57
|
NOTE: Pinnings which are missing in the source environment will NOT be deleted from the target.
|
55
58
|
|
@@ -17,21 +17,21 @@ class Chef
|
|
17
17
|
# This class copies cookbook pinnings between environments
|
18
18
|
class PinningsPromote < Chef::Knife
|
19
19
|
require 'chef/knife/pinnings_mixin'
|
20
|
-
banner
|
20
|
+
banner "knife pinnings promote <SOURCE_ENV> <TARGET_ENV> ['cookbook_regex']"
|
21
21
|
|
22
22
|
def run
|
23
|
-
unless name_args.length >
|
23
|
+
unless name_args.length > 1
|
24
24
|
ui.fatal('You must specify a source and target environment.')
|
25
25
|
exit 255
|
26
26
|
end
|
27
27
|
source_env = Environment.load(name_args[0])
|
28
28
|
target_env = Environment.load(name_args[1])
|
29
|
-
cookbook_regex = name_args || '.*'
|
30
|
-
display_pinnings_table([source_env, target_env],
|
31
|
-
copy_pinnings(source_env, target_env)
|
29
|
+
cookbook_regex = name_args[2] || '.*'
|
30
|
+
display_pinnings_table([source_env, target_env], cookbook_regex)
|
31
|
+
copy_pinnings(source_env, target_env, cookbook_regex)
|
32
32
|
end
|
33
33
|
|
34
|
-
def copy_pinnings(source_env, target_env)
|
34
|
+
def copy_pinnings(source_env, target_env, cookbook_regex)
|
35
35
|
ui.msg('')
|
36
36
|
ui.confirm("Do you want to write to #{target_env.name}")
|
37
37
|
ui.msg('')
|