gz_release 0.0.9 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OTgwYTBlMjZkY2ZkZTg0YTZjMzZlOTc5OTRjNzQ5MjY1YmVmNTg3ZA==
5
- data.tar.gz: !binary |-
6
- ZTUwYTYwOGIzZTZlNDFkYzAzN2UzZGRmODBlMmE2ZmY0YzU4ZmFmNg==
2
+ SHA1:
3
+ metadata.gz: 9bbc82adef3d8c1c27ab5a9be6929da282f5b597
4
+ data.tar.gz: da8f59523e55deaa777a9c63193f69d66ca18539
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MWQ0YzVjMGFlNWY5ZTkxODcyNjU5YjIzMzc5YmIwODJkZWY0MTE0NGZlNDE5
10
- YjAzYWJjNDg1NTQ5OTUzZDZkNmRkNzk3MDQ0YjI4ZTM4OTc0NmUwMDliYjVj
11
- MDcwOTUyOGJkMDAwYjVlZmExNzI1NTdmZTFjOWMxNDViNDg0NzM=
12
- data.tar.gz: !binary |-
13
- MDEyY2M2YWM2OWNmODIzYjlhZmQ2MmM4YTU4NzA0NGZiOTQxNmM1NmMxMDdi
14
- NGNhMzNlZWNmNTM1NzFhODIyNjg2NTcwNzk0NGFjYjlmMjM3M2VkNDEzODRm
15
- Y2Y3ZDVlZTY5MWRiMTdkZDY0M2Q1MmRhN2E1MDY1YTQ3MTk1NjE=
6
+ metadata.gz: 8579026090136e2a4f7423615f8659c527fd0039ecf6f5a2443ab346676d3e3833a46edd301aa61fcfed997b620261f739feb40c903a443fb23fc6d6cd866449
7
+ data.tar.gz: a680fc1e62e1627d1bfb55fa6f136754203eeef89e63d2d8a5e5b2ea08a2f2e488b5ebf9c64b0aaae4a19c830881dfbc690cd1f1d11cf2d3114824dca7d3943f
data/README.md CHANGED
@@ -20,7 +20,73 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ ### Rakefile
24
+
25
+ Add the following to your `Rakefile`:
26
+
27
+ ``` ruby
28
+ require 'gz_release'
29
+
30
+ GzRelease::Tasks.install(
31
+ image_name: 'gazelle/<PROJECT_NAME>'
32
+ )
33
+ ```
34
+
35
+ This gives you a bunch of rake tasks:
36
+
37
+ ```
38
+ rake release:build # Builds the docker image from generated Dockerfile
39
+ rake release:dump # Dumps docker cache into ~/.docker/image.tar
40
+ rake release:load # Loads ~/.docker/image.tar into docker cache
41
+ rake release:pull # Pulls latest version of the image from dockerhub
42
+ rake release:push:branch # Pushes docker image tagged as current git branch
43
+ rake release:push:latest # Pushes docker image tagged as latest
44
+ rake release:push:release # Pushes docker image tagged as release
45
+ rake release:push:timestamp # Pushes docker image and git tag tagged by the timestamp
46
+ rake release:push:version # Pushes docker image tagged as version specified in Rakefile
47
+ rake release:tag:branch # Creates a tag for the branch for the docker image
48
+ rake release:tag:latest # Creates latest tag for the docker image
49
+ rake release:tag:release # Creates release tag for the docker image
50
+ rake release:tag:timestamp # Creates timestamp tag for the docker image and git repo
51
+ rake release:tag:version # Creates a tag for version specified in Rakefile for docker image
52
+ ```
53
+
54
+ ### Environment variables
55
+
56
+ The following evironment variables are required for pushing to a docker repository: `DOCKER_USER`, `DOCKER_EMAIL`, `DOCKER_PASSWORD`. They are the same values you provide when doing `docker login`. It's best to use an organization account for these values on CircleCI.
57
+
58
+ Optionally, you can also set `DOCKER_REPOSITORY` (e.g. tutum.co), which will cause the image to be tagged for and pushed to that repository.
59
+
60
+ ### Building on CircleCI
61
+
62
+ Create the environment variables for your project listed above on CircleCI. You can then have CircleCI build the docker image by creating a `circle.yml` including the following:
63
+
64
+ ``` yaml
65
+ machine:
66
+ services:
67
+ - docker
68
+ checkout:
69
+ pre:
70
+ - git config --global user.email "circleci@gazelle.com"
71
+ - git config --global user.name "Gazelle CircleCI Bot"
72
+ deployment:
73
+ all:
74
+ branch: /^(?!(master|dev)).*$/
75
+ commands:
76
+ - bundle exec rake release:build
77
+ - bundle exec rake release:push:branch
78
+ master:
79
+ branch: master
80
+ commands:
81
+ - bundle exec rake release:build
82
+ - bundle exec rake release:push:timestamp
83
+ - bundle exec rake release:push:release
84
+ dev:
85
+ branch: dev
86
+ commands:
87
+ - bundle exec rake release:build
88
+ - bundle exec rake release:push:latest
89
+ ```
24
90
 
25
91
  ## Contributing
26
92
 
data/lib/gz_release.rb CHANGED
@@ -1,4 +1 @@
1
- require 'English'
2
1
  require 'gz_release/version'
3
- require 'gz_release/tasks'
4
- require 'gz_release/test_helper'
@@ -1,7 +1,10 @@
1
+ require 'English'
2
+ require 'rake'
3
+
1
4
  module GzRelease
2
5
  # Rake tasks for building a docker image
3
6
  class Tasks
4
- include Rake::DSL if defined? Rake::DSL
7
+ include Rake::DSL
5
8
 
6
9
  DOCKERFILE_PATH = File.expand_path('./Dockerfile')
7
10
  DOCKER_CACHE_PATH = File.expand_path('~/.docker')
@@ -176,7 +179,7 @@ module GzRelease
176
179
  end
177
180
 
178
181
  def branch
179
- @branch ||= ENV['CIRCLE_BRANCH'] ? ENV['CIRCLE_BRANCH'] : `git rev-parse --abbrev-ref HEAD`.strip
182
+ @branch ||= (ENV['CIRCLE_BRANCH'] ? ENV['CIRCLE_BRANCH'] : `git rev-parse --abbrev-ref HEAD`).strip.gsub(/\//,'_')
180
183
  end
181
184
 
182
185
  # Version
@@ -1,4 +1,4 @@
1
1
  # Version
2
2
  module GzRelease
3
- VERSION = '0.0.9'
3
+ VERSION = '0.0.12'
4
4
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gz_release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Madsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-04 00:00:00.000000000 Z
11
+ date: 2015-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  description: Tasks for building docker images on a CI
@@ -45,8 +45,8 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
49
- - .rubocop.yml
48
+ - ".gitignore"
49
+ - ".rubocop.yml"
50
50
  - Gemfile
51
51
  - LICENSE.txt
52
52
  - README.md
@@ -66,19 +66,18 @@ require_paths:
66
66
  - lib
67
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ! '>='
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ! '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.4.5
79
+ rubygems_version: 2.4.5.1
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Tasks for building docker images on a CI
83
83
  test_files: []
84
- has_rdoc: