Skip to content

Commit

Permalink
rake import_api should work on a different directory
Browse files Browse the repository at this point in the history
Used infrequently, but don't force directory structure.
  • Loading branch information
smarterclayton committed Mar 28, 2016
1 parent e06c903 commit c67f290
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
require 'ascii_binder/tasks/tasks'

task :import_api do
sh "pushd ../origin && hack/gen-swagger-docs.sh" do |ok,res|
base = ENV['ORIGIN_REPO'] || "../origin"
sh "pushd #{base} && hack/gen-swagger-docs.sh" do |ok,res|
fail "Unable to generate docs" if !ok
end
sh "cp ../origin/_output/local/docs/swagger/api/v1/overview.adoc rest_api/kubernetes_v1.adoc" do |ok,res|
sh "cp #{base}/_output/local/docs/swagger/api/v1/overview.adoc rest_api/kubernetes_v1.adoc" do |ok,res|
fail "Unable to copy latest kubernetes v1 docs" if !ok
end
sh "cat ../origin/_output/local/docs/swagger/api/v1/{paths,definitions}.adoc >> rest_api/kubernetes_v1.adoc" do |ok,res|
sh "cat #{base}/_output/local/docs/swagger/api/v1/{paths,definitions}.adoc >> rest_api/kubernetes_v1.adoc" do |ok,res|
fail "Unable to concat latest kubernetes v1 docs" if !ok
end
sh "cp ../origin/_output/local/docs/swagger/oapi/v1/overview.adoc rest_api/openshift_v1.adoc" do |ok,res|
sh "cp #{base}/_output/local/docs/swagger/oapi/v1/overview.adoc rest_api/openshift_v1.adoc" do |ok,res|
fail "Unable to copy latest openshift v1 docs" if !ok
end
sh "cat ../origin/_output/local/docs/swagger/oapi/v1/{paths,definitions}.adoc >> rest_api/openshift_v1.adoc" do |ok,res|
sh "cat #{base}/_output/local/docs/swagger/oapi/v1/{paths,definitions}.adoc >> rest_api/openshift_v1.adoc" do |ok,res|
fail "Unable to concat latest openshift v1 docs" if !ok
end
puts "\nNOTE: You must edit rest_api/kubernetes_v1.adoc and rest_api/openshift_v1.adoc to add TOC metadata"
Expand Down

0 comments on commit c67f290

Please sign in to comment.