From 1e1d4d13d5ecc12d1bbaed48cdaff2013d3b6efe Mon Sep 17 00:00:00 2001 From: HeNine <> Date: Sun, 29 Jan 2023 11:31:25 +0100 Subject: [PATCH] docker build container --- build.sh | 4 ++-- docker_build/Dockerfile | 14 ++++++++++++++ docker_build/build_container.sh | 3 +++ examples/light.json | 5 ----- examples/room.json | 21 --------------------- src/controller.jsonnet | 2 +- src/docs.jsonnet | 2 +- src/entity.jsonnet | 2 +- src/locations/building.jsonnet | 3 ++- src/locations/site.jsonnet | 2 +- src/relationship.jsonnet | 2 +- src/schemata.jsonnet | 2 +- src/variables/real.jsonnet | 2 +- 13 files changed, 28 insertions(+), 36 deletions(-) create mode 100644 docker_build/Dockerfile create mode 100644 docker_build/build_container.sh delete mode 100644 examples/light.json delete mode 100644 examples/room.json diff --git a/build.sh b/build.sh index f26eb40..87588c7 100644 --- a/build.sh +++ b/build.sh @@ -1,2 +1,2 @@ -jsonnet -J ./lib -S -c -m . .\src\docs.jsonnet -jsonnet -J ./lib -c -m . .\src\schemata.jsonnet \ No newline at end of file +jsonnet -J ./lib -J . -S -c -m . ./src/docs.jsonnet +jsonnet -J ./lib -J . -c -m . ./src/schemata.jsonnet \ No newline at end of file diff --git a/docker_build/Dockerfile b/docker_build/Dockerfile new file mode 100644 index 0000000..48c72d8 --- /dev/null +++ b/docker_build/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.17 + +RUN apk update && \ + apk upgrade && \ + apk add go + +# Configure Go +ENV GOROOT /usr/lib/go +ENV GOPATH /go +ENV PATH /go/bin:$PATH + +RUN go install github.com/google/go-jsonnet/cmd/jsonnet@v0.19.1 + +WORKDIR /picc-doc diff --git a/docker_build/build_container.sh b/docker_build/build_container.sh new file mode 100644 index 0000000..fbf5e25 --- /dev/null +++ b/docker_build/build_container.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker build --rm -t picc/picc-doc-build . \ No newline at end of file diff --git a/examples/light.json b/examples/light.json deleted file mode 100644 index 3524405..0000000 --- a/examples/light.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "light1", - "name": "The First Light", - "description": "Just a li'l' light." -} \ No newline at end of file diff --git a/examples/room.json b/examples/room.json deleted file mode 100644 index 6b4f437..0000000 --- a/examples/room.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "living_room", - "name": "Living Room", - "description": "The living room.", - "relationshios": [ - { - "id": "living_room_temp", - "name": "Temperature in the living room", - "module": "Picc.Relationships.AverageTemperature", - "entities": [ - "living_room", - "therm1", - "themr2" - ], - "arg": { - "prior_mean": 20, - "prior_variance": 3 - } - } - ] -} \ No newline at end of file diff --git a/src/controller.jsonnet b/src/controller.jsonnet index 578138d..30f773c 100644 --- a/src/controller.jsonnet +++ b/src/controller.jsonnet @@ -1,4 +1,4 @@ -local entity = import '../lib/entity.libsonnet'; +local entity = import 'entity.libsonnet'; entity { diff --git a/src/docs.jsonnet b/src/docs.jsonnet index 69fd7ee..1ec5e91 100644 --- a/src/docs.jsonnet +++ b/src/docs.jsonnet @@ -1,4 +1,4 @@ -local loom = import 'lib/loom.libsonnet'; +local loom = import 'loom.libsonnet'; loom.weave(import 'src/entity.jsonnet') + loom.weave(import 'src/locations/room.jsonnet') + diff --git a/src/entity.jsonnet b/src/entity.jsonnet index f4cd015..250d04d 100644 --- a/src/entity.jsonnet +++ b/src/entity.jsonnet @@ -1 +1 @@ -import '../lib/entity.libsonnet' +import 'entity.libsonnet' diff --git a/src/locations/building.jsonnet b/src/locations/building.jsonnet index 71afeba..72aede2 100644 --- a/src/locations/building.jsonnet +++ b/src/locations/building.jsonnet @@ -1,4 +1,5 @@ -local entity = import '../lib/entity.libsonnet'; +local entity = import 'entity.libsonnet'; +local types = import 'types.libsonnet'; entity { diff --git a/src/locations/site.jsonnet b/src/locations/site.jsonnet index bcea09b..c4c26fb 100644 --- a/src/locations/site.jsonnet +++ b/src/locations/site.jsonnet @@ -1,4 +1,4 @@ -local entity = import '../lib/entity.libsonnet'; +local entity = import 'entity.libsonnet'; entity { diff --git a/src/relationship.jsonnet b/src/relationship.jsonnet index 6197efc..f31d4f0 100644 --- a/src/relationship.jsonnet +++ b/src/relationship.jsonnet @@ -1,4 +1,4 @@ -local entity = import '../lib/entity.libsonnet'; +local entity = import 'entity.libsonnet'; entity { diff --git a/src/schemata.jsonnet b/src/schemata.jsonnet index e7e4c64..b268960 100644 --- a/src/schemata.jsonnet +++ b/src/schemata.jsonnet @@ -1,4 +1,4 @@ -local loom = import 'lib/loom.libsonnet'; +local loom = import 'loom.libsonnet'; loom.tangle(import 'src/entity.jsonnet') + loom.tangle(import 'src/relationship.jsonnet') + diff --git a/src/variables/real.jsonnet b/src/variables/real.jsonnet index fafe758..fb2d017 100644 --- a/src/variables/real.jsonnet +++ b/src/variables/real.jsonnet @@ -1,4 +1,4 @@ -local entity = import '../lib/entity.libsonnet'; +local entity = import 'entity.libsonnet'; entity {