runfile-tasks 0.5.3 → 0.5.4
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 +213 -202
- data/lib/runfile-tasks/all.rb +7 -6
- data/lib/runfile-tasks/docker/all.rb +1 -0
- data/lib/runfile-tasks/docker/docker.rb +61 -0
- data/lib/runfile-tasks/docker.rb +1 -0
- data/lib/runfile-tasks/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34ce3da6faaa2115da6a60aef9d21d2e2f7b9ab0ffd83450f618bb90931bb2a2
|
4
|
+
data.tar.gz: a83f6488be48514933b7d24e8b5b1c8c1743b62dc17627176432e572a2913486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75245b3e4dc36ee84bd65ad5c4c8c56e24366fe51bcdeeb7bdf9b4f2a277c5e463d6e71fd96f8d044c72433fd739b6b5fe85e6691324604edb7cb70569b99b44
|
7
|
+
data.tar.gz: f1fdafb4231b39e03d66bd5017d8f1e3d6c05adb75dbaae5f82aa33580be938953312848f426fb7153c05414e1e580afb1d67419048f309d044eb8ee7f310125
|
data/README.md
CHANGED
@@ -1,202 +1,213 @@
|
|
1
|
-
Runfile Tasks
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
```
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
```
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
```
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
#
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
[
|
201
|
-
|
202
|
-
|
1
|
+
# Runfile Tasks
|
2
|
+
|
3
|
+
A library of tasks ready to be included in your [Runfile]
|
4
|
+
|
5
|
+
## Install
|
6
|
+
|
7
|
+
Install the gem or require it in your Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'runfile-tasks'
|
11
|
+
```
|
12
|
+
|
13
|
+
In your Runfile, you can include either all tasks:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'runfile-tasks'
|
17
|
+
```
|
18
|
+
|
19
|
+
Or pick and choose from the various task categories:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'runfile-tasks/testing'
|
23
|
+
```
|
24
|
+
|
25
|
+
|
26
|
+
Requiring the task packs does not make them available in your Runfile
|
27
|
+
immediately. You need to activate any of the tasks you want as described
|
28
|
+
below.
|
29
|
+
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
Include any of the tasks you need in your Runfile like this:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
require 'runfile-tasks'
|
37
|
+
|
38
|
+
name "Greeter"
|
39
|
+
summary "A sample Runfile"
|
40
|
+
version "0.1.0"
|
41
|
+
|
42
|
+
# Include rdoc tasks and rspec tasks
|
43
|
+
RunfileTasks::Docs.rdoc
|
44
|
+
RunfileTasks::Testing.rspec
|
45
|
+
|
46
|
+
# The rest of your Runfile goes here
|
47
|
+
action :hello do
|
48
|
+
puts "world"
|
49
|
+
end
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
|
54
|
+
## Task Index
|
55
|
+
|
56
|
+
### Testing Tasks
|
57
|
+
|
58
|
+
Require all testing tasks:
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
require 'runfile-tasks/testing'
|
62
|
+
```
|
63
|
+
|
64
|
+
#### Testing with RSpec
|
65
|
+
|
66
|
+
Commands Added:
|
67
|
+
|
68
|
+
- `run spec [NAME] [TAG]` - Run all specs, a single spec file, or all specs
|
69
|
+
matching a tag.
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
# Only require the rspec tasks
|
73
|
+
require 'runfile-tasks/testing/rspec'
|
74
|
+
|
75
|
+
# Include the rspec tasks with default configuration
|
76
|
+
RunfileTasks::Testing.rspec
|
77
|
+
|
78
|
+
# Set the Runfile action to 'test' instead of the default 'spec'
|
79
|
+
RunfileTasks::Testing.rspec 'test'
|
80
|
+
|
81
|
+
# Change the default options with a hash (these are the defaults)
|
82
|
+
RunfileTasks::rspec action: 'spec',
|
83
|
+
pattern: './spec/**/*_spec.rb', command: 'rspec'
|
84
|
+
|
85
|
+
```
|
86
|
+
|
87
|
+
|
88
|
+
#### Testing with Minitest
|
89
|
+
|
90
|
+
Commands Added:
|
91
|
+
|
92
|
+
- `test [NAME]` - Run all tests or a single test file.
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
# Only require the minitest tasks
|
96
|
+
require 'runfile-tasks/testing/minitest'
|
97
|
+
|
98
|
+
# Include the minitest tasks with default configuration
|
99
|
+
RunfileTasks::Testing.minitest
|
100
|
+
|
101
|
+
# Set the file pattern to look for (this is the default)
|
102
|
+
RunfileTasks::Testing.minitest './test/*_test.rb'
|
103
|
+
|
104
|
+
```
|
105
|
+
|
106
|
+
#### Testing with Cucumber
|
107
|
+
|
108
|
+
Commands Added:
|
109
|
+
|
110
|
+
- `(feature|features) [<tag_or_file> --list --fast]` - Run cucumber feature
|
111
|
+
tests or show list of available features.
|
112
|
+
- `stepdefs` - Generate a markdown document from the step definitions
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
# Only require the cucumber tasks
|
116
|
+
require 'runfile-tasks/testing/cucumber'
|
117
|
+
|
118
|
+
# Include the cucumber tasks with default configuration
|
119
|
+
RunfileTasks::Testing.cucumber
|
120
|
+
|
121
|
+
# Include the step definitions markdown generator
|
122
|
+
RunfileTasks::Testing.cucumber_stepdefs
|
123
|
+
```
|
124
|
+
|
125
|
+
|
126
|
+
### Gem Authoring Tasks
|
127
|
+
|
128
|
+
Commands Added:
|
129
|
+
|
130
|
+
- `build [--install]` - Build gem from gemspec and move it to 'gems' folder.
|
131
|
+
Use --install to also install it.
|
132
|
+
- `install [--remote]` - Install gem from local gem file or from rubygems
|
133
|
+
(--remote).
|
134
|
+
- `publish` - Publish gem to rubygems. Make sure to 'run gem build' before
|
135
|
+
you publish.
|
136
|
+
- `yank [VERSION]` - Yank gem from rubygems.
|
137
|
+
|
138
|
+
|
139
|
+
```ruby
|
140
|
+
require 'runfile-tasks/rubygems'
|
141
|
+
|
142
|
+
# Include the tasks with default configuration. Pass in your gem name.
|
143
|
+
RunfileTasks::RubyGems.all 'my-gem'
|
144
|
+
|
145
|
+
# Set the folder where gems are copied after they are built (default)
|
146
|
+
RunfileTasks::RubyGems.all 'my-gem', 'gems'
|
147
|
+
|
148
|
+
# Include only the `build` and `install` tasks
|
149
|
+
RunfileTasks::RubyGems.build 'my-gem'
|
150
|
+
|
151
|
+
# Include only the `publish` and `yank` tasks
|
152
|
+
RunfileTasks::RubyGems.publish 'my-gem'
|
153
|
+
```
|
154
|
+
|
155
|
+
|
156
|
+
### Documentation Tasks
|
157
|
+
|
158
|
+
Commands Added:
|
159
|
+
|
160
|
+
- `rdoc [-- OPTIONS...]` - Generate documentation using the rdoc command
|
161
|
+
line tool. To pass arguments to rdoc, place them after '--'.
|
162
|
+
|
163
|
+
|
164
|
+
```ruby
|
165
|
+
require 'runfile-tasks/docs'
|
166
|
+
|
167
|
+
# Include the tasks with default configuration.
|
168
|
+
RunfileTasks::Docs.rdoc
|
169
|
+
|
170
|
+
# Set the files to be considered (default below)
|
171
|
+
RunfileTasks::Docs.rdoc '**/*.{rb,md}'
|
172
|
+
|
173
|
+
# Pass any additional option directly to rdoc (defaults below)
|
174
|
+
RunfileTasks::Docs.rdoc '**/*.{rb,md}', ["--main README.md", "--all",]
|
175
|
+
```
|
176
|
+
|
177
|
+
|
178
|
+
### Docker Tasks
|
179
|
+
|
180
|
+
Commands Added:
|
181
|
+
|
182
|
+
- `docker build`
|
183
|
+
- `docker test`
|
184
|
+
- `docker push`
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
require 'runfile-tasks/docker'
|
188
|
+
|
189
|
+
# Provide an image name and version
|
190
|
+
RunfileTasks::Docker.all "dannyben/runfile", "0.1.0"
|
191
|
+
```
|
192
|
+
|
193
|
+
|
194
|
+
### Changelog Tasks
|
195
|
+
|
196
|
+
This command requires that you have [github_changelog_generator] in your Gemfile.
|
197
|
+
|
198
|
+
Commands Added:
|
199
|
+
|
200
|
+
- `changelog [--commit]` - Generates a changelog and optionally commits it to the git repository.
|
201
|
+
|
202
|
+
|
203
|
+
```ruby
|
204
|
+
require 'runfile-tasks/changelog'
|
205
|
+
|
206
|
+
# Include the task and provide your github user/repo
|
207
|
+
RunfileTasks::Changelog.generator "DannyBen/runfile"
|
208
|
+
```
|
209
|
+
|
210
|
+
---
|
211
|
+
[Runfile]: https://github.com/DannyBen/runfile
|
212
|
+
[random cat]: http://thecatapi.com/api/images/get
|
213
|
+
[github_changelog_generator]: https://github.com/github-changelog-generator/github-changelog-generator
|
data/lib/runfile-tasks/all.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require "runfile-tasks/version"
|
2
|
-
|
3
|
-
require "runfile-tasks/rubygems"
|
4
|
-
require "runfile-tasks/docs"
|
5
|
-
require "runfile-tasks/testing"
|
6
|
-
require "runfile-tasks/changelog"
|
1
|
+
require "runfile-tasks/version"
|
2
|
+
|
3
|
+
require "runfile-tasks/rubygems"
|
4
|
+
require "runfile-tasks/docs"
|
5
|
+
require "runfile-tasks/testing"
|
6
|
+
require "runfile-tasks/changelog"
|
7
|
+
require "runfile-tasks/docker"
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'runfile-tasks/docker/docker'
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'runfile-tasks/refinements'
|
2
|
+
|
3
|
+
module RunfileTasks
|
4
|
+
module Docker
|
5
|
+
extend self
|
6
|
+
using Refinements
|
7
|
+
|
8
|
+
def all(image_name, image_version)
|
9
|
+
build image_name, image_version
|
10
|
+
test image_name, image_version
|
11
|
+
push image_name, image_version
|
12
|
+
end
|
13
|
+
|
14
|
+
def build(image_name, image_version)
|
15
|
+
command "docker"
|
16
|
+
|
17
|
+
help "Build the docker image"
|
18
|
+
action :build, :b do |args|
|
19
|
+
puts "g`Building docker image #{image_name}`".in_color
|
20
|
+
system "docker build -t #{image_name} ."
|
21
|
+
system "docker tag #{image_name} #{image_name}:#{image_version}"
|
22
|
+
system "docker images | grep #{image_name}"
|
23
|
+
end
|
24
|
+
|
25
|
+
endcommand
|
26
|
+
end
|
27
|
+
|
28
|
+
def test(image_name, image_version)
|
29
|
+
command "docker"
|
30
|
+
|
31
|
+
help "Test the --version flag in the dockerized version"
|
32
|
+
action :test, :t do |args|
|
33
|
+
docker_version = `docker run --rm #{image_name} --version`.chomp
|
34
|
+
if docker_version != image_version
|
35
|
+
puts "r`FAIL: docker version is #{docker_version}, expected #{image_version}`".in_color
|
36
|
+
exit 1
|
37
|
+
else
|
38
|
+
puts "g`PASS: docker version is #{docker_version}`"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
endcommand
|
43
|
+
end
|
44
|
+
|
45
|
+
def push(image_name, image_version)
|
46
|
+
command "docker"
|
47
|
+
|
48
|
+
help "Build the docker image"
|
49
|
+
action :push, :p do |args|
|
50
|
+
puts "g`Pushing docker image #{image_name}`".in_color
|
51
|
+
system "docker push #{image_name}"
|
52
|
+
system "docker push #{image_name}:#{image_version}"
|
53
|
+
end
|
54
|
+
|
55
|
+
endcommand
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'runfile-tasks/docker/all'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runfile-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: runfile
|
@@ -34,6 +34,9 @@ files:
|
|
34
34
|
- lib/runfile-tasks.rb
|
35
35
|
- lib/runfile-tasks/all.rb
|
36
36
|
- lib/runfile-tasks/changelog.rb
|
37
|
+
- lib/runfile-tasks/docker.rb
|
38
|
+
- lib/runfile-tasks/docker/all.rb
|
39
|
+
- lib/runfile-tasks/docker/docker.rb
|
37
40
|
- lib/runfile-tasks/docs.rb
|
38
41
|
- lib/runfile-tasks/docs/all.rb
|
39
42
|
- lib/runfile-tasks/docs/rdoc.rb
|
@@ -66,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
66
69
|
- !ruby/object:Gem::Version
|
67
70
|
version: '0'
|
68
71
|
requirements: []
|
69
|
-
rubygems_version: 3.
|
72
|
+
rubygems_version: 3.3.3
|
70
73
|
signing_key:
|
71
74
|
specification_version: 4
|
72
75
|
summary: Runfile tasks collection
|