fig-lock 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: c3ee68dd9533f30826adbc4476c751c7b2b2e94f
4
- data.tar.gz: 5face655d47fc8a3bc173bcb08f73f3c1c6b656f
3
+ metadata.gz: 6bcf89eeb53d060edfce77f1e79144f60afb8ca0
4
+ data.tar.gz: d4bc1693fe2b5ddde7301d4cccdd0613467ce9c0
5
5
  SHA512:
6
- metadata.gz: cd3ff4c1df4b0535ef36c7fb356d1f7466d0f699fecf93de503abf252a60f3f9b76b7a93ab20147e247b9384e25e25734c753205be43fef92619119b5460bb04
7
- data.tar.gz: 8f174825d487d3c781887e329f568f568f3a4f5c8599b702a855720cdf87c1124ac9b69f54972a6ec99f6201b153fcdd2e49c43b65240300ee1f91c941836174
6
+ metadata.gz: e4d061a66cda3c4d6f9ab2d7f1d45d9207a1921ecb83b9ef32a4dfbbc4c0eee5eadae0d3b933cdb247a1001fe063f1f82089aab5dda1b12269bfe3b8d36224bd
7
+ data.tar.gz: 1b050ba684d4d1ca0973af8c1534bbc77afb75aea83b2acfc310995fa96f4cfa7e46e6eb8322328bce63095efd9b14723cf51c0a050b51e3ef54df740737f0da
data/README.md CHANGED
@@ -1,10 +1,26 @@
1
1
  # Fig::Lock
2
2
 
3
+ ## Overview
4
+
3
5
  Generates fig.lock files based on fig.yml files.
4
6
  Gets the latest versions of all images defined in a
5
7
  fig.yml file, rewrites them to include the specific tags
6
8
  of those versions, generates a fig.lock file.
7
9
 
10
+ ## Um, What?
11
+
12
+ ### The short answer
13
+ ```fig.lock``` is to ```fig.yml``` as ```Gemfile.lock``` is to ```Gemfile```
14
+
15
+ ### The longer answer
16
+
17
+ Okay so, suppose you have a bunch of docker images. You want these images to work together to do *something*.
18
+ You want whatever *something* is to be versioned because versioning is important - it helps you to figure out when a bug were introduced. It helps you roll back to a good version if something goes terribly wrong. All sorts of reasons!
19
+
20
+ [Fig](http://orchardup.github.io/fig/index.html) lets you describe your images and how they interact. But if you use ```latest``` tags in your image (or really anything other than explicit version locking that you do manually by always using specific tags for your images), it doesn't help you keep track of your versions - it just uses whatever docker images are installed locally, or fetches the specific tags from registries. This approach is fine if you're dealing with images that don't change very often. But if you're working in an environment where several images in different source repositories are under heavy development, it can be a problem to have to manually update the fig.yml file, and integration tests that auto-update might not be feasible.
21
+
22
+ This is why *Fig::Lock* exists. *Fig::Lock* lets you specify a fig.yml file containing images that use the ```latest``` tag. It generates fig.lock files by pulling down these images, figuring out what explicit tag latest maps to, and then generating a ```fig.lock``` file that uses these exact images. Then you can run your integration tests using this file, check it into source control, etc. The point is that you get a file that represents all the versions of the things in your system, so you can use this to reproduce it exactly.
23
+
8
24
  ## Installation
9
25
 
10
26
  Add this line to your application's Gemfile:
@@ -21,6 +37,26 @@ Or install it yourself as:
21
37
 
22
38
  ## Usage
23
39
 
40
+ fig-lock produces fig.lock files from fig.yml files, locking images to specific versions.
41
+ eg:
42
+
43
+ fig.yml:
44
+ ```
45
+ ---
46
+ image: ubuntu
47
+ image: my.docker-registry.com/repo/myimage
48
+ ```
49
+
50
+ resulting fig.lock:
51
+ ```
52
+ ---
53
+ image: ubuntu:14.04
54
+ image: my.docker-registry.com/repo/myimage:0.0.1
55
+ ```
56
+
57
+ Currently, fig-lock only works properly with images that have been explicitly tagged. However, the next
58
+ iteration should use hashes if tags are not available.
59
+
24
60
  ### Install
25
61
  The *install* command uses docker to retrieve all images
26
62
  defined in fig.lock. If no fig.lock file exists, one will
data/lib/fig/lock.rb CHANGED
@@ -85,7 +85,7 @@ module Fig
85
85
  image = v['image']
86
86
  if image
87
87
  log.info "Fetching #{image} ..."
88
- system "sudo docker pull #{image}"
88
+ system "sudo docker pull #{image}:latest"
89
89
  fail "Unable to fetch image: #{image}.\n\tExit code:#{$?.exitstatus}" unless $?.exitstatus.zero?
90
90
  end
91
91
  end
@@ -1,5 +1,5 @@
1
1
  module Fig
2
2
  class Lock
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig-lock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Shea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-12 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop