argus-builder 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +24 -3
- data/bin/argus-worker +1 -0
- data/lib/argus/docker.rb +2 -3
- data/lib/argus/runner.rb +13 -1
- data/lib/argus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 493ccb46314486055d4caa0d2168bef4e69313b4
|
4
|
+
data.tar.gz: 98457b166a0c082cb757ba44b28dccb39dbfbbd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c826fb33c67b41c83ccbe02863b2f5932ecf1c4f10c126d3405e0937164a7086ee9aed052fb7f7c3866ca355578a0374977ff71f58aced0ad9a887d5f4cc5ef
|
7
|
+
data.tar.gz: 504c2d7180ed1f595893486444664c14c4b5be1b1578140398216208b5705e64d90d77e094695dbb7eed71fc0dfa1545f47b5a7b683c6b7b1c41327995d6886b
|
data/README.md
CHANGED
@@ -13,6 +13,10 @@ Features:
|
|
13
13
|
The primary goal of this project is simplicity. It should be easy to
|
14
14
|
adapt to your exact image-building needs.
|
15
15
|
|
16
|
+
Argus is implemented as a shoryuken
|
17
|
+
worker. [Shoryuken](https://github.com/phstc/shoryuken) is a super
|
18
|
+
efficient AWS SQS thread based message processor.
|
19
|
+
|
16
20
|
## Quick-start
|
17
21
|
|
18
22
|
You will need:
|
@@ -84,7 +88,7 @@ argus-worker
|
|
84
88
|
## Build procedure
|
85
89
|
|
86
90
|
Argus builds images as follows. Examine and modify `lib/argus/git.rb`
|
87
|
-
and `lib/argus/docker.
|
91
|
+
and `lib/argus/docker.rb` to change exact behaviour.
|
88
92
|
|
89
93
|
1. `git clone` a new github repo, or `git checkout` an existing one
|
90
94
|
1. authenticate to elastic container registry using provided credentials
|
@@ -106,7 +110,8 @@ require 'aws-sdk'
|
|
106
110
|
msg = {
|
107
111
|
org: org,
|
108
112
|
repo: repo,
|
109
|
-
branch: branch
|
113
|
+
branch: branch,
|
114
|
+
tag: repo:branch # optional
|
110
115
|
}
|
111
116
|
|
112
117
|
sqs = Aws::SQS::Client.new
|
@@ -116,6 +121,22 @@ sqs.send_message(
|
|
116
121
|
)
|
117
122
|
```
|
118
123
|
|
124
|
+
If no tag is given it will be constructed as
|
125
|
+
`registry/repo:branch`. The git branch will have `/` changed to `-` to
|
126
|
+
make a legal docker image name.
|
127
|
+
|
128
|
+
For example, git repo:
|
129
|
+
|
130
|
+
```
|
131
|
+
rlister/argus:feature/foo
|
132
|
+
```
|
133
|
+
|
134
|
+
will produce docker image:
|
135
|
+
|
136
|
+
```
|
137
|
+
xxx.dkr.ecr.us-east-1.amazonaws.com/argus:feature-foo
|
138
|
+
```
|
139
|
+
|
119
140
|
## Shoryuken options
|
120
141
|
|
121
142
|
`argus` is a simple shoryuken worker. You can run it directly from the
|
@@ -171,7 +192,7 @@ the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
171
192
|
## Contributing
|
172
193
|
|
173
194
|
Bug reports and pull requests are welcome on GitHub at
|
174
|
-
https://github.com/
|
195
|
+
https://github.com/rlister/argus. This project is intended to be a
|
175
196
|
safe, welcoming space for collaboration, and contributors are expected
|
176
197
|
to adhere to the
|
177
198
|
[Contributor Covenant](http://contributor-covenant.org) code of
|
data/bin/argus-worker
CHANGED
data/lib/argus/docker.rb
CHANGED
data/lib/argus/runner.rb
CHANGED
@@ -32,6 +32,18 @@ module Argus
|
|
32
32
|
URI.parse(auth.proxy_endpoint).host
|
33
33
|
end
|
34
34
|
|
35
|
+
## return image tag, or make it out of:
|
36
|
+
## repo:branch with / changed to - in branch;
|
37
|
+
## prepend registry if none given
|
38
|
+
def image_name(registry, msg)
|
39
|
+
name = msg[:tag] || (msg[:repo] + ':' + msg[:branch].gsub('/', '-'))
|
40
|
+
if name.include?('/')
|
41
|
+
name
|
42
|
+
else
|
43
|
+
"#{registry}/#{name}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
35
47
|
def initialize(msg)
|
36
48
|
msg = symbolize_keys(msg)
|
37
49
|
|
@@ -46,7 +58,7 @@ module Argus
|
|
46
58
|
registry = authenticate_ecr
|
47
59
|
|
48
60
|
## docker image to build
|
49
|
-
img = Image.new(
|
61
|
+
img = Image.new(image_name(registry, msg))
|
50
62
|
|
51
63
|
Dir.chdir(dir) do
|
52
64
|
img.pull # pull some layers to speed up the build
|
data/lib/argus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: argus-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|