capsulecd 1.0.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 (104) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +2 -0
  3. data/.dockerignore +5 -0
  4. data/.gitignore +95 -0
  5. data/.rspec +3 -0
  6. data/.simplecov +9 -0
  7. data/Dockerfile +16 -0
  8. data/Dockerfile.chef +26 -0
  9. data/Dockerfile.javascript +7 -0
  10. data/Dockerfile.node +7 -0
  11. data/Dockerfile.python +7 -0
  12. data/Dockerfile.ruby +4 -0
  13. data/FEATURES.md +12 -0
  14. data/Gemfile +26 -0
  15. data/LICENSE.md +22 -0
  16. data/README.md +227 -0
  17. data/Rakefile +43 -0
  18. data/bin/capsulecd +4 -0
  19. data/capsulecd.gemspec +27 -0
  20. data/circle.yml +24 -0
  21. data/lib/capsulecd/base/common/git_utils.rb +90 -0
  22. data/lib/capsulecd/base/common/validation_utils.rb +22 -0
  23. data/lib/capsulecd/base/configuration.rb +151 -0
  24. data/lib/capsulecd/base/engine.rb +163 -0
  25. data/lib/capsulecd/base/runner/circleci.rb +37 -0
  26. data/lib/capsulecd/base/runner/default.rb +38 -0
  27. data/lib/capsulecd/base/source/github.rb +183 -0
  28. data/lib/capsulecd/base/transform_engine.rb +62 -0
  29. data/lib/capsulecd/chef/chef_engine.rb +172 -0
  30. data/lib/capsulecd/chef/chef_helper.rb +29 -0
  31. data/lib/capsulecd/cli.rb +64 -0
  32. data/lib/capsulecd/error.rb +51 -0
  33. data/lib/capsulecd/javascript/javascript_engine.rb +213 -0
  34. data/lib/capsulecd/node/node_engine.rb +141 -0
  35. data/lib/capsulecd/python/python_engine.rb +157 -0
  36. data/lib/capsulecd/ruby/ruby_engine.rb +191 -0
  37. data/lib/capsulecd/ruby/ruby_helper.rb +60 -0
  38. data/lib/capsulecd/version.rb +3 -0
  39. data/lib/capsulecd.rb +16 -0
  40. data/logo.svg +1 -0
  41. data/spec/fixtures/chef/cookbook_analogj_test/CHANGELOG.md +3 -0
  42. data/spec/fixtures/chef/cookbook_analogj_test/Gemfile +18 -0
  43. data/spec/fixtures/chef/cookbook_analogj_test/LICENSE +21 -0
  44. data/spec/fixtures/chef/cookbook_analogj_test/README.md +13 -0
  45. data/spec/fixtures/chef/cookbook_analogj_test/Rakefile +1 -0
  46. data/spec/fixtures/chef/cookbook_analogj_test/Thorfile +12 -0
  47. data/spec/fixtures/chef/cookbook_analogj_test/chefignore +94 -0
  48. data/spec/fixtures/chef/cookbook_analogj_test/metadata.rb +5 -0
  49. data/spec/fixtures/chef/cookbook_analogj_test/recipes/default.rb +6 -0
  50. data/spec/fixtures/incorrect_configuration.yml +4 -0
  51. data/spec/fixtures/javascript/javascript_analogj_test/LICENSE +21 -0
  52. data/spec/fixtures/javascript/javascript_analogj_test/README.md +2 -0
  53. data/spec/fixtures/javascript/javascript_analogj_test/package.json +19 -0
  54. data/spec/fixtures/node/npm_analogj_test/LICENSE +21 -0
  55. data/spec/fixtures/node/npm_analogj_test/README.md +2 -0
  56. data/spec/fixtures/node/npm_analogj_test/package.json +19 -0
  57. data/spec/fixtures/python/pip_analogj_test/LICENSE +21 -0
  58. data/spec/fixtures/python/pip_analogj_test/MANIFEST.in +1 -0
  59. data/spec/fixtures/python/pip_analogj_test/README.md +1 -0
  60. data/spec/fixtures/python/pip_analogj_test/VERSION +1 -0
  61. data/spec/fixtures/python/pip_analogj_test/setup.cfg +5 -0
  62. data/spec/fixtures/python/pip_analogj_test/setup.py +80 -0
  63. data/spec/fixtures/python/pip_analogj_test/tox.ini +14 -0
  64. data/spec/fixtures/ruby/gem_analogj_test/Gemfile +4 -0
  65. data/spec/fixtures/ruby/gem_analogj_test/LICENSE.txt +21 -0
  66. data/spec/fixtures/ruby/gem_analogj_test/README.md +41 -0
  67. data/spec/fixtures/ruby/gem_analogj_test/Rakefile +6 -0
  68. data/spec/fixtures/ruby/gem_analogj_test/bin/console +14 -0
  69. data/spec/fixtures/ruby/gem_analogj_test/bin/setup +8 -0
  70. data/spec/fixtures/ruby/gem_analogj_test/gem_analogj_test.gemspec +25 -0
  71. data/spec/fixtures/ruby/gem_analogj_test/lib/gem_analogj_test/version.rb +3 -0
  72. data/spec/fixtures/ruby/gem_analogj_test/lib/gem_analogj_test.rb +5 -0
  73. data/spec/fixtures/ruby/gem_analogj_test/spec/gem_analogj_test_spec.rb +7 -0
  74. data/spec/fixtures/ruby/gem_analogj_test/spec/spec_helper.rb +2 -0
  75. data/spec/fixtures/ruby/gem_analogj_test-0.1.4.gem +0 -0
  76. data/spec/fixtures/sample_chef_configuration.yml +8 -0
  77. data/spec/fixtures/sample_configuration.yml +7 -0
  78. data/spec/fixtures/sample_global_configuration.yml +23 -0
  79. data/spec/fixtures/sample_node_configuration.yml +7 -0
  80. data/spec/fixtures/sample_python_configuration.yml +8 -0
  81. data/spec/fixtures/sample_repo_configuration.yml +22 -0
  82. data/spec/fixtures/sample_ruby_configuration.yml +5 -0
  83. data/spec/fixtures/vcr_cassettes/chef_build_step.yml +636 -0
  84. data/spec/fixtures/vcr_cassettes/gem_build_step.yml +653 -0
  85. data/spec/fixtures/vcr_cassettes/gem_build_step_without_version_rb.yml +653 -0
  86. data/spec/fixtures/vcr_cassettes/integration_chef.yml +1399 -0
  87. data/spec/fixtures/vcr_cassettes/integration_node.yml +1388 -0
  88. data/spec/fixtures/vcr_cassettes/integration_python.yml +1388 -0
  89. data/spec/fixtures/vcr_cassettes/integration_ruby.yml +1377 -0
  90. data/spec/fixtures/vcr_cassettes/node_build_step.yml +647 -0
  91. data/spec/fixtures/vcr_cassettes/pip_build_step.yml +653 -0
  92. data/spec/lib/capsulecd/base/configuration_spec.rb +75 -0
  93. data/spec/lib/capsulecd/base/engine_spec.rb +51 -0
  94. data/spec/lib/capsulecd/base/source/github_spec.rb +253 -0
  95. data/spec/lib/capsulecd/base/transform_engine_spec.rb +55 -0
  96. data/spec/lib/capsulecd/chef/chef_engine_spec.rb +114 -0
  97. data/spec/lib/capsulecd/cli_spec.rb +57 -0
  98. data/spec/lib/capsulecd/node/node_engine_spec.rb +113 -0
  99. data/spec/lib/capsulecd/python/python_engine_spec.rb +118 -0
  100. data/spec/lib/capsulecd/ruby/ruby_engine_spec.rb +128 -0
  101. data/spec/spec_helper.rb +105 -0
  102. data/spec/support/file_system.rb +21 -0
  103. data/spec/support/package_types.rb +11 -0
  104. metadata +281 -0
@@ -0,0 +1,80 @@
1
+ """A setuptools based setup module.
2
+
3
+ See:
4
+ https://packaging.python.org/en/latest/distributing.html
5
+ https://github.com/pypa/sampleproject
6
+ """
7
+
8
+ # Always prefer setuptools over distutils
9
+ from setuptools import setup, find_packages
10
+ # To use a consistent encoding
11
+ from codecs import open
12
+ from os import path, listdir
13
+
14
+ version = 'unknown'
15
+ with open(path.join(path.dirname(path.abspath(__file__)), 'VERSION')) as version_file:
16
+ version = version_file.read().strip()
17
+
18
+ here = path.abspath(path.dirname(__file__))
19
+
20
+ # Get the long description from the README file
21
+ with open(path.join(here, 'README.md'), encoding='utf-8') as f:
22
+ long_description = f.read()
23
+
24
+ setup(
25
+ name='pip_analogj_test',
26
+
27
+ # Versions should comply with PEP440. For a discussion on single-sourcing
28
+ # the version across setup.py and the project code, see
29
+ # https://packaging.python.org/en/latest/single_source_version.html
30
+ version=version,
31
+
32
+ description='test package',
33
+ long_description=long_description,
34
+
35
+ # The project's main homepage.
36
+ url='https://github.com/AnalogJ/pip_analogj_test',
37
+
38
+ # Author details
39
+ author='Jason Kulatunga',
40
+ author_email='jason@thesparktree.com',
41
+
42
+ # Choose your license
43
+ license='MIT',
44
+
45
+ # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
46
+ classifiers=[
47
+ # How mature is this project? Common values are
48
+ # 3 - Alpha
49
+ # 4 - Beta
50
+ # 5 - Production/Stable
51
+ 'Development Status :: 5 - Production/Stable'
52
+ ],
53
+
54
+ # What does your project relate to?
55
+ keywords='pip_analogj_test',
56
+
57
+ # You can just specify the packages manually here if your project is
58
+ # simple. Or you can use find_packages().
59
+ packages=find_packages(exclude=['contrib', 'docs', 'tests']),
60
+
61
+ # Alternatively, if you want to distribute just a my_module.py, uncomment
62
+ # this:
63
+ # py_modules=["my_module"],
64
+
65
+ # List run-time dependencies here. These will be installed by pip when
66
+ # your project is installed. For an analysis of "install_requires" vs pip's
67
+ # requirements files see:
68
+ # https://packaging.python.org/en/latest/requirements.html
69
+ install_requires=['pip_analogj_test']
70
+
71
+ # Although 'package_data' is the preferred approach, in some case you may
72
+ # need to place data files outside of your packages. See:
73
+ # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
74
+ # In this case, 'data_file' will be installed into '<sys.prefix>/my_data'
75
+ #data_files=[('my_data', ['data/data_file'])],
76
+
77
+ # To provide executable scripts, use entry points in preference to the
78
+ # "scripts" keyword. Entry points provide cross-platform support and allow
79
+ # pip to create the appropriate form of executable for the target platform.
80
+ )
@@ -0,0 +1,14 @@
1
+ # Tox (http://tox.testrun.org/) is a tool for running tests
2
+ # in multiple virtualenvs. This configuration file will run the
3
+ # test suite on all supported python versions. To use it, "pip install tox"
4
+ # and then run "tox" from this directory.
5
+
6
+ [tox]
7
+ envlist = py27
8
+ usedevelop = True
9
+
10
+ [testenv]
11
+ # commands = py.test tests # we're not using py.test here because when running py.test with no test cases causes an error exit code.
12
+ commands = echo "success"
13
+ deps =
14
+ pytest
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gem_test.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Jason Kulatunga
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # GemTest
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/gem_test`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'gem_test'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install gem_test
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gem_test.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "gem_analogj_test"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'gem_analogj_test/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "gem_analogj_test"
8
+ spec.version = GemTest::VERSION
9
+ spec.authors = ["Jason Kulatunga"]
10
+ spec.email = ["jk17@ualberta.ca"]
11
+
12
+ spec.summary = 'this is my test summary'
13
+ spec.description = 'this is my test description'
14
+ spec.homepage = "http://www.github.com/Analogj/gem_analogj_test"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.11"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec", "~> 3.0"
25
+ end
@@ -0,0 +1,3 @@
1
+ module GemTest
2
+ VERSION = "0.1.3"
3
+ end
@@ -0,0 +1,5 @@
1
+ require "gem_analogj_test/version"
2
+
3
+ module GemTest
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'GemTest' do
4
+ it 'does something useful' do
5
+ expect(true).to eq(true)
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'gem_analogj_test'
@@ -0,0 +1,8 @@
1
+ ---
2
+ source_github_access_token: sample_test_token
3
+ chef_supermarket_username: sample_supermarket_username
4
+ chef_supermarket_key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpzYW1wbGVfc3VwZXJtYXJrZXRfa2V5Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
5
+ runner_pull_request: 11
6
+ runner_clone_url: http://github.com/AnalogJ/cookbook_analogj_test.git
7
+ runner_repo_name: cookbook_analogj_test
8
+ runner_repo_full_name: AnalogJ/cookbook_analogj_test
@@ -0,0 +1,7 @@
1
+ ---
2
+ npm_auth_token: sample_auth_token
3
+ source_github_access_token: sample_test_token
4
+ pypi_username: sample_pypi_username
5
+ pypi_password: sample_pypi_password
6
+ chef_supermarket_username: sample_supermarket_username
7
+ chef_supermarket_key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpzYW1wbGVfc3VwZXJtYXJrZXRfa2V5Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
@@ -0,0 +1,23 @@
1
+ ---
2
+ source_configure:
3
+ pre: |
4
+ # this is my multiline ruby script
5
+ # the pre hook script runs before the actual step (source_configure) executes
6
+ # we have access to any of the specified instance variables here.
7
+ # check the documentation for more information.
8
+ "override pre_source_configure"
9
+ override: |
10
+ # override scripts can be used to completely replace the built-in step script.
11
+ # to ensure that you are compatible with the capsulecd runner, please ensure that you
12
+ # populate all the correct instance variables.
13
+ # see the documentation for more information
14
+ "override source_configure"
15
+ post: |
16
+ # post scripts run after the step (source_configure) executes
17
+ # you can override any instance variables here, do additional cleanup or anything else you want.
18
+ "override post_source_configure"
19
+ build_step:
20
+ post: |
21
+ # post build step runs after the build_step runs
22
+ # within the script you have access to all instance variables and other methods defined in the engine.
23
+ "override post_build_step" + @source_git_local_path
@@ -0,0 +1,7 @@
1
+ ---
2
+ npm_auth_token: sample_auth_token
3
+ source_github_access_token: sample_test_token
4
+ runner_pull_request: 13
5
+ runner_clone_url: http://github.com/AnalogJ/npm_analogj_test.git
6
+ runner_repo_name: npm_analogj_test
7
+ runner_repo_full_name: AnalogJ/npm_analogj_test
@@ -0,0 +1,8 @@
1
+ ---
2
+ source_github_access_token: sample_test_token
3
+ pypi_username: sample_pypi_username
4
+ pypi_password: sample_pypi_password
5
+ runner_pull_request: 7
6
+ runner_clone_url: https://github.com/AnalogJ/pip_analogj_test.git
7
+ runner_repo_name: pip_analogj_test
8
+ runner_repo_full_name: AnalogJ/pip_analogj_test
@@ -0,0 +1,22 @@
1
+ ---
2
+ source_configure:
3
+ pre: >
4
+ # this is my multiline ruby script
5
+ # the pre hook script runs before the actual step (source_configure) executes
6
+ # we have access to any of the specified instance variables here.
7
+ # check the documentation for more information.
8
+ "override pre_source_configure"
9
+ override: >
10
+ # override scripts can be used to completely replace the built-in step script.
11
+ # to ensure that you are compatible with the capsulecd runner, please ensure that you
12
+ # populate all the correct instance variables.
13
+ # see the documentation for more information
14
+ "override source_configure"
15
+ post: >
16
+ # post scripts run after the step (source_configure) executes
17
+ # you can override any instance variables here, do additional cleanup or anything else you want.
18
+ "override post_source_configure"
19
+
20
+
21
+
22
+
@@ -0,0 +1,5 @@
1
+ ---
2
+ source_github_access_token: sample_test_token
3
+ rubygems_api_key: sample_rubygems_api_key
4
+ runner_repo_full_name: AnalogJ/gem_test
5
+ runner_pull_request: 5