Skip to content

Commit

Permalink
Use amd64/alpine-based swagger tool image for API spec validation
Browse files Browse the repository at this point in the history
  • Loading branch information
denismakogon committed Jan 2, 2018
1 parent 3c15ab8 commit f433783
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
13 changes: 0 additions & 13 deletions helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,3 @@ function remove_containers {
docker rm -fv func-mysql-test 2>/dev/null || true
docker rm -fv func-minio-test 2>/dev/null || true
}

function install_swagger_tool {
if [[ ! -f ./swagger ]]; then
case "$(uname)" in
Linux)
curl -L https://github.com/go-swagger/go-swagger/releases/download/0.13.0/swagger_linux_amd64 -o ./swagger
;;
Darwin)
curl -L https://github.com/go-swagger/go-swagger/releases/download/0.13.0/swagger_darwin_amd64 -o ./swagger
esac
fi
chmod +x ./swagger
}
6 changes: 6 additions & 0 deletions images/swagger-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM amd64/alpine:3.5

RUN apk add --no-cache curl
RUN curl -L https://github.com/go-swagger/go-swagger/releases/download/0.13.0/swagger_linux_amd64 -o swagger
RUN chmod +x swagger
ENTRYPOINT ["./swagger", "validate", "/go/src/github.com/fnproject/fn/docs/swagger.yml"]
3 changes: 2 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ go test $(go list ./... | grep -v vendor | grep -v examples | grep -v test/fn-ap
go vet $(go list ./... | grep -v vendor)

remove_containers

install_swagger_tool

./swagger validate docs/swagger.yml
docker run -v `pwd`:/go/src/github.com/fnproject/fn --rm denismakogon/swagger-tool:0.0.1

0 comments on commit f433783

Please sign in to comment.