satorix 0.0.1 → 1.6.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.
Files changed (40) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +4 -1
  3. data/.gitlab-ci.yml +45 -0
  4. data/.rspec +2 -1
  5. data/.rubocop.yml +11 -0
  6. data/.ruby-version +1 -0
  7. data/Gemfile +2 -0
  8. data/Gemfile.lock +25 -0
  9. data/Procfile +1 -0
  10. data/README.md +93 -1
  11. data/Rakefile +8 -4
  12. data/bin/console +3 -3
  13. data/bin/satorix +8 -0
  14. data/lib/satorix.rb +338 -2
  15. data/lib/satorix/CI/deploy/flynn.rb +129 -0
  16. data/lib/satorix/CI/deploy/flynn/environment_variables.rb +121 -0
  17. data/lib/satorix/CI/deploy/flynn/resources.rb +77 -0
  18. data/lib/satorix/CI/deploy/flynn/routes.rb +266 -0
  19. data/lib/satorix/CI/deploy/flynn/scale.rb +52 -0
  20. data/lib/satorix/CI/shared/buildpack_manager.rb +213 -0
  21. data/lib/satorix/CI/shared/buildpack_manager/buildpack.rb +153 -0
  22. data/lib/satorix/CI/shared/ruby/gem_manager.rb +79 -0
  23. data/lib/satorix/CI/shared/yarn_manager.rb +22 -0
  24. data/lib/satorix/CI/test/python/django_test.rb +35 -0
  25. data/lib/satorix/CI/test/python/safety.rb +27 -0
  26. data/lib/satorix/CI/test/ruby/brakeman.rb +32 -0
  27. data/lib/satorix/CI/test/ruby/bundler_audit.rb +32 -0
  28. data/lib/satorix/CI/test/ruby/cucumber.rb +26 -0
  29. data/lib/satorix/CI/test/ruby/rails_test.rb +26 -0
  30. data/lib/satorix/CI/test/ruby/rspec.rb +26 -0
  31. data/lib/satorix/CI/test/ruby/rubocop.rb +98 -0
  32. data/lib/satorix/CI/test/shared/database.rb +74 -0
  33. data/lib/satorix/shared/console.rb +180 -0
  34. data/lib/satorix/version.rb +1 -1
  35. data/satorix.gemspec +13 -11
  36. data/satorix/CI/deploy/ie_gem_server.rb +76 -0
  37. data/satorix/CI/deploy/rubygems.rb +77 -0
  38. data/satorix/custom.rb +21 -0
  39. metadata +57 -29
  40. data/.travis.yml +0 -5
@@ -1,3 +1,3 @@
1
1
  module Satorix
2
- VERSION = '0.0.1'
2
+ VERSION = '1.6.0'.freeze
3
3
  end
@@ -6,12 +6,12 @@ require 'satorix/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'satorix'
8
8
  spec.version = Satorix::VERSION
9
- spec.authors = ['Brad Werth', 'Bret Baptist']
10
- spec.email = ['satorix@iexposure.com']
9
+ spec.authors = ['Satorix']
10
+ spec.email = ['info@satorix.com']
11
11
 
12
- spec.summary = 'CLI tools for Satorix'
13
- spec.description = 'CLI tools for Satorix'
14
- spec.homepage = 'https://iexposure.com'
12
+ spec.summary = 'CLI CI/CD tools for Satorix'
13
+ spec.description = 'CLI CI/CD tools for Satorix'
14
+ spec.homepage = 'http://gitlab.iexposure.com/satorix/satorix'
15
15
 
16
16
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
17
  # to allow pushing to a single host or delete this section to allow pushing to any host.
@@ -24,11 +24,13 @@ Gem::Specification.new do |spec|
24
24
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
25
  f.match(%r{^(test|spec|features)/})
26
26
  end
27
- spec.bindir = "exe"
28
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
27
+ spec.bindir = 'bin'
28
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
29
+ spec.require_paths = ['lib']
30
+
31
+ spec.add_dependency 'airbrake-ruby'
32
+
33
+ spec.add_dependency 'bundler', '~> 1.13'
34
+ spec.add_dependency 'rake'
30
35
 
31
- spec.add_development_dependency "bundler", "~> 1.13"
32
- spec.add_development_dependency "rake", "~> 10.0"
33
- spec.add_development_dependency "rspec", "~> 3.0"
34
36
  end
@@ -0,0 +1,76 @@
1
+ module Satorix
2
+ module CI
3
+ module Deploy
4
+ module IeGemServer
5
+
6
+ require 'fileutils'
7
+
8
+ include Satorix::Shared::Console
9
+
10
+ extend self
11
+
12
+
13
+ def go
14
+ log_bench('Installing the geminabox gem...') { install_geminabox_gem }
15
+ log_bench('Preparing gem build directory...') { prepare_gem_build_directory }
16
+ log_bench('Building gem...') { build_gem }
17
+ built_gems.each { |gem| log_bench("Publishing #{ File.basename gem }...") { publish_gem gem } }
18
+ end
19
+
20
+
21
+ def build_gem
22
+ run_command(%w[rake build])
23
+ end
24
+
25
+
26
+ def built_gems
27
+ Dir.glob(File.join(gem_build_directory, '*.gem')).select { |e| File.file? e }
28
+ end
29
+
30
+
31
+ def gem_build_directory
32
+ File.join(Satorix.app_dir, 'pkg')
33
+ end
34
+
35
+
36
+ def ie_gem_server_host
37
+ "https://#{ ie_gem_server_user_name }:#{ ie_gem_server_password }@gems.iexposure.com"
38
+ end
39
+
40
+
41
+ def install_geminabox_gem
42
+ run_command(['gem', 'install', 'geminabox', '--source', 'https://gems.iexposure.com', '--no-document', '--bindir', Satorix.bin_dir])
43
+ end
44
+
45
+
46
+ def prepare_gem_build_directory
47
+ run_command(['rm', '-rf', gem_build_directory], quiet: true)
48
+ FileUtils.mkdir_p gem_build_directory
49
+ end
50
+
51
+
52
+ def publish_gem(gem)
53
+ run_command(['gem', 'inabox', gem, '--host', ie_gem_server_host],
54
+ filtered_text: [ie_gem_server_user_name, ie_gem_server_password])
55
+ rescue RuntimeError
56
+ # To prevent the display of an ugly stacktrace.
57
+ abort "\nGem was not published!"
58
+ end
59
+
60
+
61
+ private
62
+
63
+
64
+ def ie_gem_server_password
65
+ ENV['IE_GEM_SERVER_PASSWORD']
66
+ end
67
+
68
+
69
+ def ie_gem_server_user_name
70
+ ENV['IE_GEM_SERVER_USER_NAME']
71
+ end
72
+
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,77 @@
1
+ module Satorix
2
+ module CI
3
+ module Deploy
4
+ module Rubygems
5
+
6
+ require 'fileutils'
7
+
8
+ include Satorix::Shared::Console
9
+
10
+ extend self
11
+
12
+
13
+ def go
14
+ log_bench('Generating rubygems.org configuration_file...') { generate_rubygems_configuration_file }
15
+ log_bench('Preparing gem build directory...') { prepare_gem_build_directory }
16
+ log_bench('Building gem...') { build_gem }
17
+ built_gems.each { |gem| log_bench("Publishing #{ File.basename gem }...") { publish_gem gem } }
18
+ end
19
+
20
+
21
+ private
22
+
23
+
24
+ def build_gem
25
+ Dir.chdir(Satorix.app_dir) do
26
+ run_command(%w[bundle exec rake build])
27
+ end
28
+ end
29
+
30
+
31
+ def built_gems
32
+ Dir.glob(File.join(gem_build_directory, '*.gem')).select { |e| File.file? e }
33
+ end
34
+
35
+
36
+ def gem_build_directory
37
+ File.join(Satorix.app_dir, 'pkg')
38
+ end
39
+
40
+
41
+ def generate_rubygems_configuration_file
42
+ path = File.join(Dir.home, '.gem')
43
+ FileUtils.mkdir_p(path) unless File.exist?(path)
44
+
45
+ file = File.join(path, 'credentials')
46
+ File.open(file, 'w') { |f| f.write rubygems_configuration_file_contents }
47
+ FileUtils.chmod 0600, file
48
+ end
49
+
50
+
51
+ def prepare_gem_build_directory
52
+ run_command(['rm', '-rf', gem_build_directory])
53
+ FileUtils.mkdir_p gem_build_directory
54
+ end
55
+
56
+
57
+ def publish_gem(gem)
58
+ run_command(['gem', 'push', gem, '--config-file', File.join(Dir.home, '.gem', 'credentials')])
59
+ rescue RuntimeError
60
+ # To prevent the display of an ugly stacktrace.
61
+ abort "\nGem was not published!"
62
+ end
63
+
64
+
65
+ def rubygems_api_key
66
+ ENV['SATORIX_CI_RUBYGEMS_API_KEY']
67
+ end
68
+
69
+
70
+ def rubygems_configuration_file_contents
71
+ "---\n:rubygems_api_key: #{ rubygems_api_key }"
72
+ end
73
+
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,21 @@
1
+ module Satorix
2
+ module Custom
3
+
4
+
5
+ require_relative 'CI/deploy/rubygems.rb'
6
+
7
+
8
+ extend self
9
+
10
+
11
+ def available_jobs
12
+ {
13
+ deploy: {
14
+ deploy_to_rubygems: Satorix::CI::Deploy::Rubygems
15
+ }
16
+ }
17
+ end
18
+
19
+
20
+ end
21
+ end
metadata CHANGED
@@ -1,77 +1,106 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satorix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
- - Brad Werth
8
- - Bret Baptist
7
+ - Satorix
9
8
  autorequire:
10
- bindir: exe
9
+ bindir: bin
11
10
  cert_chain: []
12
- date: 2016-11-18 00:00:00.000000000 Z
11
+ date: 2021-01-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: bundler
14
+ name: airbrake-ruby
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
- - - "~>"
17
+ - - ">="
19
18
  - !ruby/object:Gem::Version
20
- version: '1.13'
21
- type: :development
19
+ version: '0'
20
+ type: :runtime
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
- - - "~>"
24
+ - - ">="
26
25
  - !ruby/object:Gem::Version
27
- version: '1.13'
26
+ version: '0'
28
27
  - !ruby/object:Gem::Dependency
29
- name: rake
28
+ name: bundler
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
31
  - - "~>"
33
32
  - !ruby/object:Gem::Version
34
- version: '10.0'
35
- type: :development
33
+ version: '1.13'
34
+ type: :runtime
36
35
  prerelease: false
37
36
  version_requirements: !ruby/object:Gem::Requirement
38
37
  requirements:
39
38
  - - "~>"
40
39
  - !ruby/object:Gem::Version
41
- version: '10.0'
40
+ version: '1.13'
42
41
  - !ruby/object:Gem::Dependency
43
- name: rspec
42
+ name: rake
44
43
  requirement: !ruby/object:Gem::Requirement
45
44
  requirements:
46
- - - "~>"
45
+ - - ">="
47
46
  - !ruby/object:Gem::Version
48
- version: '3.0'
49
- type: :development
47
+ version: '0'
48
+ type: :runtime
50
49
  prerelease: false
51
50
  version_requirements: !ruby/object:Gem::Requirement
52
51
  requirements:
53
- - - "~>"
52
+ - - ">="
54
53
  - !ruby/object:Gem::Version
55
- version: '3.0'
56
- description: CLI tools for Satorix
54
+ version: '0'
55
+ description: CLI CI/CD tools for Satorix
57
56
  email:
58
- - satorix@iexposure.com
59
- executables: []
57
+ - info@satorix.com
58
+ executables:
59
+ - console
60
+ - satorix
61
+ - setup
60
62
  extensions: []
61
63
  extra_rdoc_files: []
62
64
  files:
63
65
  - ".gitignore"
66
+ - ".gitlab-ci.yml"
64
67
  - ".rspec"
65
- - ".travis.yml"
68
+ - ".rubocop.yml"
69
+ - ".ruby-version"
66
70
  - Gemfile
71
+ - Gemfile.lock
72
+ - Procfile
67
73
  - README.md
68
74
  - Rakefile
69
75
  - bin/console
76
+ - bin/satorix
70
77
  - bin/setup
71
78
  - lib/satorix.rb
79
+ - lib/satorix/CI/deploy/flynn.rb
80
+ - lib/satorix/CI/deploy/flynn/environment_variables.rb
81
+ - lib/satorix/CI/deploy/flynn/resources.rb
82
+ - lib/satorix/CI/deploy/flynn/routes.rb
83
+ - lib/satorix/CI/deploy/flynn/scale.rb
84
+ - lib/satorix/CI/shared/buildpack_manager.rb
85
+ - lib/satorix/CI/shared/buildpack_manager/buildpack.rb
86
+ - lib/satorix/CI/shared/ruby/gem_manager.rb
87
+ - lib/satorix/CI/shared/yarn_manager.rb
88
+ - lib/satorix/CI/test/python/django_test.rb
89
+ - lib/satorix/CI/test/python/safety.rb
90
+ - lib/satorix/CI/test/ruby/brakeman.rb
91
+ - lib/satorix/CI/test/ruby/bundler_audit.rb
92
+ - lib/satorix/CI/test/ruby/cucumber.rb
93
+ - lib/satorix/CI/test/ruby/rails_test.rb
94
+ - lib/satorix/CI/test/ruby/rspec.rb
95
+ - lib/satorix/CI/test/ruby/rubocop.rb
96
+ - lib/satorix/CI/test/shared/database.rb
97
+ - lib/satorix/shared/console.rb
72
98
  - lib/satorix/version.rb
73
99
  - satorix.gemspec
74
- homepage: https://iexposure.com
100
+ - satorix/CI/deploy/ie_gem_server.rb
101
+ - satorix/CI/deploy/rubygems.rb
102
+ - satorix/custom.rb
103
+ homepage: http://gitlab.iexposure.com/satorix/satorix
75
104
  licenses: []
76
105
  metadata:
77
106
  allowed_push_host: https://rubygems.org
@@ -90,9 +119,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
119
  - !ruby/object:Gem::Version
91
120
  version: '0'
92
121
  requirements: []
93
- rubyforge_project:
94
- rubygems_version: 2.5.1
122
+ rubygems_version: 3.0.3
95
123
  signing_key:
96
124
  specification_version: 4
97
- summary: CLI tools for Satorix
125
+ summary: CLI CI/CD tools for Satorix
98
126
  test_files: []
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.13.6