From 7169ea32c98a375d345dc2278598314f9a2b44bb Mon Sep 17 00:00:00 2001 From: Leo Arias Date: Sat, 14 Jan 2017 04:35:51 +0000 Subject: [PATCH 1/2] Add the packaging metadata to build the swagger-ui snap --- snapcraft.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 snapcraft.yaml diff --git a/snapcraft.yaml b/snapcraft.yaml new file mode 100644 index 00000000..344a421a --- /dev/null +++ b/snapcraft.yaml @@ -0,0 +1,22 @@ +name: swagger-ui +version: master +summary: The World's Most Popular API Framework +description: | + Swagger UI is part of the Swagger project. The Swagger project allows you to + produce, visualize and consume your OWN RESTful services. No proxy or 3rd + party services required. Do it your own way. + + Swagger UI is a dependency-free collection of HTML, Javascript, and CSS + assets that dynamically generate beautiful documentation and sandbox from a + Swagger-compliant API. Because Swagger UI has no dependencies, you can host + it in any server environment, or on your local machine. + +grade: devel +confinement: strict + +parts: + swagger-ui: + source: . + plugin: nodejs + npm-run: [build] + node-packages: [handlebars] From 6a36b589773b879205c3901e8917c271b2c1086c Mon Sep 17 00:00:00 2001 From: Leo Arias Date: Sat, 14 Jan 2017 05:15:39 +0000 Subject: [PATCH 2/2] Add the daemon --- snapcraft.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snapcraft.yaml b/snapcraft.yaml index 344a421a..c63d017f 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -14,9 +14,15 @@ description: | grade: devel confinement: strict +apps: + swagger-ui: + command: sh -c \"cd $SNAP/lib/node_modules/swagger-ui/dist && http-server -a localhost -p 8080\" + daemon: simple + plugs: [network, network-bind] + parts: swagger-ui: source: . plugin: nodejs npm-run: [build] - node-packages: [handlebars] + node-packages: [handlebars, http-server]