docker-construct 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.bundle/config +2 -0
- data/.gitignore +3 -0
- data/.semver +6 -0
- data/Gemfile +11 -0
- data/README.md +28 -0
- data/Rakefile +12 -0
- data/bin/bundler +16 -0
- data/bin/cdiff +16 -0
- data/bin/colortab +16 -0
- data/bin/decolor +16 -0
- data/bin/rake +16 -0
- data/bin/semver +16 -0
- data/bin/term_display +16 -0
- data/bin/term_mandel +16 -0
- data/docker-construct.gemspec +19 -0
- data/history.rdoc +3 -0
- data/lib/docker-construct.rb +6 -0
- data/lib/version.rb +3 -0
- data/tasks/docker-construct.rake +49 -0
- metadata +78 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0e8b9425fac3339caeaca692d1e8553f0ce225d0
|
4
|
+
data.tar.gz: 96789d27b7ee48c5bf30c63fb6ccc5fc26968afc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 29394d3ba9d22bec38398605bc67416bc296bd6e52df0cdce81d3576667ba11eafb713cd852fbcd2f89a27ef0c7fc96236c5609d9cf98005fbd504d9f5a1876c
|
7
|
+
data.tar.gz: fa80e9791ce08feec29547fb174287bcd0cb86db74f364917bf1caf55713030521a48de3fc85388cab5fcf689d4e78d73bd8b58ce717a766bb647e623ac4c919
|
data/.bundle/config
ADDED
data/.gitignore
ADDED
data/.semver
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
DockerConstruct
|
2
|
+
===============
|
3
|
+
|
4
|
+
Rake tasks to build docker images
|
5
|
+
---------------------------------
|
6
|
+
|
7
|
+
|
8
|
+
Installation
|
9
|
+
------------
|
10
|
+
Either:
|
11
|
+
- Add `gem "docker-construct"` to your Gemfile and run bundle install.
|
12
|
+
|
13
|
+
or
|
14
|
+
|
15
|
+
- Run `gem install docker-construct`
|
16
|
+
|
17
|
+
Usage
|
18
|
+
-----
|
19
|
+
1. Add `require "docker-construct"` to your Rakefile
|
20
|
+
2. Call the tasks that you want, just as with your usual Rake tasks (examples below!).
|
21
|
+
|
22
|
+
|
23
|
+
Contributing
|
24
|
+
------------
|
25
|
+
1. Make a fork
|
26
|
+
2. Make your changes!
|
27
|
+
3. Push your changes to your fork
|
28
|
+
4. Create a Pull Request
|
data/Rakefile
ADDED
data/bin/bundler
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'bundler' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('bundler', 'bundler')
|
data/bin/cdiff
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'cdiff' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('term-ansicolor', 'cdiff')
|
data/bin/colortab
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'colortab' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('term-ansicolor', 'colortab')
|
data/bin/decolor
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'decolor' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('term-ansicolor', 'decolor')
|
data/bin/rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rake', 'rake')
|
data/bin/semver
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'semver' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('semver2', 'semver')
|
data/bin/term_display
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'term_display' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('term-ansicolor', 'term_display')
|
data/bin/term_mandel
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'term_mandel' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('term-ansicolor', 'term_mandel')
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require File.expand_path('../lib/version', __FILE__)
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "docker-construct"
|
8
|
+
spec.version = DockerConstruct::VERSION
|
9
|
+
spec.authors = ["Richard Vickerstaff"]
|
10
|
+
spec.email = ["m3akq@btinternet.com"]
|
11
|
+
spec.description = ""
|
12
|
+
spec.summary = ""
|
13
|
+
spec.homepage = "https://github.com/RichardVickerstaff/docker-build"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.require_paths = ["lib","tasks"]
|
17
|
+
|
18
|
+
spec.add_runtime_dependency "rake", "~> 10"
|
19
|
+
end
|
data/history.rdoc
ADDED
data/lib/version.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
namespace :"docker" do
|
2
|
+
|
3
|
+
def image_name file
|
4
|
+
file.sub('Dockerfile.','')
|
5
|
+
end
|
6
|
+
|
7
|
+
def tag
|
8
|
+
tag = `git reflog --decorate -1`.match(/tag: (?<tag>.*?),/)
|
9
|
+
tag.nil? ? "latest" : tag[:tag]
|
10
|
+
end
|
11
|
+
|
12
|
+
def docker_repo
|
13
|
+
"#{@docker_repo}/"
|
14
|
+
end
|
15
|
+
|
16
|
+
def run_before_hooks file
|
17
|
+
File.open(file, 'r') {|f| @file = f.read }
|
18
|
+
|
19
|
+
hooks = @file.scan(/^##=\s?(.*)/)
|
20
|
+
hooks.each do |hook|
|
21
|
+
sh hook.first
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
files = Dir["Dockerfile*"]
|
26
|
+
task :build => files.map { |file| "docker:build:#{image_name file}"}
|
27
|
+
task :push => files.map { |file| "docker:push:#{image_name file}"}
|
28
|
+
|
29
|
+
namespace :build do
|
30
|
+
files.each do |file|
|
31
|
+
desc "Build #{file}"
|
32
|
+
task image_name(file).to_sym do
|
33
|
+
run_before_hooks file
|
34
|
+
sh "ln -snf #{file} Dockerfile"
|
35
|
+
sh "docker build -t '#{docker_repo}#{image_name file}:#{tag}' ."
|
36
|
+
sh "rm -f Dockerfile"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
namespace :push do
|
42
|
+
files.each do |file|
|
43
|
+
desc "Push #{file}"
|
44
|
+
task image_name(file).to_sym do
|
45
|
+
sh "docker push '#{docker_repo}#{image_name file}:#{tag}'"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: docker-construct
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Richard Vickerstaff
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '10'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '10'
|
27
|
+
description: ''
|
28
|
+
email:
|
29
|
+
- m3akq@btinternet.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".bundle/config"
|
35
|
+
- ".gitignore"
|
36
|
+
- ".semver"
|
37
|
+
- Gemfile
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- bin/bundler
|
41
|
+
- bin/cdiff
|
42
|
+
- bin/colortab
|
43
|
+
- bin/decolor
|
44
|
+
- bin/rake
|
45
|
+
- bin/semver
|
46
|
+
- bin/term_display
|
47
|
+
- bin/term_mandel
|
48
|
+
- docker-construct.gemspec
|
49
|
+
- history.rdoc
|
50
|
+
- lib/docker-construct.rb
|
51
|
+
- lib/version.rb
|
52
|
+
- tasks/docker-construct.rake
|
53
|
+
homepage: https://github.com/RichardVickerstaff/docker-build
|
54
|
+
licenses:
|
55
|
+
- MIT
|
56
|
+
metadata: {}
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
- tasks
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
requirements: []
|
73
|
+
rubyforge_project:
|
74
|
+
rubygems_version: 2.4.5
|
75
|
+
signing_key:
|
76
|
+
specification_version: 4
|
77
|
+
summary: ''
|
78
|
+
test_files: []
|