Skip to content

Commit

Permalink
Rename contiv.raml -> netmaster.raml, renamed RAML dirs, update RAML …
Browse files Browse the repository at this point in the history
…to refer to renamed dirs, contivModel2raml.rb now takes output file as an arg

Signed-off-by: Bill Robinson <dseevr@users.noreply.github.com>
  • Loading branch information
dseevr committed Mar 23, 2017
1 parent 8cc3dc6 commit 2015959
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 158 deletions.
6 changes: 3 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ set -euo pipefail
bash generate.sh
go install ./ ./client/

# regenerate netmaster.raml
# regenerate libraries/netmaster.raml which holds the type netmaster type data
docker run --rm \
-u $(id -u):$(id -g) \
-v $(pwd):/files \
-w /files/spec \
ruby:2.4.0-slim /usr/local/bin/ruby contivModel2raml.rb
mv spec/netmaster.raml ./spec/contiv/libraries/netmaster.raml
ruby:2.4.0-slim /usr/local/bin/ruby contivModel2raml.rb ./netmaster/libraries/netmaster.raml

# run the raml2html tool to generate docs under spec/docs
pushd spec
Expand All @@ -28,6 +27,7 @@ if [[ "$(docker images -q $IMAGE_NAME:latest 2>/dev/null)" == "" ]]; then
docker build -t $IMAGE_NAME -f spec/Dockerfile.cleanup .
fi

echo "Cleaning up HTML output"
docker run --rm \
-u $(id -u):$(id -g) \
-v $(pwd):/files \
Expand Down
12 changes: 6 additions & 6 deletions spec/auth_proxy.raml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ protocols: [ HTTPS ]
mediaType: [ application/json ]

resourceTypes:
collection: !include contiv/schemas/collection.raml
non-upd-collection-item: !include contiv/schemas/non-upd-collection-item.raml
collection-item: !include contiv/schemas/collection-item.raml
ro-collection-item: !include contiv/schemas/ro-collection-item.raml
collection: !include auth_proxy/schemas/collection.raml
non-upd-collection-item: !include auth_proxy/schemas/non-upd-collection-item.raml
collection-item: !include auth_proxy/schemas/collection-item.raml
ro-collection-item: !include auth_proxy/schemas/ro-collection-item.raml

annotationTypes:
info:
Expand All @@ -27,11 +27,11 @@ annotationTypes:
rediractable: boolean

securitySchemes:
custom_scheme: !include contiv/schemas/custom-scheme.raml
custom_scheme: !include auth_proxy/schemas/custom-scheme.raml

# Resource templates
uses:
auth_proxy: contiv/libraries/auth_proxy.raml
auth_proxy: auth_proxy/libraries/auth_proxy.raml

securedBy: custom_scheme

Expand Down
2 changes: 1 addition & 1 deletion spec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo "generating netmaster docs"
docker run --rm \
-u $(id -u):$(id -g) \
-v $(pwd):/contiv \
$IMAGE_NAME -i contiv.raml -o docs/contiv.html
$IMAGE_NAME -i netmaster.raml -o docs/contiv.html

echo "generating auth_proxy docs"
docker run --rm \
Expand Down
126 changes: 0 additions & 126 deletions spec/contiv/libraries/auth_proxy.raml

This file was deleted.

4 changes: 3 additions & 1 deletion spec/contivModel2raml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ def to_raml
end
end

outfile = "netmaster.raml"
raise "you must supply an output file, e.g., #{$PROGRAM_NAME} ./foo.raml" unless ARGV.size == 1

outfile = ARGV[0]
output = Hash.new { |h, k| h[k] = {} }

Dir["../*.json"].each do |infile|
Expand Down
33 changes: 19 additions & 14 deletions spec/docs/auth_proxy.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/docs/contiv.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<div class="page-header">
<h1>Contiv API documentation <small>version v1</small>
</h1>
<p>http://{serverfqdn}:10000/api/{version}</p>
<p>https://{serverfqdn}:10000/api/{version}</p>
<ul>
<li>
<strong>serverfqdn</strong>: <em>required (string)</em>
Expand Down
12 changes: 6 additions & 6 deletions spec/contiv.raml → spec/netmaster.raml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ protocols: [ HTTPS ]
mediaType: [ application/json ]

resourceTypes:
collection: !include contiv/schemas/collection.raml
non-upd-collection-item: !include contiv/schemas/non-upd-collection-item.raml
collection-item: !include contiv/schemas/collection-item.raml
ro-collection-item: !include contiv/schemas/ro-collection-item.raml
collection: !include netmaster/schemas/collection.raml
non-upd-collection-item: !include netmaster/schemas/non-upd-collection-item.raml
collection-item: !include netmaster/schemas/collection-item.raml
ro-collection-item: !include netmaster/schemas/ro-collection-item.raml

annotationTypes:
info:
Expand All @@ -27,11 +27,11 @@ annotationTypes:
rediractable: boolean

securitySchemes:
custom_scheme: !include contiv/schemas/custom-scheme.raml
custom_scheme: !include netmaster/schemas/custom-scheme.raml

# Resource templates
uses:
netmaster: contiv/libraries/netmaster.raml
netmaster: netmaster/libraries/netmaster.raml

securedBy: custom_scheme

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2015959

Please sign in to comment.