prima-twig 0.2.10 → 0.2.12

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/twig-deploy +10 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0299a02f8b54a6179edfae15c59c67b579d24a3
4
- data.tar.gz: d673a161826de5eac1da89866f328483dab39eb0
3
+ metadata.gz: 510aa2cae37bc86afd3b8f4ee8c19061cfabbdf9
4
+ data.tar.gz: 5cb119298a3c479307ceb31b98b9a743a22d72e1
5
5
  SHA512:
6
- metadata.gz: 81b18e7fcf2c22f102817eaaa8e88ef8a556876927b05f5e72cc57c51cd8f33e41ff7f2431f2cd54a7ea10596b30546868343e4bf69dbcb00b7e3fc39fdab906
7
- data.tar.gz: 2aacc27b6a91392f51671ef543cbcde77b1d444715b548719345024d964cdb8e715c46c5c531ff0a033ea9975970bd1e4cb5d3225470d575e419d07269358acc
6
+ metadata.gz: c5a0e3bf3e65778693f82899981db63156de71523fdb3387102dc2f58d939a9ed0fcb954d3fdbd7cb8adcce933a1e2c0684933e18ef0369ba8655f348495155a
7
+ data.tar.gz: 99029f1cb6a7170aec2c9ecfa5a7a594e45703a3054866e113a5d8ac9caa1bfe473ecf00f069d1880211564a1627d3e1bb9f46bdf688344125df6c01f2ce8222
data/bin/twig-deploy CHANGED
@@ -51,19 +51,19 @@ class Review
51
51
  output "Recupero degli artifacts in corso, attendi qualche secondo...".yellow
52
52
  artifacts = get_artifacts
53
53
 
54
- artifact = choose do |menu|
54
+ artifact_rev = choose do |menu|
55
55
  menu.prompt = 'Scegli la release da deployare: '.cyan
56
56
  menu.shell = true
57
57
 
58
- artifacts.each do |k, v|
59
- branch = k
60
- title = @prima.reduce_size(branch, 100).light_blue
61
- msg = "#{title}"
62
- menu.choice(msg) {k}
58
+ artifacts.each do |v|
59
+ branch = v[:branch]
60
+ title = @prima.reduce_size(branch, 100)
61
+ msg = "#{title} #{v[:created_at].strftime('%d/%m/%Y %H:%M:%S')} #{v[:rev]}".light_blue
62
+ menu.choice(msg) {v[:rev]}
63
63
  end
64
64
  end
65
65
 
66
- deploy_command = "bin/deploy #{artifacts[artifact]}"
66
+ deploy_command = "bin/deploy #{artifact_rev}"
67
67
 
68
68
  output "Il comando per il deploy sara': #{deploy_command}".yellow
69
69
 
@@ -106,7 +106,7 @@ class Review
106
106
 
107
107
  def get_artifacts
108
108
  rev_already_downloaded = []
109
- artifacts = {}
109
+ artifacts = []
110
110
  s3 = Aws::S3::Client.new
111
111
  resp = s3.list_objects(bucket: 'prima-deploy', prefix: 'artifacts')
112
112
  resp.contents.each do |l|
@@ -114,10 +114,10 @@ class Review
114
114
  if rev && l.key.include?('prod_') && !rev_already_downloaded.include?(rev)
115
115
  rev_already_downloaded << rev
116
116
  object = s3.head_object(bucket: 'prima-deploy', key: l.key)
117
- artifacts[object.metadata['branch']] = rev if object.metadata.has_key? 'branch'
117
+ artifacts << {rev: rev, created_at: object.last_modified, branch: object.metadata['branch']} if object.metadata.has_key? 'branch'
118
118
  end
119
119
  end
120
- artifacts
120
+ artifacts.sort_by { |v| v[:created_at] }.reverse
121
121
  end
122
122
 
123
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prima-twig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Giachino
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-11-30 00:00:00.000000000 Z
14
+ date: 2015-12-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: twig