samus 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +8 -0
- data/Dockerfile +2 -0
- data/README.md +34 -0
- data/bin/samus +23 -17
- data/commands/build/changelog-parse +1 -1
- data/lib/samus/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 654c4b19f600440932a23fd88828da9aa160ef507bb583b2cbc16c6e327aad0b
|
4
|
+
data.tar.gz: a4330ebd58c0c3ef5a19776a7ea4eba296278e95ed0a74342024ed0ac9f7737a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e931ee16f9ee22f06ec16f2b5971dd2c7fa9ab77a37d93595a8de916048cea6a6f3619798bfcb0f918fd0033324c66c75a4eab9e8a195059380388cd0df89bec
|
7
|
+
data.tar.gz: 69f7493bb66ac0f3c51b5009e793075dd7f37c1a8f20fa0d1e4f02969cb23fa04db8bf8caec4e3cf519903e5454fb935bc14a6c8cbbd7e016d71f8fd882a668a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 2.0.3 - August 12th, 2018
|
2
|
+
|
3
|
+
- Add `--docker` support to build and publish which runs Samus inside a pre-built
|
4
|
+
container with all default dependencies. You can provide
|
5
|
+
`--docker-image image-name` to use a different image from the default
|
6
|
+
`lsegal/samus` container.
|
7
|
+
- Fix `changelog-parse` command.
|
8
|
+
|
1
9
|
# 2.0.2 - August 11th, 2018
|
2
10
|
|
3
11
|
- Some more fixes for Windows compatibility when using `archive-git-full`.
|
data/Dockerfile
CHANGED
data/README.md
CHANGED
@@ -21,6 +21,8 @@ Samus is a RubyGem and requires Ruby 1.9.x+. Installing is as easy as typing:
|
|
21
21
|
$ gem install samus
|
22
22
|
```
|
23
23
|
|
24
|
+
If you would rather use Samus via Docker, see the Docker section in Usage below.
|
25
|
+
|
24
26
|
## Usage
|
25
27
|
|
26
28
|
Samus is driven by a manifest file that describes the steps to perform when
|
@@ -151,6 +153,38 @@ your release as a directory instead of a zip with `--no-zip`.
|
|
151
153
|
Note: If you didn't name your manifest samus.json you can simply enter the
|
152
154
|
filename in the build command as `samus build VERSION manifest.json`.
|
153
155
|
|
156
|
+
### Docker Support
|
157
|
+
|
158
|
+
If you would prefer to run Samus on a pre-built image with prepared
|
159
|
+
dependencies, you can use the
|
160
|
+
[lsegal/samus](https://hub.docker.com/r/lsegal/samus/) Docker image as follows:
|
161
|
+
|
162
|
+
```sh
|
163
|
+
docker run --rm -v $HOME:/root -w /root/${PWD#$HOME} -it lsegal/samus \
|
164
|
+
samus build <VERSION>
|
165
|
+
```
|
166
|
+
|
167
|
+
Remember to replace `<VERSION>` with your version string (i.e. `1.0.0`). Then
|
168
|
+
to publish, use:
|
169
|
+
|
170
|
+
```sh
|
171
|
+
docker run --rm -v $HOME:/root:ro -w /root/${PWD#$HOME} -it lsegal/samus \
|
172
|
+
samus publish release-v<VERSION>.tar.gz
|
173
|
+
```
|
174
|
+
|
175
|
+
#### Docker Isolation Notes
|
176
|
+
|
177
|
+
Note that these instructions are _not_ meant to run an isolated release
|
178
|
+
environment, but instead as a convenience to provide all of the non-Ruby
|
179
|
+
dependencies that Samus might need. If you wish to build and deploy from an
|
180
|
+
isolated environment, you would have to build a Dockerfile `FROM lsegal/samus`
|
181
|
+
and ensure that all necessary credentials and configuration is copied in. This
|
182
|
+
is an exercise left up to the user, since it can be complex and depends on the
|
183
|
+
amount of configuration needed for building (Git configuration, SSH keys, etc).
|
184
|
+
|
185
|
+
Also note that this syntax is currently only supported for POSIX style systems
|
186
|
+
and does not yet support Windows.
|
187
|
+
|
154
188
|
## Built-in Commands
|
155
189
|
|
156
190
|
Samus comes with a number of built-in commands optimized for dealing with
|
data/bin/samus
CHANGED
@@ -45,8 +45,9 @@ dry_run = false
|
|
45
45
|
zip_release = true
|
46
46
|
outfile = nil
|
47
47
|
docker = false
|
48
|
+
docker_image = "lsegal/samus:latest"
|
48
49
|
options = OptionParser.new do |opts|
|
49
|
-
opts.banner = "Usage: samus publish [options] <
|
50
|
+
opts.banner = "Usage: samus publish [options] <release_file> [release_file ...]\n"
|
50
51
|
opts.banner += " samus build [options] <version> [build.json]\n"
|
51
52
|
opts.banner += " samus show-cmd [stage] [name]\n"
|
52
53
|
|
@@ -56,36 +57,41 @@ options = OptionParser.new do |opts|
|
|
56
57
|
dry_run = true
|
57
58
|
end
|
58
59
|
if command == Samus::Builder
|
59
|
-
opts.on('--[no-]zip', 'Zip release
|
60
|
+
opts.on('--[no-]zip', 'Zip release file') do |zip|
|
60
61
|
zip_release = zip
|
61
62
|
end
|
62
63
|
opts.on('-o FILE', '--output', 'The file (no extension) to generate') do |file|
|
63
64
|
outfile = file
|
64
65
|
end
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
end
|
67
|
+
opts.on('--docker', 'Use Docker to build or publish') do |_v|
|
68
|
+
docker = true
|
69
|
+
end
|
70
|
+
opts.on('--docker-image IMAGE', 'Which Docker image to use (default: lsegal/samus:latest)') do |img|
|
71
|
+
docker_image = img
|
69
72
|
end
|
70
73
|
end
|
71
74
|
options.parse!
|
72
75
|
|
76
|
+
if docker
|
77
|
+
cmd = <<-COMMAND
|
78
|
+
docker run --rm -v "#{Dir.home}:/root"
|
79
|
+
-v "#{Dir.pwd}:/build" -w /build -it #{docker_image}
|
80
|
+
sh -c "chmod 400 /root/.ssh/*" &&
|
81
|
+
samus #{command == Samus::Builder ? 'build' : 'publish'} #{ARGV.join(' ')}
|
82
|
+
COMMAND
|
83
|
+
cmd = cmd.gsub(/ +/, ' ').delete("\n").strip
|
84
|
+
puts "[C] #{cmd}"
|
85
|
+
system(cmd)
|
86
|
+
exit($?.to_i)
|
87
|
+
end
|
88
|
+
|
73
89
|
if command == Samus::Publisher
|
74
90
|
ARGV.each do |dir|
|
75
91
|
raise "Aborting due to missing path #{dir}" unless File.exist?(dir)
|
76
92
|
end
|
77
93
|
|
78
94
|
ARGV.each do |dir|
|
79
|
-
if docker
|
80
|
-
cmd = <<-COMMAND
|
81
|
-
docker run --rm -v "#{Dir.home}/.samus:/root/.samus"
|
82
|
-
-v "#{Dir.pwd}:/app" -w /app -t lsegal/samus
|
83
|
-
samus publish "#{dir}"
|
84
|
-
COMMAND
|
85
|
-
system(cmd.delete("\n").chomp)
|
86
|
-
next
|
87
|
-
end
|
88
|
-
|
89
95
|
if File.directory?(dir)
|
90
96
|
command.new(dir).publish(dry_run)
|
91
97
|
elsif File.file?(dir) # it has to be an archive
|
@@ -104,6 +110,6 @@ elsif command == Samus::Builder
|
|
104
110
|
command.new(file).build(dry_run, zip_release, outfile)
|
105
111
|
end
|
106
112
|
else
|
107
|
-
puts
|
113
|
+
puts options
|
108
114
|
exit 1
|
109
115
|
end
|
data/lib/samus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loren Segal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: lsegal@soen.ca
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 2.6
|
110
|
+
rubygems_version: 2.7.6
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Samus helps you release Open Source Software.
|