Commit 9c8ebfec authored by Michele Carignani's avatar Michele Carignani
Browse files

Validation in a docker container of the API descriptions + documentation

Change-Id: I9a01cc8c307d26058b1c2775abe828e1f0e5016b
Signed-off-by: default avatarMichele Carignani <michele.carignani@etsi.org>
parent 6ef35650
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+1 −0
Changes for .gitignore: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
build/

.jenkins.sh

0 → 100755
+17 −0
Changes for .jenkins.sh: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/bash
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt

cd "$(dirname "$0")"

run_dir="$(pwd)/src"
store_dir="$(pwd)/build"

mkdir -p "$store_dir"

cd docker

./build-container.sh
./run-container.sh "${run_dir}" "${store_dir}"

exit $?
+21 −0
Changes for Readme.md: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,6 +9,27 @@ The APIs described in this repository are defined for the following reference po

More information at [NFV Solutions wiki](https://nfvwiki.etsi.org/index.php?title=NFV_Solutions).

## Content structure

All the main OpenAPI files should be put in the `src` directory and organized with the following schema:

   src/deliverable-number/api-name/api-name.yaml
   
e.g.

   src/SOL003/LifeCycleManagement/lifeCycleManagement.yaml
   
   
## Building

The build file `.jenkins.sh` will validate the files, evaluate JSON references and store the generated files in the build directory. In case the build is executed by Jenkins, the merged file will be store in a specific directory to be web-served.

To build locally, once Docker is installed, simple run

   $sudo bash .jenkins.sh
   
and the results will be stored in a `build/` directory in the project folder.

## How to raise issues

Change requests can be filed at [ETSI Forge Bugzilla](https://forge.etsi.org/bugzilla/enter_bug.cgi?product=NFV).

docker/Dockerfile

0 → 100644
+16 −0
Changes for docker/Dockerfile: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt

FROM alpine:3.6

RUN apk update
RUN apk add bash
RUN apk add nodejs
RUN apk add nodejs-npm
RUN npm install -g swagger-tools@0.10.3
RUN npm install -g json-refs@3.0.2

ADD validate-in-docker.sh /validate-in-docker.sh
RUN chmod +x /validate-in-docker.sh

CMD ["/validate-in-docker.sh", "/work", "/storage"]
+5 −0
Changes for docker/build-container.sh: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/bash
# Copyright ETSI 2017
# See: https://forge.etsi.org/etsi-forge-copyright-statement.txt

docker build -t openapivalidator .
 No newline at end of file
Loading