miniexec 0.2.1 → 0.2.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/miniexec +8 -2
  3. data/lib/miniexec.rb +4 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 550158d86f5f2784056c277e222f8b446df695deccd78dfa6e585ec4ff755852
4
- data.tar.gz: e6b1ca3987365aabf54d3f126b153a0b527e1b5b2075395b57ecb3c240a046ca
3
+ metadata.gz: 69219c3771eda716d56f9ee00bb7d8a7a9c214b38a35d17d2c14e297a0887420
4
+ data.tar.gz: 5ad61f25f0f1f757325e3e05be347ab3eae5d1861853c67ef938cc286fbdecd8
5
5
  SHA512:
6
- metadata.gz: c3483cdf517a9fec48c1c0146ead79f323986892420cc5a5d7bf918f8ff2f02ff7734ed324bf75df81b8b10e7258376b8ba185d6de3914f4aeccb550553832f7
7
- data.tar.gz: 19b604234de06aa7276e15fa73ea00c2f6f4419ee3f6414b2c2768d5c1cae61bcc91b51370f639a48ab5cdc195a6c93dbf2efa01c0731ff8e99ff83a9f91a7d0
6
+ metadata.gz: d2413f6f8cf00ee930073576d7f82272bb46927ae74bbe0877ab49564ffe37ea2ca5b7183ae62fbc0fe58025d53877cd585b0ee30313116ab67f7aac553a71eb
7
+ data.tar.gz: 6b99388154b691babbd489e16e8ea54e711b9451776e99792cdcf9e3bea8798e7295abf6eabb018d7fb5a0f99d444f0d0b481969743e996d7cd2c18a287cf6e2
data/bin/miniexec CHANGED
@@ -11,7 +11,8 @@ options = {
11
11
  env: {},
12
12
  path: '.',
13
13
  docker: ENV['DOCKER_HOST'] || '/run/docker.sock',
14
- cwd: true
14
+ cwd: true,
15
+ file: nil
15
16
  }
16
17
 
17
18
  OptionParser.new do |opts|
@@ -41,6 +42,10 @@ OptionParser.new do |opts|
41
42
  'Location of the docker socket') do |sock|
42
43
  options[:docker] = sock
43
44
  end
45
+ opts.on('-f', '--file FILE',
46
+ 'Manually specify a custom .gitlab-ci.yml file.') do |file|
47
+ options[:file] = file
48
+ end
44
49
  opts.on('-n', '--no-mount-cwd',
45
50
  'Don\'t mount the CWD in the container\'s WORKDIR by default.') do
46
51
  options[:cwd] = false
@@ -54,5 +59,6 @@ exec = MiniExec::MiniExec.new options[:job],
54
59
  docker_url: options[:docker],
55
60
  binds: options[:binds],
56
61
  env: options[:env],
57
- mount_cwd: options[:cwd] || false
62
+ mount_cwd: options[:cwd] || false,
63
+ file: options[:file]
58
64
  exec.run_job
data/lib/miniexec.rb CHANGED
@@ -32,10 +32,12 @@ module MiniExec
32
32
  docker_url: nil,
33
33
  binds: [],
34
34
  env: {},
35
- mount_cwd: true)
35
+ mount_cwd: true,
36
+ file: nil)
36
37
  @job_name = job
37
38
  @project_path = project_path
38
- @workflow = YAML.load(File.read("#{@project_path}/#{MiniExec.workflow_file}"))
39
+ file ||= "#{@project_path}/#{MiniExec.workflow_file}"
40
+ @workflow = YAML.load(File.read(file))
39
41
  @job = @workflow[job]
40
42
  @job['name'] = job
41
43
  @default_image = @workflow['image'] || 'debian:buster-slim'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miniexec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Pugh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-17 00:00:00.000000000 Z
11
+ date: 2021-06-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A minimal interpretor/executor for .gitlab-ci.yml
14
14
  email: pugh@s3kr.it