pipedawg 0.1.0 → 0.1.1
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 +97 -10
- data/lib/pipedawg/pipeline.rb +1 -1
- data/lib/pipedawg/version.rb +1 -1
- metadata +2 -11
- data/.bundle/config +0 -4
- data/.gitignore +0 -15
- data/.gitlab-ci.yml +0 -14
- data/.rspec +0 -3
- data/.rubocop.yml +0 -14
- data/.travis.yml +0 -6
- data/Gemfile +0 -14
- data/Rakefile +0 -8
- data/pipedawg.gemspec +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9167728fbd620f0098099ff53a90fb1d85336a8a771b24cc3059b8dc03144285
|
4
|
+
data.tar.gz: 6f1d59f9fb1ca2de1a49d04520f6a9cd7f171f569c72a372899f9f28749ead34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f53e89a60305aaa04c14443c404e3bcfa0fa24274503751c927ff6ace5f9cabbeb87f3bc2e87ca81d04a9c14aa280ca2942b381eeecbbae23db4bfd4c4c2165e
|
7
|
+
data.tar.gz: a3f7acd6b467e21fee88fa2e2b22ef55e60030311355fb3074ae0f4eac0a52674c0027c0b4ebb0b21dfb1317ee5d1e3a753ece8f96c098183699c53d04a703ae
|
data/README.md
CHANGED
@@ -1,10 +1,18 @@
|
|
1
|
-
#
|
1
|
+
# pipedawg
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/pipedawg)
|
2
4
|
|
3
5
|
Generate GitLab CI pipelines.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
7
|
-
|
9
|
+
Install `pipedawg` with:
|
10
|
+
|
11
|
+
```
|
12
|
+
gem install pipedawg
|
13
|
+
```
|
14
|
+
|
15
|
+
Or add this line to your application's Gemfile:
|
8
16
|
|
9
17
|
```ruby
|
10
18
|
gem 'pipedawg'
|
@@ -12,25 +20,104 @@ gem 'pipedawg'
|
|
12
20
|
|
13
21
|
And then execute:
|
14
22
|
|
15
|
-
|
23
|
+
```sh
|
24
|
+
bundle install
|
25
|
+
```
|
16
26
|
|
17
|
-
|
27
|
+
## Ruby library
|
18
28
|
|
19
|
-
|
29
|
+
Example:
|
20
30
|
|
21
|
-
|
31
|
+
```ruby
|
32
|
+
#!/usr/bin/env ruby
|
33
|
+
# frozen_string_literal: true
|
34
|
+
|
35
|
+
# print_pipeline.rb
|
36
|
+
require 'pipedawg'
|
37
|
+
|
38
|
+
gem_job = Pipedawg::Job.new(
|
39
|
+
'build:gem',
|
40
|
+
artifacts: ['*.gem'],
|
41
|
+
image: 'ruby',
|
42
|
+
script: ['bundle install', 'gem build *.gemspec']
|
43
|
+
)
|
44
|
+
|
45
|
+
docker_job = Pipedawg::Job.new(
|
46
|
+
'build:docker',
|
47
|
+
image: 'docker',
|
48
|
+
needs: ['build:gem'],
|
49
|
+
retry: 2,
|
50
|
+
script: [
|
51
|
+
'docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY',
|
52
|
+
'docker pull $CI_REGISTRY_IMAGE || true',
|
53
|
+
'docker build --pull --cache-from $CI_REGISTRY_IMAGE -t $CI_REGISTRY_IMAGE .',
|
54
|
+
'docker push $CI_REGISTRY_IMAGE'
|
55
|
+
],
|
56
|
+
services: ['docker:dind']
|
57
|
+
)
|
58
|
+
|
59
|
+
pipeline = Pipedawg::Pipeline.new 'build:image', jobs: [gem_job, docker_job]
|
60
|
+
|
61
|
+
# Automatically calculates stages of jobs based on 'needs'
|
62
|
+
pipeline.update_stages
|
63
|
+
|
64
|
+
puts pipeline.to_yaml
|
65
|
+
```
|
22
66
|
|
67
|
+
```console
|
68
|
+
$ chmod +x print_pipeline.rb
|
69
|
+
$ ./print_pipeline.rb
|
70
|
+
---
|
71
|
+
stages:
|
72
|
+
- '1'
|
73
|
+
- '2'
|
74
|
+
workflow: {}
|
75
|
+
build:gem:
|
76
|
+
artifacts:
|
77
|
+
- "*.gem"
|
78
|
+
cache: {}
|
79
|
+
image: ruby
|
80
|
+
needs: []
|
81
|
+
rules: []
|
82
|
+
script:
|
83
|
+
- bundle install
|
84
|
+
- gem build *.gemspec
|
85
|
+
stage: '1'
|
86
|
+
tags: []
|
87
|
+
build:docker:
|
88
|
+
artifacts: {}
|
89
|
+
cache: {}
|
90
|
+
image: docker
|
91
|
+
needs:
|
92
|
+
- build:gem
|
93
|
+
retry: 2
|
94
|
+
rules: []
|
95
|
+
script:
|
96
|
+
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
97
|
+
- docker pull $CI_REGISTRY_IMAGE || true
|
98
|
+
- docker build --pull --cache-from $CI_REGISTRY_IMAGE -t $CI_REGISTRY_IMAGE .
|
99
|
+
- docker push $CI_REGISTRY_IMAGE
|
100
|
+
stage: '2'
|
101
|
+
tags: []
|
102
|
+
services:
|
103
|
+
- docker:dind
|
104
|
+
```
|
23
105
|
|
24
106
|
## Development
|
25
107
|
|
26
|
-
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.
|
108
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. Run `bundle exec rubocop` to run the linter. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
109
|
+
|
110
|
+
Note that by default, Bundler will attempt to install gems to the system, e.g. `/usr/bin`, `/usr/share`, which requires elevated access and can interfere with files that are managed by the system's package manager. This behaviour can be overridden by creating the file `.bundle/config` and adding the following line:
|
111
|
+
```
|
112
|
+
BUNDLE_PATH: "./.bundle"
|
113
|
+
```
|
114
|
+
When you run `bin/setup` or `bundle install`, all gems will be installed inside the .bundle directory of this project.
|
27
115
|
|
28
|
-
To
|
116
|
+
To make this behaviour a default for all gem projects, the above line can be added to the user's bundle config file in their home directory (`~/.bundle/config`)
|
29
117
|
|
30
118
|
## Contributing
|
31
119
|
|
32
|
-
Bug reports and pull requests are welcome on GitHub
|
33
|
-
|
120
|
+
Bug reports and pull requests are welcome on [GitHub](https://github.com/liger1978/pipedawg).
|
34
121
|
|
35
122
|
## License
|
36
123
|
|
data/lib/pipedawg/pipeline.rb
CHANGED
data/lib/pipedawg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pipedawg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- harbottle
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Generate GitLab CI pipelines.
|
14
14
|
email:
|
@@ -17,21 +17,12 @@ executables: []
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
-
- ".bundle/config"
|
21
|
-
- ".gitignore"
|
22
|
-
- ".gitlab-ci.yml"
|
23
|
-
- ".rspec"
|
24
|
-
- ".rubocop.yml"
|
25
|
-
- ".travis.yml"
|
26
|
-
- Gemfile
|
27
20
|
- LICENSE.txt
|
28
21
|
- README.md
|
29
|
-
- Rakefile
|
30
22
|
- lib/pipedawg.rb
|
31
23
|
- lib/pipedawg/job.rb
|
32
24
|
- lib/pipedawg/pipeline.rb
|
33
25
|
- lib/pipedawg/version.rb
|
34
|
-
- pipedawg.gemspec
|
35
26
|
homepage: https://github.com/liger1978/pipedawg
|
36
27
|
licenses:
|
37
28
|
- MIT
|
data/.bundle/config
DELETED
data/.gitignore
DELETED
data/.gitlab-ci.yml
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in pipedawg.gemspec
|
6
|
-
gemspec
|
7
|
-
|
8
|
-
gem 'irb', '~> 1.4'
|
9
|
-
gem 'rake', '~> 12.0'
|
10
|
-
gem 'rdoc', '~> 6.4'
|
11
|
-
gem 'rspec', '~> 3.0'
|
12
|
-
gem 'rubocop', '~> 1.24', require: false
|
13
|
-
gem 'rubocop-rake', '~> 0.6', require: false
|
14
|
-
gem 'rubocop-rspec', '~> 2.7', require: false
|
data/Rakefile
DELETED
data/pipedawg.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'lib/pipedawg/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'pipedawg'
|
7
|
-
spec.version = Pipedawg::VERSION
|
8
|
-
spec.authors = ['harbottle']
|
9
|
-
spec.email = ['harbottle@room3d3.com']
|
10
|
-
|
11
|
-
spec.summary = 'Generate GitLab CI pipelines.'
|
12
|
-
spec.description = 'Generate GitLab CI pipelines.'
|
13
|
-
spec.homepage = 'https://github.com/liger1978/pipedawg'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
17
|
-
spec.metadata['source_code_uri'] = 'https://github.com/liger1978/pipedawg'
|
18
|
-
spec.metadata['changelog_uri'] = 'https://github.com/liger1978/pipedawg'
|
19
|
-
|
20
|
-
# Specify which files should be added to the gem when it is released.
|
21
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
-
end
|
25
|
-
spec.bindir = 'exe'
|
26
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
-
spec.require_paths = ['lib']
|
28
|
-
|
29
|
-
end
|