diff --git a/Dockerfile b/Dockerfile index 589183d..b76f3b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ FROM golang:alpine AS build COPY . /app WORKDIR /app + +RUN apk add --no-cache bash wget RUN ./generate-spaceapi-types.sh + RUN GOOS=linux go build -o oko-spaceapi cmd/server.go FROM alpine diff --git a/generate-spaceapi-types.sh b/generate-spaceapi-types.sh index 7253fba..5972705 100755 --- a/generate-spaceapi-types.sh +++ b/generate-spaceapi-types.sh @@ -1,8 +1,5 @@ #!/usr/bin/env bash -set -e -set -x - script="$(realpath "${BASH_SOURCE[-1]}")" path="$(dirname "$script")" @@ -11,7 +8,7 @@ cd $path wget -O spaceapi-schema.json https://raw.githubusercontent.com/SpaceApi/schema/master/14.json go install github.com/a-h/generate/cmd/schema-generate@latest mkdir -p pkg/spaceapi -~/go/bin/schema-generate -o pkg/spaceapi/spaceapi.go -p spaceapi spaceapi-schema.json +/go/bin/schema-generate -o pkg/spaceapi/spaceapi.go -p spaceapi spaceapi-schema.json rm spaceapi-schema.json # TODO: Do it inline