deploy-context 0.1.0 → 0.1.0.6.g43abfe4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.gitignore +57 -0
- data/Gemfile +3 -0
- data/Rakefile +22 -0
- data/bin/deploy-context +7 -0
- data/deploy-context.gemspec +69 -0
- data/lib/deploy-context/context/deploy.rb +31 -0
- data/lib/deploy-context/deploy/git.rb +20 -0
- data/lib/deploy-context/deploy/ruby.rb +38 -0
- data/lib/deploy-context/deploy.rb +21 -0
- data/lib/deploy-context.rb +61 -0
- data.tar.gz.sig +0 -0
- metadata +15 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d1a17a0c8ab0b6d44b80eaedc9e458b9e7fdb1c5c4adaf7e6bea31ee8c25288
|
4
|
+
data.tar.gz: e8e326bfb4e5ad1da4b1d6487350db423b3f820ed71e5f06c1a5be6b83335850
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79924e9ec24149860976348a28dfc92fae7bbfa0fdf64f7d6cff6e6dec64b0f51c329a766ae6b54e178fc29aa12fadc0bc6d514dc16416b360d4414f4ff504a0
|
7
|
+
data.tar.gz: 20094fd56241a55960cb28a608952a83f5dc24dfcf81300d80e12bfed261075114b47891350ae22a7948976d02de531ee021e948903336dd419afc3ee2af6182
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.gitignore
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/spec/examples.txt
|
9
|
+
/test/tmp/
|
10
|
+
/test/version_tmp/
|
11
|
+
/tmp/
|
12
|
+
contexts/
|
13
|
+
|
14
|
+
# Used by dotenv library to load environment variables.
|
15
|
+
# .env
|
16
|
+
|
17
|
+
# Ignore Byebug command history file.
|
18
|
+
.byebug_history
|
19
|
+
|
20
|
+
## Specific to RubyMotion:
|
21
|
+
.dat*
|
22
|
+
.repl_history
|
23
|
+
build/
|
24
|
+
*.bridgesupport
|
25
|
+
build-iPhoneOS/
|
26
|
+
build-iPhoneSimulator/
|
27
|
+
|
28
|
+
## Specific to RubyMotion (use of CocoaPods):
|
29
|
+
#
|
30
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
31
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
32
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
33
|
+
#
|
34
|
+
# vendor/Pods/
|
35
|
+
|
36
|
+
## Documentation cache and generated files:
|
37
|
+
/.yardoc/
|
38
|
+
/_yardoc/
|
39
|
+
/doc/
|
40
|
+
/rdoc/
|
41
|
+
|
42
|
+
## Environment normalization:
|
43
|
+
/.bundle/
|
44
|
+
/vendor/bundle
|
45
|
+
/lib/bundler/man/
|
46
|
+
|
47
|
+
# for a library or gem, you might want to ignore these files since the code is
|
48
|
+
# intended to run in multiple environments; otherwise, check them in:
|
49
|
+
# Gemfile.lock
|
50
|
+
# .ruby-version
|
51
|
+
# .ruby-gemset
|
52
|
+
|
53
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
54
|
+
.rvmrc
|
55
|
+
|
56
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
57
|
+
# .rubocop-https?--*
|
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
|
4
|
+
Bundler::GemHelper.install_tasks
|
5
|
+
|
6
|
+
require 'rdoc/task'
|
7
|
+
|
8
|
+
Rake::RDocTask.new do |rd|
|
9
|
+
rd.main = "README.md"
|
10
|
+
rd.title = 'deploy-context'
|
11
|
+
rd.rdoc_files.include("README.md", "lib/**/*.rb")
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'git-version-bump/rake-tasks'
|
15
|
+
|
16
|
+
task :default do
|
17
|
+
require_relative 'lib/deploy-context'
|
18
|
+
require_relative 'lib/deploy-context/deploy'
|
19
|
+
|
20
|
+
deployer = Context::DeployContext.new(__dir__)
|
21
|
+
deployer.cycle
|
22
|
+
end
|
data/bin/deploy-context
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
|
2
|
+
require 'git-version-bump'
|
3
|
+
|
4
|
+
::Gem::Specification.new do |s|
|
5
|
+
s.name = 'deploy-context'
|
6
|
+
s.license = 'MIT'
|
7
|
+
s.authors = ['Jimmy Provencher']
|
8
|
+
s.email = ['jimbo_dragon@hotmail.com']
|
9
|
+
s.homepage = 'https://github.com/JimboDragonGit/deploy-context'
|
10
|
+
s.summary = 'A auto chef bootstrapper and wrapper cookbook to deploy code and context'
|
11
|
+
s.description = 'Using Chef cookbook style and force any script using it to switch to chef even if it is not install. It will install it tho ;)'
|
12
|
+
|
13
|
+
|
14
|
+
s.version = GVB.version
|
15
|
+
s.date = GVB.date
|
16
|
+
|
17
|
+
# all_files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
18
|
+
# s.files = all_files.grep(%r!^(exe|libraries|rubocop)/|^.rubocop.yml$!)
|
19
|
+
# code_folder = 'libraries/'
|
20
|
+
# s.files = %w(README.md LICENSE bin/selfbootstrap libraries/selfbootstrap.rb ) + Dir.glob('libraries/**/*') # + Dir.glob('{bin,lib,certs,test}/**/*')
|
21
|
+
# s.require_paths = [code_folder]
|
22
|
+
# s.executables = %w(selfbootstrap)
|
23
|
+
# s.bindir = 'exe'
|
24
|
+
|
25
|
+
|
26
|
+
s.extra_rdoc_files = ["README.md"]
|
27
|
+
s.files = `git ls-files`.split("\n")
|
28
|
+
s.executables = [
|
29
|
+
'deploy-context'
|
30
|
+
]
|
31
|
+
|
32
|
+
# s.cert_chain = [File.expand_path('../jimbodragon/certs/public/jimbodragon.pem')]
|
33
|
+
# s.signing_key = File.expand_path('../jimbodragon/certs/private/jimbodragon-gem-private_key.pem') if $PROGRAM_NAME =~ /gem\z/
|
34
|
+
|
35
|
+
s.metadata = {
|
36
|
+
# 'source_code_uri' => '/home/git/selfbootstrap.git/',
|
37
|
+
'bug_tracker_uri' => 'https://github.com/JimboDragonGit/deploy-context/issues',
|
38
|
+
'changelog_uri' => 'https://github.com/JimboDragonGit/deploy-context/releases',
|
39
|
+
'homepage_uri' => s.homepage,
|
40
|
+
}
|
41
|
+
|
42
|
+
s.rdoc_options = ['--charset=UTF-8']
|
43
|
+
s.extra_rdoc_files = %w(README.md LICENSE)
|
44
|
+
|
45
|
+
# s.required_ruby_version = '>= 2.5.0'
|
46
|
+
# s.required_rubygems_version = '>= 2.7.0'
|
47
|
+
|
48
|
+
s.add_development_dependency('chef')
|
49
|
+
s.add_development_dependency('test-kitchen')
|
50
|
+
|
51
|
+
s.add_runtime_dependency('git-version-bump')
|
52
|
+
|
53
|
+
# s.add_runtime_dependency('colorator', '~> 1.0')
|
54
|
+
# s.add_runtime_dependency('em-websocket', '~> 0.5')
|
55
|
+
# s.add_runtime_dependency('i18n', '~> 1.0')
|
56
|
+
# s.add_runtime_dependency('jekyll-sass-converter', '>= 2.0', '< 4.0')
|
57
|
+
# s.add_runtime_dependency('jekyll-watch', '~> 2.0')
|
58
|
+
# s.add_runtime_dependency('kramdown', '~> 2.3', '>= 2.3.1')
|
59
|
+
# s.add_runtime_dependency('kramdown-parser-gfm', '~> 1.0')
|
60
|
+
# s.add_runtime_dependency('liquid', '~> 4.0')
|
61
|
+
# s.add_runtime_dependency('mercenary', '>= 0.3.6', '< 0.5')
|
62
|
+
# s.add_runtime_dependency('pathutil', '~> 0.9')
|
63
|
+
# s.add_runtime_dependency('rouge', '>= 3.0', '< 5.0')
|
64
|
+
# s.add_runtime_dependency('safe_yaml', '~> 1.0')
|
65
|
+
# s.add_runtime_dependency('terminal-table', '>= 1.8', '< 4.0')
|
66
|
+
# s.add_runtime_dependency('webrick', '~> 1.7')
|
67
|
+
end
|
68
|
+
|
69
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Context
|
2
|
+
module DeployHelper
|
3
|
+
def get_context_folder(context, folder)
|
4
|
+
File.join(context.context_folder, folder)
|
5
|
+
end
|
6
|
+
|
7
|
+
def build_folder(context)
|
8
|
+
get_context_folder(context, 'build')
|
9
|
+
end
|
10
|
+
|
11
|
+
def contexts_container(context)
|
12
|
+
get_context_folder(context, 'contexts')
|
13
|
+
end
|
14
|
+
|
15
|
+
def chef_exec(commands)
|
16
|
+
system("chef exec #{commands.join(' ')}")
|
17
|
+
end
|
18
|
+
|
19
|
+
def git(commands)
|
20
|
+
chef_exec(['git'] + commands)
|
21
|
+
end
|
22
|
+
|
23
|
+
def gem(commands)
|
24
|
+
chef_exec(['gem'] + commands)
|
25
|
+
end
|
26
|
+
|
27
|
+
def rake(commands)
|
28
|
+
chef_exec(['rake'] + commands)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Context
|
2
|
+
module GitDeployerHelper
|
3
|
+
def git_build(context)
|
4
|
+
Dir.chdir File.dirname(context.context_folder)
|
5
|
+
puts "Building ruby from folder #{context.context_folder}"
|
6
|
+
git ["clone git@github.com:JimboDragonGit/#{context.context_name}.git"] unless ::Dir.exist?(context.context_folder)
|
7
|
+
end
|
8
|
+
|
9
|
+
def git_commit(context)
|
10
|
+
Dir.chdir context.context_folder
|
11
|
+
git ['add .']
|
12
|
+
git ["commit -m 'Create #{context.context_name} automatic commit'"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def git_release(context)
|
16
|
+
Dir.chdir context.context_folder
|
17
|
+
git ['push', '--follow-tags']
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Context
|
2
|
+
module RubyDeployerHelper
|
3
|
+
def ruby_build(context)
|
4
|
+
git_build(context)
|
5
|
+
Dir.chdir context.context_folder
|
6
|
+
puts "Working in folder #{Dir.pwd}\nAnd context #{context.context_name} is created"
|
7
|
+
gem ["build #{context.context_name}.gemspec"]
|
8
|
+
end
|
9
|
+
|
10
|
+
def ruby_release(context)
|
11
|
+
Dir.chdir context.context_folder
|
12
|
+
gem ["push #{context.context_name}-0.1.0.gem"]
|
13
|
+
end
|
14
|
+
|
15
|
+
def ruby_install(context)
|
16
|
+
rake ['release']
|
17
|
+
# gem ['install', context.context_name]
|
18
|
+
end
|
19
|
+
|
20
|
+
def clean_folder(context, folder)
|
21
|
+
clean_folder = get_context_folder(context, folder)
|
22
|
+
puts "Clean folder #{clean_folder}"
|
23
|
+
FileUtils.remove_dir(clean_folder) if Dir.exist?(clean_folder)
|
24
|
+
end
|
25
|
+
|
26
|
+
def ruby_clean(context)
|
27
|
+
clean_folder(context, 'pkg')
|
28
|
+
end
|
29
|
+
|
30
|
+
def ruby_remove_gem(context)
|
31
|
+
clean_folder(context, 'pkg')
|
32
|
+
end
|
33
|
+
|
34
|
+
def ruby_bump(context, level)
|
35
|
+
git ['version-bump', level]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'context/deploy'
|
2
|
+
|
3
|
+
module Context
|
4
|
+
class Deploy
|
5
|
+
include DeployHelper
|
6
|
+
|
7
|
+
attr_reader :context_name
|
8
|
+
attr_reader :context_folder
|
9
|
+
|
10
|
+
def initialize(context_name, deploycontext_folder)
|
11
|
+
@context_name = context_name
|
12
|
+
@context_folder = deploycontext_folder
|
13
|
+
|
14
|
+
check_folder context_folder
|
15
|
+
end
|
16
|
+
|
17
|
+
def check_folder(folder)
|
18
|
+
FileUtils.mkdir_p(context_folder) unless ::Dir.exist?(context_folder)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
|
2
|
+
require 'fileutils'
|
3
|
+
require 'git-version-bump'
|
4
|
+
|
5
|
+
require_relative 'deploy-context/deploy'
|
6
|
+
require_relative 'deploy-context/deploy/ruby'
|
7
|
+
require_relative 'deploy-context/deploy/git'
|
8
|
+
|
9
|
+
module Context
|
10
|
+
class DeployContext < Deploy
|
11
|
+
include DeployHelper
|
12
|
+
include GitDeployerHelper
|
13
|
+
include RubyDeployerHelper
|
14
|
+
|
15
|
+
def initialize(deploycontext_folder)
|
16
|
+
super('deploy-context', deploycontext_folder)
|
17
|
+
end
|
18
|
+
|
19
|
+
def cycle
|
20
|
+
clean
|
21
|
+
minor_bump
|
22
|
+
build
|
23
|
+
commit
|
24
|
+
release
|
25
|
+
install
|
26
|
+
end
|
27
|
+
|
28
|
+
def build
|
29
|
+
git_build(self)
|
30
|
+
check_folder get_context_folder(self, 'build')
|
31
|
+
check_folder get_context_folder(self, 'contexts')
|
32
|
+
ruby_build(self)
|
33
|
+
end
|
34
|
+
|
35
|
+
def commit
|
36
|
+
git_commit(self)
|
37
|
+
end
|
38
|
+
|
39
|
+
def release
|
40
|
+
ruby_release(self)
|
41
|
+
git_release(self)
|
42
|
+
end
|
43
|
+
|
44
|
+
def install
|
45
|
+
ruby_install(self)
|
46
|
+
end
|
47
|
+
|
48
|
+
def clean
|
49
|
+
clean_folder(self, 'contexts')
|
50
|
+
ruby_clean(self)
|
51
|
+
end
|
52
|
+
|
53
|
+
def patch_bump
|
54
|
+
ruby_bump(self, 'patch')
|
55
|
+
end
|
56
|
+
|
57
|
+
def minor_bump
|
58
|
+
ruby_bump(self, 'minor')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy-context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0
|
4
|
+
version: 0.1.0.6.g43abfe4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Provencher
|
@@ -83,14 +83,25 @@ description: Using Chef cookbook style and force any script using it to switch t
|
|
83
83
|
chef even if it is not install. It will install it tho ;)
|
84
84
|
email:
|
85
85
|
- jimbo_dragon@hotmail.com
|
86
|
-
executables:
|
86
|
+
executables:
|
87
|
+
- deploy-context
|
87
88
|
extensions: []
|
88
89
|
extra_rdoc_files:
|
89
90
|
- README.md
|
90
91
|
- LICENSE
|
91
92
|
files:
|
93
|
+
- ".gitignore"
|
94
|
+
- Gemfile
|
92
95
|
- LICENSE
|
93
96
|
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/deploy-context
|
99
|
+
- deploy-context.gemspec
|
100
|
+
- lib/deploy-context.rb
|
101
|
+
- lib/deploy-context/context/deploy.rb
|
102
|
+
- lib/deploy-context/deploy.rb
|
103
|
+
- lib/deploy-context/deploy/git.rb
|
104
|
+
- lib/deploy-context/deploy/ruby.rb
|
94
105
|
homepage: https://github.com/JimboDragonGit/deploy-context
|
95
106
|
licenses:
|
96
107
|
- MIT
|
@@ -110,9 +121,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
121
|
version: '0'
|
111
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
123
|
requirements:
|
113
|
-
- - "
|
124
|
+
- - ">"
|
114
125
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
126
|
+
version: 1.3.1
|
116
127
|
requirements: []
|
117
128
|
rubygems_version: 3.2.32
|
118
129
|
signing_key:
|
metadata.gz.sig
CHANGED
Binary file
|