miriamtech-gocd 0.2.1 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miriamtech/gocd/artifacts.rb +10 -0
- data/lib/miriamtech/gocd/docker.rb +1 -3
- data/lib/miriamtech/gocd/lambda.rb +2 -0
- data/lib/miriamtech/gocd/tasks.rb +10 -5
- data/lib/miriamtech/gocd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52f9d377244ce4558f66ae5ea21b3ea76216708568a3aa78ad30c21354a6369b
|
4
|
+
data.tar.gz: 8aca9451787f550885aa3b71a15e7941828758f55b8aa81e2fe1ff38869cd025
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cb3141a05bb08bafb546b2d1156c01a3608de988ede9cbc385f8e1e7eec5a04b979a4fc52099ec462781243e9354a27ea0a89adad3829bcf23d6437abd855cb
|
7
|
+
data.tar.gz: 4b2d8848833dfb5fa6b935ee28f0a04ae038832dce5469da7a618115105a18baeab57e769ab839ae7f149d13da6a99db8b9f9bdd2b152907b675c440e66c0915
|
@@ -1,6 +1,16 @@
|
|
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
15
|
artifacts_volume = sanitized_volume_name("#{prefix}#{build_tag}")
|
6
16
|
docker "volume create #{artifacts_volume}"
|
@@ -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'] ||
|
5
|
+
(env['GO_PIPELINE_NAME'] || root_path.basename.to_s).downcase
|
6
6
|
end
|
7
7
|
|
8
8
|
def build_tag(env = ENV)
|
@@ -14,7 +14,6 @@ module MiriamTech
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def docker_compose(string)
|
17
|
-
# PIPELINE_NAME = (ENV['GO_PIPELINE_NAME'] || 'ilien').downcase
|
18
17
|
cd root_path do
|
19
18
|
sh "docker-compose -p #{project_name} -f docker-compose.yml #{string}"
|
20
19
|
end
|
@@ -28,7 +27,6 @@ module MiriamTech
|
|
28
27
|
else
|
29
28
|
@build_tag = ""
|
30
29
|
end
|
31
|
-
env['BUILD_TAG'] = @build_tag
|
32
30
|
end
|
33
31
|
end
|
34
32
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'pathname'
|
2
|
+
require 'rake/clean'
|
2
3
|
|
3
4
|
module MiriamTech
|
4
5
|
module GoCD
|
@@ -10,12 +11,16 @@ module MiriamTech
|
|
10
11
|
task :default => [:test]
|
11
12
|
task :full => [:clobber, :build]
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
task :environment do
|
15
|
+
ENV['BUILD_TAG'] = build_tag
|
16
|
+
end
|
17
|
+
|
18
|
+
CLEAN.add(root_path + 'test/reports')
|
19
|
+
task :clean => :environment do
|
15
20
|
docker_compose "stop"
|
16
21
|
end
|
17
22
|
|
18
|
-
task :clobber => :cleanup_old_images do
|
23
|
+
task :clobber => [:environment, :cleanup_old_images] do
|
19
24
|
docker_compose "rm -fv"
|
20
25
|
end
|
21
26
|
|
@@ -23,11 +28,11 @@ module MiriamTech
|
|
23
28
|
cleanup_old_images(image_name, revisions_to_keep)
|
24
29
|
end
|
25
30
|
|
26
|
-
task :build do
|
31
|
+
task :build => :environment do
|
27
32
|
docker "build --force-rm -t #{image_name}#{build_tag} #{root_path}"
|
28
33
|
end
|
29
34
|
|
30
|
-
task :test
|
35
|
+
task :test => :environment
|
31
36
|
|
32
37
|
task :push do
|
33
38
|
push(image_name)
|
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.
|
4
|
+
version: 0.2.6
|
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-
|
11
|
+
date: 2020-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|