kdeploy 0.1.0
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 +7 -0
- data/.editorconfig +12 -0
- data/.rspec +3 -0
- data/.rubocop.yml +100 -0
- data/LICENSE +21 -0
- data/README.md +1030 -0
- data/Rakefile +45 -0
- data/bin/kdeploy +7 -0
- data/kdeploy.gemspec +49 -0
- data/lib/kdeploy/banner.rb +28 -0
- data/lib/kdeploy/cli.rb +1452 -0
- data/lib/kdeploy/command.rb +182 -0
- data/lib/kdeploy/configuration.rb +83 -0
- data/lib/kdeploy/dsl.rb +566 -0
- data/lib/kdeploy/host.rb +85 -0
- data/lib/kdeploy/inventory.rb +243 -0
- data/lib/kdeploy/logger.rb +100 -0
- data/lib/kdeploy/pipeline.rb +249 -0
- data/lib/kdeploy/runner.rb +190 -0
- data/lib/kdeploy/ssh_connection.rb +187 -0
- data/lib/kdeploy/statistics.rb +439 -0
- data/lib/kdeploy/task.rb +240 -0
- data/lib/kdeploy/template.rb +173 -0
- data/lib/kdeploy/version.rb +6 -0
- data/lib/kdeploy.rb +106 -0
- data/scripts/common_tasks.rb +218 -0
- data/scripts/deploy.rb +50 -0
- metadata +178 -0
data/Rakefile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'time'
|
6
|
+
|
7
|
+
# Default task runs tests and RuboCop, then pushes code
|
8
|
+
task default: %w[push]
|
9
|
+
|
10
|
+
# Run RSpec tests
|
11
|
+
RSpec::Core::RakeTask.new(:test) do |spec|
|
12
|
+
spec.pattern = 'spec/**{,/*/**}/*_spec.rb'
|
13
|
+
end
|
14
|
+
|
15
|
+
# Run RuboCop
|
16
|
+
task :rubocop do
|
17
|
+
system 'bundle exec rubocop'
|
18
|
+
end
|
19
|
+
|
20
|
+
# Auto-commit and push changes
|
21
|
+
task :push do
|
22
|
+
system 'bundle exec rubocop -A'
|
23
|
+
system 'git add .'
|
24
|
+
system "git commit -m 'Update #{Time.now}'"
|
25
|
+
system 'git pull'
|
26
|
+
system 'git push'
|
27
|
+
end
|
28
|
+
|
29
|
+
# Documentation task
|
30
|
+
task :doc do
|
31
|
+
system 'bundle exec yard doc'
|
32
|
+
end
|
33
|
+
|
34
|
+
# Clean build artifacts
|
35
|
+
task :clean do
|
36
|
+
system 'rm -f *.gem'
|
37
|
+
system 'rm -rf doc/'
|
38
|
+
system 'rm -rf coverage/'
|
39
|
+
end
|
40
|
+
|
41
|
+
# Install gem locally
|
42
|
+
task :install do
|
43
|
+
system 'gem build kdeploy.gemspec'
|
44
|
+
system "gem install kdeploy-#{Kdeploy::VERSION}.gem"
|
45
|
+
end
|
data/bin/kdeploy
ADDED
data/kdeploy.gemspec
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/kdeploy/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'kdeploy'
|
7
|
+
spec.version = Kdeploy::VERSION
|
8
|
+
spec.authors = ['Kdeploy Team']
|
9
|
+
spec.email = ['team@kdeploy.dev']
|
10
|
+
|
11
|
+
spec.summary = 'Lightweight agentless deployment tool with DSL, heredoc, and ERB template support'
|
12
|
+
spec.description = <<~DESC
|
13
|
+
Kdeploy is a lightweight, agentless deployment tool similar to Chef, Puppet, and Ansible.
|
14
|
+
It uses Ruby DSL for defining deployment pipelines with support for inventory management,
|
15
|
+
parallel execution, SSH-based remote operations, heredoc syntax for multi-line scripts,
|
16
|
+
and ERB templates for dynamic configuration generation.
|
17
|
+
DESC
|
18
|
+
spec.homepage = 'https://github.com/kevin197011/kdeploy'
|
19
|
+
spec.license = 'MIT'
|
20
|
+
spec.required_ruby_version = '>= 3.0.0'
|
21
|
+
|
22
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
23
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
24
|
+
spec.metadata['source_code_uri'] = 'https://github.com/kevin197011/kdeploy'
|
25
|
+
spec.metadata['changelog_uri'] = 'https://github.com/kevin197011/kdeploy/blob/main/CHANGELOG.md'
|
26
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
27
|
+
|
28
|
+
# Specify which files should be added to the gem when it is released.
|
29
|
+
spec.files = Dir.chdir(__dir__) do
|
30
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
31
|
+
(File.expand_path(f) == __FILE__) ||
|
32
|
+
f.start_with?(*%w[exe/ test/ spec/ features/ .git .circleci appveyor Gemfile])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
spec.bindir = 'bin'
|
36
|
+
spec.executables = spec.files.grep(%r{\Abin/}) { |f| File.basename(f) }
|
37
|
+
spec.require_paths = ['lib']
|
38
|
+
|
39
|
+
# Dependencies
|
40
|
+
spec.add_dependency 'colorize', '~> 0.8'
|
41
|
+
spec.add_dependency 'concurrent-ruby', '~> 1.2'
|
42
|
+
spec.add_dependency 'net-scp', '~> 4.0'
|
43
|
+
spec.add_dependency 'net-ssh', '~> 7.0'
|
44
|
+
spec.add_dependency 'thor', '~> 1.3'
|
45
|
+
spec.add_dependency 'tty-prompt', '~> 0.23'
|
46
|
+
spec.add_dependency 'yaml', '~> 0.2'
|
47
|
+
|
48
|
+
# NOTE: Development dependencies are managed in Gemfile
|
49
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Kdeploy
|
4
|
+
# Banner module for displaying ASCII art banner
|
5
|
+
module Banner
|
6
|
+
class << self
|
7
|
+
def show
|
8
|
+
puts banner.colorize(:light_blue)
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def banner
|
14
|
+
<<~BANNER
|
15
|
+
_ _
|
16
|
+
/\\ /\\__| | ___ _ __ | | ___ _ _
|
17
|
+
/ //_/ _` |/ _ \\ '_ \\| |/ _ \\| | | |
|
18
|
+
/ __ \\ (_| | __/ |_) | | (_) | |_| |
|
19
|
+
\\/ \\/\\__,_|\\___| .__/|_|\\___/ \\__, |
|
20
|
+
|_| |___/
|
21
|
+
|
22
|
+
⚡ Lightweight Agentless Deployment Tool
|
23
|
+
🚀 Deploy with confidence, scale with ease
|
24
|
+
BANNER
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|