fixes the build chain for docker

This commit is contained in:
Holger Cremer
2020-01-11 20:44:08 +01:00
parent 250568578a
commit 09524c20a6
3 changed files with 12 additions and 4 deletions

7
do.sh
View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
usage() { usage() {
echo "Usage $0 (build-linux|docker-image|docker-build|test-sync|sync)" echo "Usage $0 (build-linux|docker-image|docker-dep|docker-build|test-sync|sync)"
} }
if [ "$1" == "" ]; then if [ "$1" == "" ]; then
@@ -19,8 +19,11 @@ while (( "$#" )); do
docker-image) docker-image)
docker build -t space-devices-build docker/ docker build -t space-devices-build docker/
;; ;;
docker-dep)
docker run --rm -it -v $(pwd):/go/src/github.com/ktt-ol/spaceDevices -u $(id -u):$(id -g) space-devices-build dep ensure -v -vendor-only
;;
docker-build) docker-build)
docker run --rm -it -v $(pwd):/go/src/spaceDevices space-devices-build dep ensure -v -vendor-only && ./do.sh build-linux docker run --rm -it -v $(pwd):/go/src/github.com/ktt-ol/spaceDevices -u $(id -u):$(id -g) space-devices-build ./do.sh build-linux
;; ;;
test-sync) test-sync)
rsync -n -avzi --delete spaceDevices listUnkown webUI macVendorDb.csv root@spacegate:/home/status/spaceDevices2/ rsync -n -avzi --delete spaceDevices listUnkown webUI macVendorDb.csv root@spacegate:/home/status/spaceDevices2/

View File

@@ -1,6 +1,7 @@
FROM golang:1.13 FROM golang:1.13
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/0.5.2/dep-linux-amd64 && chmod +x /usr/local/bin/dep RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/0.5.2/dep-linux-amd64 && chmod +x /usr/local/bin/dep
RUN mkdir -p /go/src/github.com/ktt-ol/spaceDevices
RUN mkdir -p /go/src/spaceDevices ENV HOME=/tmp
WORKDIR /go/src/spaceDevices WORKDIR /go/src/github.com/ktt-ol/spaceDevices

View File

@@ -11,5 +11,9 @@ Use the `do.sh` script file in the top directory.
## Build binary ## Build binary
```shell script ```shell script
# installs dependencies, only once needed
./do.sh docker-dep
# build the binary
./do.sh docker-build ./do.sh docker-build
``` ```