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.
- checksums.yaml +4 -4
- data/bin/twig-feature +36 -6
- 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: aefc3ff684b324ea6df1da81cb38d7f00eecc5c7
|
4
|
+
data.tar.gz: 4c60d9c9f273990d1af3661efe25bae6c3f2600c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9664e5098073e2205cc5fe1fca860bf7042e093cc4db54b3377efe6f0217ee757b343beb1c015e741d77bfeaa2f1082c092eae40f1a010932778042a460ba25
|
7
|
+
data.tar.gz: d22e4e55c745b455bde8f75fced7d2cf827fc17b479fe36e38e73defa59a841588e659905c5021fd6ebcdf3ee96f3a7b1b4760350a3c570701bf01d10801870a
|
data/bin/twig-feature
CHANGED
@@ -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
|
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
|
-
|
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
|
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!
|