Commit 7020c17f authored by Mike Ishida's avatar Mike Ishida
Browse files

GitLab CIのベースイメージを変更。

parent d11a30a0
Pipeline #12061876 passed with stages
in 1 minute and 46 seconds
image: "ubuntu:14.04"
image: "mikehibm/swagger-pdf-creator"
stages:
- deploy
- pdf
......@@ -7,10 +7,6 @@ deploy:
stage: deploy
only:
- /^release-.*$/
before_script:
- apt-get update && apt-get install -y software-properties-common curl git
- add-apt-repository -y ppa:brightbox/ruby-ng && apt-get update && apt-get install -y ruby2.4
- gem install dpl
script:
- ruby -v
......@@ -20,15 +16,19 @@ pdf:
stage: pdf
only:
- /^release-.*$/
before_script:
- apt-get update && apt-get install -y software-properties-common curl
- add-apt-repository -y ppa:openjdk-r/ppa && add-apt-repository -y ppa:brightbox/ruby-ng && apt-get update && apt-get install -y openjdk-8-jdk ruby2.4
- gem install --pre asciidoctor-pdf
script:
- java -version
- ruby -v
- cd ./MySampleWebApi.Doc && chmod +x *.sh && ./build.sh $SWAGGER_JSON_URL
# Build PDF file into /home/pdf/ directory.
- cd /home && /home/build.sh $SWAGGER_JSON_URL output.pdf
# Copy the created PDF file to the project directory. (Necessary to be able to be an artifact)
- cp /home/pdf/output.pdf $CI_PROJECT_DIR/
- ls -al /home/pdf/
- ls -al $CI_PROJECT_DIR
artifacts:
paths:
- ./MySampleWebApi.Doc/pdf/out.pdf
- output.pdf
expire_in: 1 week
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
#./make_md.sh $1
./make_adoc.sh $1
./make_pdf.sh
swagger2markup.markupLanguage=MARKDOWN
java -jar ./swagger2markup-cli-1.3.1.jar convert -i $1 -d ./adoc
cat adoc/overview.adoc adoc/paths.adoc adoc/definitions.adoc > adoc/out.adoc
java -jar ./swagger2markup-cli-1.3.1.jar convert -i $1 -d ./markdown -c ./config.md.properties
cat markdown/overview.md markdown/paths.md markdown/definitions.md > markdown/out.md
\ No newline at end of file
asciidoctor-pdf -o pdf/out.pdf adoc/out.adoc
\ No newline at end of file
{"swagger":"2.0","info":{"version":"v1","title":"My Sample API"},"basePath":"/","paths":{"/api/Products":{"get":{"tags":["Products"],"summary":"商品の一覧を返す。","operationId":"ApiProductsGet","consumes":[],"produces":["application/json"],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Product"}}}},"post":{"tags":["Products"],"summary":"商品を新規登録する。","operationId":"ApiProductsPost","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"product","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/Product"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Product"}}}}},"/api/Products/{id}":{"get":{"tags":["Products"],"summary":"指定されたIdを持つ商品を返す。","operationId":"ApiProductsByIdGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Product"}}}},"put":{"tags":["Products"],"summary":"商品を更新する。","operationId":"ApiProductsByIdPut","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"integer","format":"int32"},{"name":"product","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/Product"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Product"}}}},"delete":{"tags":["Products"],"summary":"商品を削除する。","operationId":"ApiProductsByIdDelete","consumes":[],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/Product"}}}}},"/api/Users":{"get":{"tags":["Users"],"summary":"ユーザーの一覧を返す。","operationId":"ApiUsersGet","consumes":[],"produces":["application/json"],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/User"}}}},"post":{"tags":["Users"],"summary":"ユーザーを新規登録する。","operationId":"ApiUsersPost","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"user","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/User"}}}}},"/api/Users/{id}":{"get":{"tags":["Users"],"summary":"指定されたIdを持つユーザーを返す。","operationId":"ApiUsersByIdGet","consumes":[],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/User"}}}},"put":{"tags":["Users"],"summary":"ユーザーを更新する。","operationId":"ApiUsersByIdPut","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"integer","format":"int64"},{"name":"user","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/User"}}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/User"}}}},"delete":{"tags":["Users"],"summary":"ユーザーを削除する。","operationId":"ApiUsersByIdDelete","consumes":[],"produces":["application/json"],"parameters":[{"name":"id","in":"path","description":"","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/User"}}}}}},"definitions":{"Product":{"type":"object","properties":{"id":{"format":"int64","type":"integer"},"prodCd":{"type":"string"},"prodName":{"type":"string"},"price":{"format":"double","type":"number"},"createdAt":{"format":"date-time","type":"string"}}},"User":{"type":"object","properties":{"id":{"format":"int64","type":"integer"},"name":{"type":"string"},"email":{"type":"string"},"createdAt":{"format":"date-time","type":"string"}}}},"securityDefinitions":{}}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment