deploy-context 2.1.27 → 2.1.28

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
  SHA256:
3
- metadata.gz: 15ce52a6c51ae7aa7541bd6c8e71273da68eaea184a3daabe384fb5282f70bdd
4
- data.tar.gz: f9d9a33850f1222d6491391b6db20560cfdf3e8e00e0d220903e633f2cd2108c
3
+ metadata.gz: 7fb7e23859fff85e14cdc2c3bfb84b72c4ab4692401091d720f23c8e79f18a51
4
+ data.tar.gz: d9a0a27ad439e7e741cac646fcfd84383916aa17660286e73589b110069953bf
5
5
  SHA512:
6
- metadata.gz: 415eabeceff075a96f1310faa7c9c61062ee36fefe3ebc405a671c031623d33842028cca8aa789b931791028448469853a7472810d80879d9ee8b6e45200c7c9
7
- data.tar.gz: edfbf6917abe7aee8ff2c07616968fc702ec5e661997f2decc596fe1fc361b31dbe154d625ed6071041de7a2f2922c82ac2f6e13b74d8aff58529d0bffcb9da4
6
+ metadata.gz: 6d4e03f36374b0152acd83db781bb82b7766e16955cf6904a5acbcc5e0c627f70eda3f84f8f0b14c316c6dc995d96cbd2214ff23295e2a9cdf86eb2e829824ad
7
+ data.tar.gz: 61684dc2b42395d0588a5d86f9a0dc86aadfba729955c40b476825426164945e4a73f230f23c26d8f468398df6907446b01804e67cd23f3434b7a231ed805b9e
checksums.yaml.gz.sig CHANGED
Binary file
@@ -2,8 +2,7 @@ module Context
2
2
  module CucumberDeployerHelper
3
3
  def cucumber_test(context)
4
4
  git_build(context)
5
- Dir.chdir context.context_folder
6
- puts "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created"
5
+ puts "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created in folder #{context.context_folder} at version #{context.version}"
7
6
  cucumber
8
7
  end
9
8
  end
@@ -1,39 +1,41 @@
1
1
  module Context
2
2
  module GitDeployerHelper
3
3
  def git_build(context)
4
- Dir.chdir File.dirname(context.context_folder)
5
- puts "Building ruby from folder #{context.context_folder}"
6
- if ::Dir.exist?(context.context_folder)
4
+ if context.present_localy?
5
+ Dir.chdir(context.context_folder)
7
6
  git_pull(context)
8
7
  else
9
- git ["clone git@github.com:JimboDragonGit/#{context.context_name}.git"] unless ::Dir.exist?(context.context_folder)
8
+ local_dir = File.join(Dir.pwd, context.context_name)
9
+ git ["clone git@github.com:JimboDragonGit/#{context.context_name}.git"] unless ::Dir.exist?(local_dir)
10
+ context.move_folder(local_dir)
10
11
  end
11
12
  end
12
13
 
13
14
  def git_pull(context)
14
- Dir.chdir context.context_folder
15
+ git_build(context) unless context.actual_working_directory?
15
16
  git ['pull']
16
17
  end
17
18
 
18
19
  def git_commit(context)
19
- Dir.chdir context.context_folder
20
+ git_build(context)
20
21
  git ['add .']
21
22
  git ["commit -m 'Create #{context.context_name} automatic commit'"]
22
23
  end
23
24
 
24
25
  def git_release(context)
25
- Dir.chdir context.context_folder
26
+ git_build(context)
26
27
  git ['push', '--follow-tags']
27
28
  end
28
29
 
29
30
  def git_bump(context, level)
30
- Dir.chdir context.context_folder
31
+ git_build(context)
31
32
  git ['version-bump', level]
33
+ git_commit(context)
32
34
  end
33
35
 
34
36
  def patch_reset(context)
37
+ git_build(context)
35
38
  git_bump(context, 'minor')
36
- git_commit(context)
37
39
  end
38
40
 
39
41
  def git_update_available?(context)
@@ -43,7 +45,7 @@ module Context
43
45
  end
44
46
 
45
47
  def git_dirty_state?(context)
46
- Dir.chdir(context.context_folder)
48
+ git_build(context)
47
49
  # git ['log', "v#{context.version}"]
48
50
  `git status --porcelain`.split('\n').count > 0
49
51
  end
@@ -4,13 +4,12 @@ module Context
4
4
  module RubyDeployerHelper
5
5
  def ruby_build(context)
6
6
  git_build(context)
7
- Dir.chdir context.context_folder
8
7
  puts "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created"
9
8
  check_folder get_context_folder(context, 'build')
10
9
  end
11
10
 
12
11
  def ruby_release(context)
13
- Dir.chdir context.context_folder
12
+ git_build(context)
14
13
  # gem ["push #{context.context_name}-#{GVB.version}.gem"]
15
14
  # context.patch_bump if gem_installed?(context)
16
15
  rake ['release']
@@ -18,7 +17,6 @@ module Context
18
17
  end
19
18
 
20
19
  def ruby_install(context)
21
- Dir.chdir context.context_folder
22
20
  gem ['install', context.context_name]
23
21
  end
24
22
 
@@ -37,14 +35,14 @@ module Context
37
35
  end
38
36
 
39
37
  def ruby_check_if_available_public(context)
40
- puts "Waiting a minute before installing"
38
+ puts "Waiting a minute before installing #{context.context_name} in folder #{context.context_folder}"
41
39
  `chef gem list #{context.context_name}`
42
40
  # sleep(60)
43
41
  end
44
42
 
45
43
  def gem_installed?(context)
46
44
  installed_version = Gem::Specification.find_by_name(context.context_name).version
47
- puts "Compare #{context.context_name} installed_version #{installed_version} with #{context.version}"
45
+ puts "Compare #{context.context_name} installed_version #{installed_version} with #{context.version} in folder #{context.context_folder}"
48
46
  installed = installed_version == context.version
49
47
  puts "installed = #{installed}"
50
48
  installed
@@ -9,13 +9,21 @@ module Context
9
9
 
10
10
  def initialize(context_name, deploycontext_folder)
11
11
  @context_name = context_name
12
- @context_folder = deploycontext_folder.include?(context_name) ? deploycontext_folder : File.join(deploycontext_folder, context_name)
12
+ @context_folder = move_folder(deploycontext_folder)
13
13
  end
14
14
 
15
15
  def present_localy?
16
16
  Dir.exist?(context_folder)
17
17
  end
18
18
 
19
+ def actual_working_directory?
20
+ Dir.pwd == context_folder
21
+ end
22
+
23
+ def move_folder(folder)
24
+ @context_folder = folder.include?(context_name) ? folder : File.join(folder, context_name)
25
+ end
26
+
19
27
  def check_folder(folder)
20
28
  FileUtils.mkdir_p(context_folder) unless present_localy?
21
29
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deploy-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.27
4
+ version: 2.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Provencher
metadata.gz.sig CHANGED
Binary file