itamae-plugin-recipe-gitlab_runner 0.1.0 → 0.2.3
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/.github/workflows/test.yml +98 -0
- data/CHANGELOG.md +25 -1
- data/README.md +31 -5
- data/itamae-plugin-recipe-gitlab_runner.gemspec +8 -3
- data/lib/itamae/plugin/recipe/gitlab_runner/default.rb +1 -0
- data/lib/itamae/plugin/recipe/gitlab_runner/register_gitlab_runner.rb +13 -0
- data/lib/itamae/plugin/recipe/gitlab_runner/version.rb +1 -1
- metadata +16 -15
- data/.travis.yml +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faf92d3247902a7e7d789b4a18f0aef12a4580faab2f897e5199d2b5a32e027a
|
4
|
+
data.tar.gz: 3fbb10b765e9642c67f0c867414ee1a5164afa0380cac0b490f20bf7288fdd89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab5594c2cae7b28ac23983fcd1c7a989f913bd1a8194d23eb5594bdfdbe524c2a1785ac5866f9e38e707663b8358a95e4ebe1f4f189da66a278731f858179865
|
7
|
+
data.tar.gz: dc34a44e94e5edb96af40a4527192ca5a896388b9222a197fb7cef8ca994ab64fc142a0b6c9a0bf96e86511075b3bbf221100236272f637eacb5a3de02deb64c
|
@@ -0,0 +1,98 @@
|
|
1
|
+
name: test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
types:
|
9
|
+
- opened
|
10
|
+
- synchronize
|
11
|
+
- reopened
|
12
|
+
schedule:
|
13
|
+
- cron: "0 10 * * 5" # JST 19:00 (Fri)
|
14
|
+
|
15
|
+
env:
|
16
|
+
CI: "true"
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
test:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
|
22
|
+
strategy:
|
23
|
+
fail-fast: false
|
24
|
+
|
25
|
+
matrix:
|
26
|
+
ruby:
|
27
|
+
- 2.3
|
28
|
+
image:
|
29
|
+
- centos:7
|
30
|
+
- debian:jessie
|
31
|
+
- debian:stretch
|
32
|
+
- debian:buster
|
33
|
+
- amazonlinux:2
|
34
|
+
|
35
|
+
steps:
|
36
|
+
- uses: actions/checkout@v2
|
37
|
+
|
38
|
+
- uses: eregon/use-ruby-action@v1
|
39
|
+
with:
|
40
|
+
ruby-version: ${{ matrix.ruby }}
|
41
|
+
|
42
|
+
- name: Cache vendor/bundle
|
43
|
+
uses: actions/cache@v1
|
44
|
+
id: cache_gem
|
45
|
+
with:
|
46
|
+
path: vendor/bundle
|
47
|
+
key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
|
48
|
+
restore-keys: |
|
49
|
+
v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
|
50
|
+
|
51
|
+
- name: bundle update
|
52
|
+
run: |
|
53
|
+
set -xe
|
54
|
+
bundle config path vendor/bundle
|
55
|
+
bundle update --jobs $(nproc) --retry 3
|
56
|
+
|
57
|
+
- name: Run Itamae
|
58
|
+
run: |
|
59
|
+
set -xe
|
60
|
+
bundle exec itamae docker --node-yaml=spec/recipes/node.yml spec/recipes/install.rb --image=$IMAGE --tag itamae-plugin:latest
|
61
|
+
env:
|
62
|
+
IMAGE: ${{ matrix.image }}
|
63
|
+
|
64
|
+
- name: Run Serverspec
|
65
|
+
run: |
|
66
|
+
set -xe
|
67
|
+
bundle exec rspec
|
68
|
+
env:
|
69
|
+
DOCKER_IMAGE: itamae-plugin:latest
|
70
|
+
|
71
|
+
- name: Slack Notification (not success)
|
72
|
+
uses: lazy-actions/slatify@master
|
73
|
+
if: "! success()"
|
74
|
+
continue-on-error: true
|
75
|
+
with:
|
76
|
+
job_name: ${{ format('*build* ({0}, {1})', matrix.ruby, matrix.image) }}
|
77
|
+
type: ${{ job.status }}
|
78
|
+
icon_emoji: ":octocat:"
|
79
|
+
url: ${{ secrets.SLACK_WEBHOOK }}
|
80
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
81
|
+
|
82
|
+
notify:
|
83
|
+
needs:
|
84
|
+
- test
|
85
|
+
|
86
|
+
runs-on: ubuntu-latest
|
87
|
+
|
88
|
+
steps:
|
89
|
+
- name: Slack Notification (success)
|
90
|
+
uses: lazy-actions/slatify@master
|
91
|
+
if: always()
|
92
|
+
continue-on-error: true
|
93
|
+
with:
|
94
|
+
job_name: '*build*'
|
95
|
+
type: ${{ job.status }}
|
96
|
+
icon_emoji: ":octocat:"
|
97
|
+
url: ${{ secrets.SLACK_WEBHOOK }}
|
98
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1
1
|
## master
|
2
|
-
[full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.
|
2
|
+
[full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.2.3...master)
|
3
|
+
|
4
|
+
## 0.2.3
|
5
|
+
[full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.2.2...v0.2.3)
|
6
|
+
|
7
|
+
* Enable MFA requirement for gem releasing
|
8
|
+
* https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/pull/23
|
9
|
+
|
10
|
+
## 0.2.2
|
11
|
+
[full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.2.1...v0.2.2)
|
12
|
+
|
13
|
+
* Add `config` to `register_gitlab_runner`
|
14
|
+
* https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/pull/7
|
15
|
+
|
16
|
+
## 0.2.1
|
17
|
+
[full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.2.0...v0.2.1)
|
18
|
+
|
19
|
+
* Fix changelog link
|
20
|
+
* https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/pull/6
|
21
|
+
|
22
|
+
## 0.2.0
|
23
|
+
[full changelog](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/compare/v0.1.0...v0.2.0)
|
24
|
+
|
25
|
+
* Impl `register_gitlab_runner`
|
26
|
+
* https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/pull/5
|
3
27
|
|
4
28
|
## 0.1.0
|
5
29
|
* first release
|
data/README.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
Itamae plugin to install [GitLab Runner](https://docs.gitlab.com/runner/)
|
4
4
|
|
5
|
-
[](https://badge.fury.io/rb/itamae-plugin-recipe-gitlab_runner)
|
6
|
+
[](https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/actions?query=workflow%3Atest)
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
@@ -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,34 @@ 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
|
+
* `config` (`String`)
|
56
|
+
* config file (default: `/etc/gitlab-runner/config.toml`)
|
57
|
+
|
58
|
+
e.g)
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
register_gitlab_runner "docker-runner" do
|
62
|
+
options [
|
63
|
+
"--url", "https://gitlab.com/",
|
64
|
+
"--registration-token", "PROJECT_REGISTRATION_TOKEN",
|
65
|
+
"--executor", "docker",
|
66
|
+
"--docker-image", "alpine:3",
|
67
|
+
"--tag-list", "docker,aws",
|
68
|
+
"--run-untagged",
|
69
|
+
"--locked=false",
|
70
|
+
]
|
71
|
+
end
|
72
|
+
```
|
73
|
+
|
48
74
|
## Development
|
49
75
|
|
50
76
|
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.
|
@@ -14,12 +14,17 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "https://github.com/sue445/itamae-plugin-recipe-gitlab_runner"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
+
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
|
20
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
21
|
+
|
17
22
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
23
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
24
|
if spec.respond_to?(:metadata)
|
20
25
|
spec.metadata["homepage_uri"] = spec.homepage
|
21
26
|
spec.metadata["source_code_uri"] = spec.homepage
|
22
|
-
spec.metadata["changelog_uri"] = "https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/CHANGELOG.md"
|
27
|
+
spec.metadata["changelog_uri"] = "https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/blob/master/CHANGELOG.md"
|
23
28
|
else
|
24
29
|
raise "RubyGems 2.0 or newer is required to protect against " \
|
25
30
|
"public gem pushes."
|
@@ -36,8 +41,8 @@ Gem::Specification.new do |spec|
|
|
36
41
|
|
37
42
|
spec.add_dependency "itamae"
|
38
43
|
|
39
|
-
spec.add_development_dependency "bundler", "
|
44
|
+
spec.add_development_dependency "bundler", ">= 1.16"
|
40
45
|
spec.add_development_dependency "docker-api"
|
41
|
-
spec.add_development_dependency "rake"
|
46
|
+
spec.add_development_dependency "rake"
|
42
47
|
spec.add_development_dependency "serverspec"
|
43
48
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
define :register_gitlab_runner, options: [], config: "/etc/gitlab-runner/config.toml" do
|
2
|
+
runner_name = params[:name]
|
3
|
+
config_file = params[:config]
|
4
|
+
|
5
|
+
raise "name is required. (e.g. register_gitlab_runner 'your_runner_name')" unless runner_name
|
6
|
+
|
7
|
+
register_args = ["--non-interactive", "--name", runner_name, "--config", config_file] + Array(params[:options])
|
8
|
+
register_args.compact!
|
9
|
+
|
10
|
+
execute "gitlab-runner register #{register_args.join(" ")}" do
|
11
|
+
not_if "gitlab-runner list --config #{config_file} 2>&1 1>/dev/null | grep '#{runner_name}'"
|
12
|
+
end
|
13
|
+
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.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: itamae
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.16'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.16'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: serverspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,9 +87,9 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".github/workflows/test.yml"
|
90
91
|
- ".gitignore"
|
91
92
|
- ".rspec"
|
92
|
-
- ".travis.yml"
|
93
93
|
- CHANGELOG.md
|
94
94
|
- Gemfile
|
95
95
|
- LICENSE.txt
|
@@ -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:
|
@@ -108,8 +109,9 @@ licenses:
|
|
108
109
|
metadata:
|
109
110
|
homepage_uri: https://github.com/sue445/itamae-plugin-recipe-gitlab_runner
|
110
111
|
source_code_uri: https://github.com/sue445/itamae-plugin-recipe-gitlab_runner
|
111
|
-
changelog_uri: https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/CHANGELOG.md
|
112
|
-
|
112
|
+
changelog_uri: https://github.com/sue445/itamae-plugin-recipe-gitlab_runner/blob/master/CHANGELOG.md
|
113
|
+
rubygems_mfa_required: 'true'
|
114
|
+
post_install_message:
|
113
115
|
rdoc_options: []
|
114
116
|
require_paths:
|
115
117
|
- lib
|
@@ -124,9 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
126
|
- !ruby/object:Gem::Version
|
125
127
|
version: '0'
|
126
128
|
requirements: []
|
127
|
-
|
128
|
-
|
129
|
-
signing_key:
|
129
|
+
rubygems_version: 3.2.22
|
130
|
+
signing_key:
|
130
131
|
specification_version: 4
|
131
132
|
summary: Itamae plugin to install GitLab Runner
|
132
133
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: required
|
3
|
-
services:
|
4
|
-
- docker
|
5
|
-
rvm:
|
6
|
-
- 2.5
|
7
|
-
env:
|
8
|
-
- IMAGE=centos:7
|
9
|
-
- IMAGE=debian:jessie
|
10
|
-
- IMAGE=amazonlinux:2
|
11
|
-
bundler_args: "--jobs=4"
|
12
|
-
cache: bundler
|
13
|
-
before_install:
|
14
|
-
- gem update --system --no-document
|
15
|
-
- gem install bundler --no-document
|
16
|
-
script:
|
17
|
-
- bundle exec itamae docker --node-yaml=spec/recipes/node.yml spec/recipes/install.rb --image=$IMAGE --tag itamae-plugin:latest
|
18
|
-
- DOCKER_IMAGE=itamae-plugin:latest bundle exec rspec
|
19
|
-
branches:
|
20
|
-
only:
|
21
|
-
- master
|
22
|
-
notifications:
|
23
|
-
email: false
|
24
|
-
slack:
|
25
|
-
secure: Wd60nazhMcyK7w+j4owi7ZWBCbEl0ZdPkp+Ir+c1jYwXNC4kDF5bSU0YfBtApiDBozI7OGe8U66Z6CTGyvbSt0+pM17xGW9COz/sDDwUkxawr/X+ZVYzLx0QwIYhnwqv3A0Yy8lAAAeB/GNaVzvVajflJrLY4O4qin7vpoVOexrLFY08brFBr67BxgZJBprtgjgKxyIFRYBln/1pSfDG/rtTxlpqDnh7tPk0lysNznd350Sj6Lh02ZYblBwyypo/BTF7nflgi7cxFLaXTNVJ4d5xrrq2QkoTcuqm3fw897hp0lCHitu3EnPur7Aro7C+nzejIK2mJBgRI7gBsmOj+cQBWDfRh/CIsGIZ3+lkOC+mfI0GH18kvnaSpc9WzvjoIDHiJZxtuVrqHdUiYaf+ewRkHi5IaOO3hlWr1KrIj+2A83KrbOjsGY9sE9jN8eD0jkfG7bsqLhpNv7CX+GVZSsAaapYl2WHprN0eVnvfCKbGB/GJUGq5BJxdxrSlioKuNeCNlUavfSnjUAknf3g+zDh+3RDlPCnnFNtp4i45tBmAUwf66JMmN+8UdDCLL+9teQjsVmrQh/JW/ExM/OYZF5ceW8yXNams+GjzKrayzoSHGJIRhWHzsaG1unmkvbIM7OcRdrNmudHBUP46W25TwXq4JXufmbojtShuNTyzTSA=
|