prima-twig 0.36.1 → 0.36.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/twig-feature +36 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbd2c12aab55ddd596b0fc14a3403744f4738aed
4
- data.tar.gz: d552b904af5bf514173cd8eb02193cc1ebc30fc2
3
+ metadata.gz: aefc3ff684b324ea6df1da81cb38d7f00eecc5c7
4
+ data.tar.gz: 4c60d9c9f273990d1af3661efe25bae6c3f2600c
5
5
  SHA512:
6
- metadata.gz: f1755c874290c00d44c20bc1e8ab85b2f6ee81054113de10f4e2b791b9930baf3a4a1ddf03443e0c6ed7dd400d796d9e572647e6698829ebecc11ec5d7da9e34
7
- data.tar.gz: 126d6f3334407e11a72fe90b52a6dbf14617fbd3fec84cbb1da59458f9d996a398c2484c413e0fdc8d00b9053a3205d9a742cf62e066e157789a08a53cb88793
6
+ metadata.gz: d9664e5098073e2205cc5fe1fca860bf7042e093cc4db54b3377efe6f0217ee757b343beb1c015e741d77bfeaa2f1082c092eae40f1a010932778042a460ba25
7
+ data.tar.gz: d22e4e55c745b455bde8f75fced7d2cf827fc17b479fe36e38e73defa59a841588e659905c5021fd6ebcdf3ee96f3a7b1b4760350a3c570701bf01d10801870a
@@ -59,9 +59,9 @@ class Release
59
59
  when 'qainit'
60
60
  abort('Non sei nella cartella di qainit') unless Dir.pwd.match 'qainit$'
61
61
  if ['terminate', 'stop', 'shutdown', 'halt', 'destroy'].include? args[1]
62
- qainit_deploy_update! 'update'
63
- elsif 'update' == args[1]
64
62
  qainit_deploy_update! 'shutdown'
63
+ elsif 'update' == args[1]
64
+ qainit_deploy_update! 'update'
65
65
  elsif 'read' == args[1]
66
66
  qainit_read_config!
67
67
  else
@@ -415,7 +415,13 @@ class Release
415
415
  output 'Inserisci la feature a cui si riferisce il QA: '
416
416
  feature_number = String(STDIN.gets)
417
417
 
418
- `git checkout master && git checkout -b #{feature_number}`
418
+ `git checkout master`
419
+
420
+ if `git branch -l | grep #{feature_number}$`.size > 0
421
+ `git checkout #{feature_number} && git pull`
422
+ else
423
+ `git checkout -b #{feature_number}`
424
+ end
419
425
 
420
426
  branches = ''
421
427
 
@@ -434,7 +440,7 @@ class Release
434
440
 
435
441
  def qainit_deploy_update!(action)
436
442
  # leggiamo i nomi dei branch
437
- `git branch -a | grep remotes/ | grep -v HEAD | sed 's/ remotes\\/origin\\///g'`
443
+ former_branches = `git branch -a | grep remotes/ | grep -v HEAD | sed 's/ remotes\\/origin\\///g'`.split "\n"
438
444
  # stampiamo la lista
439
445
  chosen_branch = choose do |menu|
440
446
  case action
@@ -444,13 +450,37 @@ class Release
444
450
  menu.prompt = "Scegli il QA che vuoi spegnere: ".cyan
445
451
  end
446
452
  menu.shell = true
447
- branches.each do |branch|
453
+ former_branches.each do |branch|
448
454
  msg = branch.light_blue
449
455
  menu.choice(msg) { branch }
450
456
  end
451
457
  end
452
458
  # checkout master, checkout branch, pull branch, push sul branch con commit vuoto
453
- `git checkout master && git checkout #{chosen_branch} && git pull && git commit -m '#{action}' --allow-empty`
459
+ `git checkout master && git checkout #{chosen_branch} && git pull`
460
+
461
+ # aggiornare il commit (revision a cui fa riferimento)
462
+
463
+ # leggo il file branch_names / recupero i nomi dei branch / riscrivo tutto
464
+ File.open('branch_names', 'r') do |file|
465
+ file.each_line do |line|
466
+ project = line.split(':')
467
+ @projects[project[0]] = select_branch_to_deploy(project[0], project[1])
468
+ @projects[project[0]][:default_branch] = project[3]
469
+ # @projects[project[0]] = {:name=> project[1], :revision=> project[2], :default_branch=> project[3]}
470
+ end
471
+ end
472
+
473
+ branches = ''
474
+
475
+ @projects.each_key do |project_key|
476
+ if @projects[project_key][:revision]
477
+ branches += "#{project_key}:#{@projects[project_key][:name]}:#{@projects[project_key][:revision]}:#{@projects[project_key][:default_branch]}\n"
478
+ end
479
+ end
480
+
481
+ File.open('branch_names', 'w') { |file| file.write(branches) }
482
+
483
+ `git commit -am '#{action}'`
454
484
  end
455
485
 
456
486
  def qainit_read_config!
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.36.1
4
+ version: 0.36.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Giachino