From 3da2eece626fbd04252624403a4cabef63bc547a Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 14 Jan 2019 09:41:34 -0700 Subject: [PATCH] inline compile script --- do.sh | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/do.sh b/do.sh index 85ecd8d..172788e 100755 --- a/do.sh +++ b/do.sh @@ -6,17 +6,14 @@ function main() { thispkg="${PWD##*$GOPATH/}" thisexec="$(basename "$thispkg")" function cleanup() { - rm "$compile" rm "$dockfile" } trap cleanup EXIT if [ "$(uname -s)" == "Darwin" ]; then - compile="$(mktemp -t . tmpXXXXX | tail -n 1)" dockfile="$(mktemp -t . tmpXXXX | tail -n 1)" - echo ,"$compile", ."$dockfile". + echo "$dockfile" else - compile="$(mktemp -p . tmpXXXXX)" dockfile="$(mktemp -p . tmpXXXX)" fi @@ -141,17 +138,6 @@ function py2_dockerfiles() { } function go_dockerfiles() { -echo ' -#! /bin/sh - -set -e -set -u - -go get -d ./... - -CGO_ENABLED=0 go build -o /go/bin/'"$thisexec"' -a -installsuffix cgo -' > "$compile" - from="golang:1.10-alpine" if [ "$(uname -s)" == "Darwin" ]; then from="registry-app.eng.qops.net:5001/imported/alpine/golang:1.10-alpine" @@ -165,7 +151,7 @@ RUN apk add --no-cache git WORKDIR /go/'"$thispkg"' COPY . . -RUN /bin/sh '"$compile"' +RUN /bin/sh -c "CGO_ENABLED=0 go build -o /go/bin/exec -a -installsuffix cgo" FROM alpine as certs RUN apk update && apk add ca-certificates