gitlab-cng 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4d91a5d381f5a9d9ed9f3aff120c7d8069c18009d854d50f2e13929ed5556b5f
4
+ data.tar.gz: 1caee82986fdbd56fbc162f16d856c509fd3b1bb3bd31fb96346236a34518e30
5
+ SHA512:
6
+ metadata.gz: 6edc7148b817452121c5580837d698c3ec0f8b4da57af0318d98f91bf2c0b50f50ab69ce04d5b769f7ce510ceb323530177df7dc0088823c376c429f6fead0d4
7
+ data.tar.gz: a507aff8b0e71c7c5f1a264ede3db9e9f4bec80a69f543bf9db3414845f81cd108661fb9b389dab738cacb877cbbe02310ee8cae664313ce8ef183756c9ed74a
data/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Cng
2
+
3
+ CLI tool to support setup and deployments of [Cloud Native GitLab](https://gitlab.com/gitlab-org/build/CNG) builds.
data/exe/cng ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
6
+
7
+ require 'cng/cli'
8
+
9
+ Signal.trap('INT') do
10
+ warn("\n#{caller.join("\n")}: interrupted")
11
+ exit(1)
12
+ end
13
+
14
+ module Cng
15
+ def self.run
16
+ CLI.start
17
+ rescue CLI::Error => err
18
+ puts "ERROR: #{err.message}"
19
+ exit 1
20
+ end
21
+ end
22
+
23
+ Cng.run
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+ require "require_all"
5
+
6
+ require_rel "commands/**/*.rb"
7
+
8
+ module Gitlab
9
+ module Cng
10
+ # Main CLI class handling all commands
11
+ #
12
+ class CLI < Thor
13
+ def self.exit_on_failure?
14
+ true
15
+ end
16
+
17
+ check_unknown_options!
18
+
19
+ # Error raised by this runner
20
+ Error = Class.new(StandardError)
21
+
22
+ Commands::Version.register_commands(self)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module Cng
5
+ module Commands
6
+ class Base < Thor
7
+ # Register all public methods as commands in another Thor class
8
+ #
9
+ # @param [Object] base
10
+ # @return [void]
11
+ def self.register_commands(base)
12
+ klass = self
13
+
14
+ commands.each do |name, command|
15
+ next if base.commands[name]
16
+
17
+ # check if the method takes arguments
18
+ pass_args = klass.new.method(name).arity != 0
19
+
20
+ base.commands[name] = command
21
+ base.define_method(name) do |*args|
22
+ pass_args ? invoke(klass, name, *args) : invoke(klass, name)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module Cng
5
+ module Commands
6
+ class Version < Base
7
+ desc 'version', 'Prints cng orchestrator version'
8
+ def version
9
+ puts Cng::VERSION
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module Cng
5
+ VERSION = "0.0.1"
6
+ end
7
+ end
data/lib/gitlab/cng.rb ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module Cng
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gitlab-cng
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - GitLab Quality
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-04-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: require_all
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ description: CLI tool to setup environment and deploy CNG builds
42
+ email:
43
+ - quality@gitlab.com
44
+ executables:
45
+ - cng
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - README.md
50
+ - exe/cng
51
+ - lib/gitlab/cng.rb
52
+ - lib/gitlab/cng/cli.rb
53
+ - lib/gitlab/cng/commands/base.rb
54
+ - lib/gitlab/cng/commands/version.rb
55
+ - lib/gitlab/cng/version.rb
56
+ homepage:
57
+ licenses:
58
+ - MIT
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubygems_version: 3.5.9
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: CNG deployment orchestrator
79
+ test_files: []