ci_infrastructure_cf_cli 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 44774731f854ac7ac80d5330200840af16f315a7
4
+ data.tar.gz: 6f3d6c37513e77f2cda46b9c6c9f5dc5f8bded60
5
+ SHA512:
6
+ metadata.gz: 2a736806ff38cc8b9babb3ba440ed782710cf3287ad696305de5645ad8a180f56aa9a2c377a10aad58a0cec826935d48c58c6f394d609b6c4eda95284eb6300a
7
+ data.tar.gz: e6a005b0fc0c264dafb71c6470268c78ba1b9fa3cea1fc40d2d90f5466b4b52a0153be8705896b6a0c0a0c3d5c25336c0a896b9838922e9dd124f5f46bd6ead6
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --colour
2
+ --drb
3
+ --tag ~driver:selenium_chrome
4
+ --profile
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ addons:
3
+ code_climate:
4
+ repo_token: a4083ba1f231fc19c9d9b30d016bf68ccf30b88afd8c2fe0fe66482ce53e362e
5
+ rvm:
6
+ - 1.9.3
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ci_infrastructure_cf_cli.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Alan Moran
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ CiInfrastructureCfCli
2
+ =====================
3
+ [![Build Status](https://travis-ci.org/bonzofenix/ci_infrastructure_cf_cli.svg)](https://travis-ci.org/bonzofenix/ci_infrastructure_cf_cli)
4
+ [![Code Climate](https://codeclimate.com/github/bonzofenix/ci_infrastructure_cf_cli.png)](https://codeclimate.com/github/bonzofenix/ci_infrastructure_cf_cli)
5
+ [![Coverage Status](https://coveralls.io/repos/bonzofenix/ci_infrastructure_cf_cli/badge.png)](https://coveralls.io/r/bonzofenix/ci_infrastructure_cf_cli)
6
+ [![Dependency Status](https://gemnasium.com/bonzofenix/ci_infrastructure_cf_cli.svg)](https://gemnasium.com/bonzofenix/ci_infrastructure_cf_cli)
7
+
8
+ Command line application for managing your ci_infrastructure_cf.
9
+ Provides tools for customizing deployments and provisioning your jenkins machine with the changes.}
10
+
11
+ ## Installation
12
+
13
+
14
+ $ gem install ci_infrastructure_cf_cli
15
+
16
+ ## Usage
17
+
18
+ ```:bash
19
+ |2.1.2| Alans-Macbook-Pro in ~/workspace/ci_infrastructure_cf_cli
20
+ ± am |master ✓| → be cic
21
+ Commands:
22
+ cic edit_stub <NAME> # Edits bosh or cloudfoundry stub for any custom change (eg: number of instances, PEMs, etc)
23
+ cic generate_stub <NAME> # Interactively generates a bosh or cloudfoundry that lets you generate a full deployment manifest with spiff
24
+ cic help [COMMAND] # Describe available commands or one specific command
25
+ cic provision # Provision ci_infrastructure_cf jenkins machine
26
+ ```
27
+
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork it ( https://github.com/bonzofenix/ci_infrastructure_cf_cli/fork )
32
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
33
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
34
+ 4. Push to the branch (`git push origin my-new-feature`)
35
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -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
data/bin/cic ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ $:.push File.dirname(__FILE__) + '/../lib'
3
+
4
+ require "rubygems"
5
+
6
+ require "ci_infrastructure_cf_cli"
7
+ require "ci_infrastructure_cf_cli/thor_cli"
8
+
9
+ CiInfrastructureCfCli::ThorCli.start
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ci_infrastructure_cf_cli/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ci_infrastructure_cf_cli"
8
+ spec.version = CiInfrastructureCfCli::VERSION
9
+ spec.authors = ["Alan Moran"]
10
+ spec.email = ["bonzofenix@gmail.com"]
11
+ spec.summary = %q{ CLI for managing your ci_infrastructure_cf.}
12
+ spec.description = %q{ provides tools for customizing deployments and provisioning your jenkins machine with the changes.}
13
+ spec.homepage = "https://github.com/bonzofenix/ci_infrastructure_cf_cli"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "bosh-deployer"
22
+ spec.add_dependency "thor"
23
+ spec.add_development_dependency "bundler"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency "rspec"
26
+ end
@@ -0,0 +1,43 @@
1
+ require "thor"
2
+ require "bosh-deployer"
3
+ require "bosh-deployer/cli/commands/generate_stub"
4
+ module CiInfrastructureCfCli
5
+ class ThorCli < Thor
6
+
7
+ desc "generate_stub <NAME>", "Interactively generates a bosh or cloudfoundry stub. This stub can be use with spiff."
8
+ def generate_stub(name)
9
+ cmd = Bosh::Deployer::Cli::Commands::GenerateStub.new(
10
+ name, default_path )
11
+ cmd.perform
12
+ end
13
+
14
+ desc "edit_stub <NAME>", "Edits bosh or cloudfoundry stub for any custom change (eg: number of instances, PEMs, etc)"
15
+ def edit_stub(name)
16
+ filepath = "#{default_path}/#{name}.yml"
17
+ if File.exist?(filepath)
18
+ spawn_and_wait("vim #{filepath}")
19
+ else
20
+ puts "stub not found at #{filepath}"
21
+ end
22
+ end
23
+
24
+ desc "provision", "Provisions ci_infrastructure_cf jenkins machine"
25
+ def provision
26
+ spawn_and_wait("vagrant provision")
27
+ end
28
+
29
+ #desc 'edit_jobs'
30
+ #desc 'provision_jenkins'
31
+
32
+ no_commands do
33
+ def default_path
34
+ File.expand_path( "#{`pwd`}/cookbooks/ci_infrastructure_cf/files/default/stubs", __FILE__)
35
+ end
36
+
37
+ def spawn_and_wait(cmd)
38
+ pid = spawn(cmd)
39
+ Process.wait(pid)
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,3 @@
1
+ module CiInfrastructureCfCli
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,5 @@
1
+ require "ci_infrastructure_cf_cli/version"
2
+
3
+ module CiInfrastructureCfCli
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,43 @@
1
+ require_relative '../../lib/ci_infrastructure_cf_cli/thor_cli'
2
+ require 'bosh-deployer'
3
+ #require 'bosh-deployer/cli/commands/generate_stub'
4
+
5
+ describe CiInfrastructureCfCli::ThorCli do
6
+ let(:cli){ described_class.new }
7
+
8
+ describe 'generate_stub' do
9
+ let(:cmd){ double.as_null_object }
10
+
11
+ it 'should called generate stub with the correct commands' do
12
+ expect(Bosh::Deployer::Cli::Commands::GenerateStub)
13
+ .to receive(:new).with('bosh',anything).and_return(cmd)
14
+ cli.generate_stub('bosh')
15
+ end
16
+ end
17
+
18
+ describe 'edit_stub' do
19
+ before{ allow(File).to receive(:exist?).and_return(true) }
20
+ let(:default_path) do
21
+ File.expand_path( "#{`pwd`}/cookbooks/ci_infrastructure_cf/files/default/stubs", __FILE__)
22
+ end
23
+ %w{ bosh cf }.each do |stub|
24
+
25
+ it "opens editor with the #{stub} stub" do
26
+ expect(cli).to receive('spawn_and_wait')
27
+ .with("vim #{default_path}/#{stub}.yml")
28
+ cli.edit_stub(stub)
29
+ end
30
+ end
31
+ end
32
+
33
+ describe 'provision' do
34
+ it "opens performs a vagrant provision" do
35
+ expect(cli).to receive('spawn_and_wait')
36
+ .with("vagrant provision")
37
+ cli.provision
38
+ end
39
+ end
40
+
41
+ describe 'deploy_jenkins'
42
+ describe 'deploy_microbosh'
43
+ end
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ci_infrastructure_cf_cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Alan Moran
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bosh-deployer
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: " provides tools for customizing deployments and provisioning your jenkins
84
+ machine with the changes."
85
+ email:
86
+ - bonzofenix@gmail.com
87
+ executables:
88
+ - cic
89
+ extensions: []
90
+ extra_rdoc_files: []
91
+ files:
92
+ - ".gitignore"
93
+ - ".rspec"
94
+ - ".travis.yml"
95
+ - Gemfile
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
99
+ - bin/cic
100
+ - ci_infrastructure_cf_cli.gemspec
101
+ - lib/ci_infrastructure_cf_cli.rb
102
+ - lib/ci_infrastructure_cf_cli/thor_cli.rb
103
+ - lib/ci_infrastructure_cf_cli/version.rb
104
+ - spec/lib/thor_cli_spec.rb
105
+ homepage: https://github.com/bonzofenix/ci_infrastructure_cf_cli
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 2.2.2
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: CLI for managing your ci_infrastructure_cf.
129
+ test_files:
130
+ - spec/lib/thor_cli_spec.rb