satorix 0.0.1 → 1.5.3

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/CI/deploy/flynn/environment_variables.rb +123 -0
  15. data/lib/satorix/CI/deploy/flynn/resources.rb +79 -0
  16. data/lib/satorix/CI/deploy/flynn/routes.rb +267 -0
  17. data/lib/satorix/CI/deploy/flynn/scale.rb +52 -0
  18. data/lib/satorix/CI/deploy/flynn.rb +132 -0
  19. data/lib/satorix/CI/shared/buildpack_manager/buildpack.rb +159 -0
  20. data/lib/satorix/CI/shared/buildpack_manager.rb +220 -0
  21. data/lib/satorix/CI/shared/ruby/gem_manager.rb +80 -0
  22. data/lib/satorix/CI/shared/yarn_manager.rb +25 -0
  23. data/lib/satorix/CI/test/python/django_test.rb +38 -0
  24. data/lib/satorix/CI/test/python/safety.rb +30 -0
  25. data/lib/satorix/CI/test/ruby/brakeman.rb +35 -0
  26. data/lib/satorix/CI/test/ruby/bundler_audit.rb +35 -0
  27. data/lib/satorix/CI/test/ruby/cucumber.rb +29 -0
  28. data/lib/satorix/CI/test/ruby/rails_test.rb +29 -0
  29. data/lib/satorix/CI/test/ruby/rspec.rb +29 -0
  30. data/lib/satorix/CI/test/ruby/rubocop.rb +98 -0
  31. data/lib/satorix/CI/test/shared/database.rb +74 -0
  32. data/lib/satorix/shared/console.rb +157 -0
  33. data/lib/satorix/version.rb +1 -1
  34. data/lib/satorix.rb +343 -2
  35. data/satorix/CI/deploy/ie_gem_server.rb +80 -0
  36. data/satorix/CI/deploy/rubygems.rb +81 -0
  37. data/satorix/custom.rb +21 -0
  38. data/satorix.gemspec +13 -11
  39. metadata +57 -29
  40. data/.travis.yml +0 -5
@@ -0,0 +1,81 @@
1
+ module Satorix
2
+ module CI
3
+ module Deploy
4
+ module Rubygems
5
+
6
+
7
+ require 'fileutils'
8
+
9
+
10
+ include Satorix::Shared::Console
11
+
12
+
13
+ extend self
14
+
15
+
16
+ def go
17
+ log_bench('Generating rubygems.org configuration_file...') { generate_rubygems_configuration_file }
18
+ log_bench('Preparing gem build directory...') { prepare_gem_build_directory }
19
+ log_bench('Building gem...') { build_gem }
20
+ built_gems.each { |gem| log_bench("Publishing #{ File.basename gem }...") { publish_gem gem } }
21
+ end
22
+
23
+
24
+ private ########################################################################################################
25
+
26
+
27
+ def build_gem
28
+ Dir.chdir(Satorix.app_dir) do
29
+ run_command 'bundle exec rake build'
30
+ end
31
+ end
32
+
33
+
34
+ def built_gems
35
+ Dir.glob(File.join(gem_build_directory, '*.gem')).select { |e| File.file? e }
36
+ end
37
+
38
+
39
+ def gem_build_directory
40
+ File.join Satorix.app_dir, 'pkg'
41
+ end
42
+
43
+
44
+ def generate_rubygems_configuration_file
45
+ path = File.join(Dir.home, '.gem')
46
+ FileUtils.mkdir_p(path) unless File.exist?(path)
47
+
48
+ file = File.join(path, 'credentials')
49
+ File.open(file, 'w') { |f| f.write rubygems_configuration_file_contents }
50
+ FileUtils.chmod 0600, file
51
+ end
52
+
53
+
54
+ def prepare_gem_build_directory
55
+ run_command "rm -rf #{ gem_build_directory }"
56
+ FileUtils.mkdir_p gem_build_directory
57
+ end
58
+
59
+
60
+ def publish_gem(gem)
61
+ run_command "gem push #{ gem } --config-file #{ File.join(Dir.home, '.gem', 'credentials') }"
62
+ rescue RuntimeError
63
+ # To prevent the display of an ugly stacktrace.
64
+ abort "\nGem was not published!"
65
+ end
66
+
67
+
68
+ def rubygems_api_key
69
+ ENV['SATORIX_CI_RUBYGEMS_API_KEY']
70
+ end
71
+
72
+
73
+ def rubygems_configuration_file_contents
74
+ "---\n:rubygems_api_key: #{ rubygems_api_key }"
75
+ end
76
+
77
+
78
+ end
79
+ end
80
+ end
81
+ end
data/satorix/custom.rb ADDED
@@ -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
data/satorix.gemspec CHANGED
@@ -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
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.5.3
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: 2020-04-21 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: []
data/.travis.yml DELETED
@@ -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