itamae-plugin-recipe-gitlab_runner 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 609f6e76bbdcfd450e5eaec4543c216ba6a72550a58a8d911bcb68ce65a5b529
4
- data.tar.gz: dafaa239547b5a1ad1bbd2ff7305be18cb7f5ee41846d51a011df817dfb59c98
3
+ metadata.gz: 2558c243644df1df3b2e4a256d8b2c455a7b6a6eff8427cc48e1ed1790cb0e5d
4
+ data.tar.gz: 716db6ae49512c34a3b277e19c735d54fed7a3691f51b8eb8bbd17d7cb3ca412
5
5
  SHA512:
6
- metadata.gz: 860868e028749d9d18ca1963b5688328a009301793046097ae724c76fb26949ce044a778796bf68b7b6b8b9cba0dd05b0d53ebd92b4efb6e4d33762c5164e08a
7
- data.tar.gz: 63711e903e184b0f755a8d6d6e22839929e1e5221db4d56b17bb33e4264e70e788e8cc4764066d84fdad41d5ca9decb978a6355974c81f4d7859e896ad3c9568
6
+ metadata.gz: e8301b9dc87e61d8a9ca6c575c3ac887e073e4515151b51c51cf4757f0895281c6de302b16c8526e76f66f66d7fc0a4de5bab4019050c972b73089fac8b11a83
7
+ data.tar.gz: 32653284d531fd5b511e8219469489e0aea5887962a80404cad9c9eecf920f314ebd2231c85ccbf742179c902982b076ac1b5d718f61d407abd881c7a42bf34e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## master
2
- [full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.1.0...master)
2
+ [full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.2.0...master)
3
+
4
+ ## 0.2.0
5
+ [full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.1.0...v0.2.0)
6
+
7
+ * Impl `register_gitlab_runner`
8
+ * https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/pull/5
3
9
 
4
10
  ## 0.1.0
5
11
  * first release
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Itamae plugin to install [GitLab Runner](https://docs.gitlab.com/runner/)
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/itamae-plugin-recipe-gitlab_runner.svg)](https://badge.fury.io/rb/itamae-plugin-recipe-gitlab_runner)
5
6
  [![Build Status](https://travis-ci.org/sue445/itamae-plugin-recipe-gitlab_runner.svg?branch=master)](https://travis-ci.org/sue445/itamae-plugin-recipe-gitlab_runner)
6
7
 
7
8
  ## Installation
@@ -31,12 +32,9 @@ Or `include_recipe` just what you need manually:
31
32
 
32
33
  ```ruby
33
34
  include_recipe "gitlab_runner::install"
35
+ include_recipe "gitlab_runner::register_gitlab_runner"
34
36
  ```
35
37
 
36
- After, you need to register a runner
37
-
38
- https://docs.gitlab.com/runner/register/index.html
39
-
40
38
  ### Node
41
39
 
42
40
  ```yml
@@ -45,6 +43,31 @@ gitlab-runner:
45
43
  version: "10.0.0" # optional. Install latest version if omitted
46
44
  ```
47
45
 
46
+ ### `register_gitlab_runner`
47
+ Register a gitlab_runner
48
+
49
+ * `name` (`String`)
50
+ * runner name
51
+ * `options` (`Array`, `String`)
52
+ * args for `gitlab-runner register`
53
+ * `--non-interactive`, `--name` and `--description` are needless
54
+ * c.f. https://docs.gitlab.com/runner/register/#one-line-registration-command
55
+
56
+ e.g)
57
+
58
+ ```ruby
59
+ register_gitlab_runner "docker-runner" do
60
+ options [
61
+ "--url", "https://gitlab.com/",
62
+ "--registration-token", "PROJECT_REGISTRATION_TOKEN",
63
+ "--executor", "docker",
64
+ "--tag-list", "docker,aws",
65
+ "--run-untagged",
66
+ "--locked", "false",
67
+ ]
68
+ end
69
+ ```
70
+
48
71
  ## Development
49
72
 
50
73
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1 +1,2 @@
1
1
  include_recipe "gitlab_runner::install"
2
+ include_recipe "gitlab_runner::register_gitlab_runner"
@@ -0,0 +1,12 @@
1
+ define :register_gitlab_runner, options: [] do
2
+ runner_name = params[:name]
3
+
4
+ raise "name is required. (e.g. register_gitlab_runner 'your_runner_name')" unless runner_name
5
+
6
+ register_args = ["--non-interactive", "--name", runner_name] + Array(params[:options])
7
+ register_args.compact!
8
+
9
+ execute "gitlab-runner register #{register_args.join(" ")}" do
10
+ not_if "gitlab-runner list | grep '#{runner_name}'"
11
+ end
12
+ end
@@ -2,7 +2,7 @@ module Itamae
2
2
  module Plugin
3
3
  module Recipe
4
4
  module GitlabRunner
5
- VERSION = "0.1.0"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-recipe-gitlab_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-06 00:00:00.000000000 Z
11
+ date: 2018-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: itamae
@@ -101,6 +101,7 @@ files:
101
101
  - lib/itamae/plugin/recipe/gitlab_runner.rb
102
102
  - lib/itamae/plugin/recipe/gitlab_runner/default.rb
103
103
  - lib/itamae/plugin/recipe/gitlab_runner/install.rb
104
+ - lib/itamae/plugin/recipe/gitlab_runner/register_gitlab_runner.rb
104
105
  - lib/itamae/plugin/recipe/gitlab_runner/version.rb
105
106
  homepage: https://github.com/sue445/itamae-plugin-recipe-gitlab_runner
106
107
  licenses: