miriamtech-gocd 0.2.0 → 0.2.5

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: 8a10182274162c0b910f57a828489a5e86fa51db950d91587edd67f0b615f559
4
- data.tar.gz: c6cc4e741228ce382ec5d560e18cc413f533aaa022d1f652ac5c13485b28985c
3
+ metadata.gz: 36bb5e58de16e0265808a3dea1ef4c080aed0980f12a15836a73015301618531
4
+ data.tar.gz: 63752d772b291d09d87b8d464c6783ebd1f6db8a437e689f5d86c95995384cfa
5
5
  SHA512:
6
- metadata.gz: e01bb5e1af5fc7b3371e0c9ec67757e54c3c0bac6ed75b867218d25d08c12bd511a3090ed863b5499c0b7acf27008cf4852ac1e03b84a0e8dbd376bc4b0223b2
7
- data.tar.gz: 9b5bf6810a10726ee56810a24fdf3d17031b06a68dd92c1dd30887262f5a70ae563a8657afa21ef2dbf9fc0a8c3c338f737735f0d624567f170a67ab50844808
6
+ metadata.gz: 06ca072ff4682cab374e4ab8422dfade27be1d2010dec3aea8cdc170b785f6fb9be364fdfc9e4801b4a2dabedd551f5c2db7300862e156a864bf5f3f20236271
7
+ data.tar.gz: fa7ea749465500419785aecb59cbb63dda6a6032b91bb25daa7dd1c18a1e24a79912be5c5399d2662fa7578b2aca83d2f1021277c5c4f08aa6f1063de33fc092
@@ -1,8 +1,18 @@
1
1
  module MiriamTech
2
2
  module GoCD
3
3
  module DSL
4
+ def capture_artifacts(prefix = project_name, workdir:, path:, &block)
5
+ with_artifacts_volume(prefix) do |volume_name|
6
+ begin
7
+ yield "-v #{volume_name}:#{workdir}/#{path}"
8
+ ensure
9
+ copy_artifacts_from_volume(volume_name, local_path: path)
10
+ end
11
+ end
12
+ end
13
+
4
14
  def with_artifacts_volume(prefix = project_name, &block)
5
- artifacts_volume = "#{prefix}#{build_tag}".gsub('[/:]', '_')
15
+ artifacts_volume = sanitized_volume_name("#{prefix}#{build_tag}")
6
16
  docker "volume create #{artifacts_volume}"
7
17
  yield artifacts_volume
8
18
  ensure
@@ -20,6 +30,12 @@ module MiriamTech
20
30
  docker "rm -v #{container_id}"
21
31
  end
22
32
  end
33
+
34
+ private
35
+
36
+ def sanitized_volume_name(name)
37
+ name.gsub(/[^-_\.A-Za-z0-9]/, '_')
38
+ end
23
39
  end
24
40
  end
25
41
  end
@@ -2,7 +2,7 @@ module MiriamTech
2
2
  module GoCD
3
3
  module DSL
4
4
  def project_name(env = ENV)
5
- (env['GO_PIPELINE_NAME'] || File.basename(File.expand_path('.'))).downcase
5
+ (env['GO_PIPELINE_NAME'] || root_path.basename.to_s).downcase
6
6
  end
7
7
 
8
8
  def build_tag(env = ENV)
@@ -1,3 +1,5 @@
1
+ require 'tempfile'
2
+
1
3
  module MiriamTech
2
4
  module GoCD
3
5
  module DSL
@@ -1,4 +1,5 @@
1
1
  require 'pathname'
2
+ require 'rake/clean'
2
3
 
3
4
  module MiriamTech
4
5
  module GoCD
@@ -10,7 +11,7 @@ module MiriamTech
10
11
  task :default => [:test]
11
12
  task :full => [:clobber, :build]
12
13
 
13
- CLEAN.add(root_path + '/test/reports')
14
+ CLEAN.add(root_path + 'test/reports')
14
15
  task :clean do
15
16
  docker_compose "stop"
16
17
  end
@@ -1,5 +1,5 @@
1
1
  module MiriamTech
2
2
  module GoCD
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
@@ -29,4 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "bundler", "~> 2.0"
30
30
  spec.add_development_dependency "rake", ">= 10.0"
31
31
  spec.add_development_dependency "minitest", "~> 5.0"
32
+ spec.add_development_dependency 'rspec-expectations'
33
+ spec.add_development_dependency 'rspec-mocks'
32
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miriamtech-gocd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Treis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-17 00:00:00.000000000 Z
11
+ date: 2020-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,34 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec-expectations
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-mocks
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  description:
56
84
  email:
57
85
  - ken@miriamtech.com