cf-copilot 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 111090a607e297c9032abbd2850d1df993fd6efe
4
- data.tar.gz: 279e31f4249998ce9a0b83b275fdcc4032c2687b
3
+ metadata.gz: 263c111aaa50a83fbe120d5379ce7f7e400d9eb6
4
+ data.tar.gz: 4e822c834808cf2b3b97d640b896f2b84effbeab
5
5
  SHA512:
6
- metadata.gz: a406ca97277e260a4b6358996edcfb9c6ee6f4feb977eb50956f93dd1088677abd008d302edb7fe72d29abd29b8bd8600fe87574cef9aeffc588f02adb45a4b8
7
- data.tar.gz: a1830e80cbc245ad54661dd2d85968365012b9e18706f9363d784d808b1cb6c1cd6f10aa9b7c6737415b8611d219a74ab1e100f9acabf9df5deb65874150cb3a
6
+ metadata.gz: 57868ece58883157fc0286b8664ada0e51f593131af40aadd42730189de4d502143ad28f038bbb19c30c9e4a85751ddbf66660eef751644788b0ab988945bbc3
7
+ data.tar.gz: 968bdcce9ece3058c748fc48ff769b4b44b65ad4851d193c5d5523ca9e35a8849c3e9b7bfacae74ffc8229ed920de6e2a11e7053f68ae7427af0ad47c7ca0a64
data/README.md CHANGED
@@ -1,29 +1,27 @@
1
- ### How to build and run a Docker image containing the necessary dependencies
1
+ # Ruby SDK
2
2
 
3
- Starting from the repo root:
4
- ```
5
- export COPILOT_ROOT=$(pwd)
6
- cd sdk/ruby
7
- docker build -t protobuf-ruby-dependencies .
8
- docker run -v $COPILOT_ROOT:/tmp/copilot -it protobuf-ruby-dependencies /bin/bash
9
- cd /tmp/copilot
10
- ```
3
+ ## Notes
4
+
5
+ - All commands below from the root of this repo
6
+ - There is no need to run `generate-protos` directly (use the script / docker image)
11
7
 
12
8
  ### How to generate services and messages from the `.proto` file
9
+ ```
10
+ pushd sdk/ruby
11
+ bin/dockerized-rebuild-proto
12
+ popd
13
+ ```
13
14
 
14
- Starting from the repo root:
15
+ ### Run all of the associated ruby specs
15
16
  ```
16
- cd api/protos
17
- protoc --ruby_out=../../sdk/ruby/lib/copilot/protos \
18
- --grpc_out=../../sdk/ruby/lib/copilot/protos \
19
- --plugin="protoc-gen-grpc=$(which grpc_tools_ruby_protoc_plugin)" \
20
- ./cloud_controller.proto
17
+ pushd sdk/ruby
18
+ bin/test
19
+ popd
21
20
  ```
22
21
 
23
22
  ### How to build and install the `cf-copilot` ruby gem
24
-
25
- Starting from the repo root:
26
23
  ```
27
- cd sdk/ruby
28
- gem build ./cf-copilot.gemspec && gem install cf-copilot
24
+ pushd sdk/ruby
25
+ bin/build-and-install-copilot-gem
26
+ popd
29
27
  ```
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ set -eo pipefail
4
+
5
+ docker build -t protobuf-ruby-dependencies .
6
+ docker run -e BUILD_ROOT="/tmp/copilot" -v "${COPILOT_ROOT}:/tmp/copilot" protobuf-ruby-dependencies
@@ -4,9 +4,9 @@ set -euo pipefail
4
4
 
5
5
  echo "Generating services and messages for cf-copilot..."
6
6
 
7
- pushd "${COPILOT_ROOT}/api/protos"
8
- protoc --ruby_out="${COPILOT_ROOT}/sdk/ruby/lib/copilot/protos" \
9
- --grpc_out="${COPILOT_ROOT}/sdk/ruby/lib/copilot/protos" \
7
+ pushd "${BUILD_ROOT}/api/protos"
8
+ protoc --ruby_out="${BUILD_ROOT}/sdk/ruby/lib/copilot/protos" \
9
+ --grpc_out="${BUILD_ROOT}/sdk/ruby/lib/copilot/protos" \
10
10
  --plugin="protoc-gen-grpc=$(which grpc_tools_ruby_protoc_plugin)" \
11
11
  ./cloud_controller.proto
12
12
  popd
data/bin/push-gem ADDED
@@ -0,0 +1,6 @@
1
+ #!/bin/bash
2
+
3
+ set -euo pipefail
4
+
5
+ VERSION="${1}"
6
+ gem push "cf-copilot-${VERSION}.gem"
data/lib/cf-copilot.rb CHANGED
@@ -25,8 +25,8 @@ module Cloudfoundry
25
25
  service.health(request)
26
26
  end
27
27
 
28
- def upsert_route(guid:, host:)
29
- route = Api::Route.new(guid: guid, host: host)
28
+ def upsert_route(guid:, host:, path: '')
29
+ route = Api::Route.new(guid: guid, host: host, path: path)
30
30
  request = Api::UpsertRouteRequest.new(route: route)
31
31
  service.upsert_route(request)
32
32
  rescue GRPC::BadStatus => e
@@ -61,7 +61,8 @@ module Cloudfoundry
61
61
  capi_diego_process_association: {
62
62
  capi_process_guid: capi_process_guid,
63
63
  diego_process_guids: diego_process_guids
64
- })
64
+ }
65
+ )
65
66
 
66
67
  service.upsert_capi_diego_process_association(request)
67
68
  rescue GRPC::BadStatus => e
@@ -26,6 +26,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
26
26
  add_message "api.Route" do
27
27
  optional :guid, :string, 1
28
28
  optional :host, :string, 2
29
+ optional :path, :string, 3
29
30
  end
30
31
  add_message "api.UpsertRouteRequest" do
31
32
  optional :route, :message, 1, "api.Route"
@@ -4,14 +4,14 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "api.HealthResponse" do
7
+ add_message 'api.HealthResponse' do
8
8
  optional :healthy, :bool, 1
9
9
  end
10
- add_message "api.HealthRequest" do
10
+ add_message 'api.HealthRequest' do
11
11
  end
12
12
  end
13
13
 
14
14
  module Api
15
- HealthResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.HealthResponse").msgclass
16
- HealthRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("api.HealthRequest").msgclass
15
+ HealthResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup('api.HealthResponse').msgclass
16
+ HealthRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup('api.HealthRequest').msgclass
17
17
  end
@@ -1,5 +1,5 @@
1
1
  module Cloudfoundry
2
2
  module Copilot
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf-copilot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cloud Foundry Routing Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-10 00:00:00.000000000 Z
11
+ date: 2018-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc
@@ -39,47 +39,47 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.16'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '10.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
61
+ version: '10.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
68
+ version: '10.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: pry
70
+ name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '3.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '3.0'
83
83
  description:
84
84
  email:
85
85
  - cf-routing@pivotal.io
@@ -90,9 +90,10 @@ files:
90
90
  - LICENSE
91
91
  - NOTICE
92
92
  - README.md
93
- - bin/build_and_install_copilot_gem
94
- - bin/build_and_run_docker
95
- - bin/generate_protos
93
+ - bin/build-and-install-copilot-gem
94
+ - bin/dockerized-rebuild-proto
95
+ - bin/generate-protos
96
+ - bin/push-gem
96
97
  - bin/test
97
98
  - lib/cf-copilot.rb
98
99
  - lib/copilot/protos/cloud_controller_pb.rb
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -euo pipefail
4
-
5
- docker build -t protobuf-ruby-dependencies .
6
- docker run -v "${COPILOT_ROOT}:/tmp/copilot" -it protobuf-ruby-dependencies /bin/bash
7
- cd /tmp/copilot