mirror of
https://github.com/sascha-hemi/spaceDevices.git
synced 2026-03-20 23:04:24 +01:00
fixes the build chain for docker
This commit is contained in:
7
do.sh
7
do.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
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
|
||||
@@ -19,8 +19,11 @@ while (( "$#" )); do
|
||||
docker-image)
|
||||
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 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)
|
||||
rsync -n -avzi --delete spaceDevices listUnkown webUI macVendorDb.csv root@spacegate:/home/status/spaceDevices2/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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 mkdir -p /go/src/github.com/ktt-ol/spaceDevices
|
||||
|
||||
RUN mkdir -p /go/src/spaceDevices
|
||||
WORKDIR /go/src/spaceDevices
|
||||
ENV HOME=/tmp
|
||||
WORKDIR /go/src/github.com/ktt-ol/spaceDevices
|
||||
|
||||
@@ -11,5 +11,9 @@ Use the `do.sh` script file in the top directory.
|
||||
## Build binary
|
||||
|
||||
```shell script
|
||||
# installs dependencies, only once needed
|
||||
./do.sh docker-dep
|
||||
|
||||
# build the binary
|
||||
./do.sh docker-build
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user