Skip to content

Commit 5a971ce

Browse files
committed
updates to adopt kool using Go 1.15
1 parent d30669e commit 5a971ce

File tree

6 files changed

+34
-12
lines changed

6 files changed

+34
-12
lines changed

.env.dist

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# GOOS variable for your local development; since the Go docker images are
2+
# Linux based, in case you are developing on MacOS you must uncomment the line below.
3+
#GOOS=darwin
4+
5+
# GOARCH the architecture to be used for kool run compile script.
6+
#GOARCH=amd64

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/kool
22
/dist/
3+
/.env
34

45
# IDE
56
.vscode/

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM docker/compose:alpine-1.26.2 AS docker-compose
2-
FROM golang:1.14 AS build
2+
FROM golang:1.15.0 AS build
33

44
WORKDIR /app
55

build.sh

-7
This file was deleted.

build_artifacts.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
#!/bin/bash
22

3+
if [ -f .env ]; then
4+
source .env
5+
fi
6+
7+
GO_IMAGE=${GO_IMAGE:-golang:1.15.0}
8+
39
rm -rf dist
410
mkdir -p dist
511

612
echo "Building to GOOS=darwin GOARCH=amd64"
713

8-
docker run --rm --env GOOS=darwin --env GOARCH=amd64 --env CGO_ENABLED=0 -v $(pwd):/code -w /code golang:1.14 go build -a -tags 'osusergo netgo static_build' -ldflags '-extldflags "-static"' -o dist/kool-darwin-x86_64
14+
docker run --rm --env GOOS=darwin --env GOARCH=amd64 --env CGO_ENABLED=0 -v $(pwd):/code -w /code $GO_IMAGE go build -a -tags 'osusergo netgo static_build' -ldflags '-extldflags "-static"' -o dist/kool-darwin-x86_64
915

1016
echo "Building to GOOS=linux GOARCH=amd64"
1117

12-
docker run --rm --env GOOS=linux --env GOARCH=amd64 --env CGO_ENABLED=0 -v $(pwd):/code -w /code golang:1.14 go build -a -tags 'osusergo netgo static_build' -ldflags '-extldflags "-static"' -o dist/kool-linux-x86_64
18+
docker run --rm --env GOOS=linux --env GOARCH=amd64 --env CGO_ENABLED=0 -v $(pwd):/code -w /code $GO_IMAGE go build -a -tags 'osusergo netgo static_build' -ldflags '-extldflags "-static"' -o dist/kool-linux-x86_64
1319

1420
echo "Building to GOOS=linux GOARCH=arm GOARM=6"
1521

16-
docker run --rm --env GOOS=linux --env GOARCH=arm --env GOARM=6 --env CGO_ENABLED=0 -v $(pwd):/code -w /code golang:1.14 go build -a -tags 'osusergo netgo static_build' -ldflags '-extldflags "-static"' -o dist/kool-linux-arm6
22+
docker run --rm --env GOOS=linux --env GOARCH=arm --env GOARM=6 --env CGO_ENABLED=0 -v $(pwd):/code -w /code $GO_IMAGE go build -a -tags 'osusergo netgo static_build' -ldflags '-extldflags "-static"' -o dist/kool-linux-arm6
1723

1824
echo "Building to GOOS=linux GOARCH=arm GOARM=7"
1925

20-
docker run --rm --env GOOS=linux --env GOARCH=arm --env GOARM=7 --env CGO_ENABLED=0 -v $(pwd):/code -w /code golang:1.14 go build -a -tags 'osusergo netgo static_build' -ldflags '-extldflags "-static"' -o dist/kool-linux-arm7
26+
docker run --rm --env GOOS=linux --env GOARCH=arm --env GOARM=7 --env CGO_ENABLED=0 -v $(pwd):/code -w /code $GO_IMAGE go build -a -tags 'osusergo netgo static_build' -ldflags '-extldflags "-static"' -o dist/kool-linux-arm7
2127

2228
echo "Going to generate CHECKSUMS"
2329

kool.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
scripts:
2+
# Helper for local development - parsing presets onto Go,
3+
# compiling and installig locally
4+
dev:
5+
- kool run parse-presets
6+
- kool run compile
7+
- kool run install
8+
# Parsing the preset files onto Go code in a shell automated fashion.
9+
parse-presets:
10+
- bash parse_presets.sh
11+
# Compiling kool itself. In case you are on MacOS make sure to have your .env
12+
# file properly setting GOOS=darwin so you will be able to use the binary.
13+
compile:
14+
- kool docker golang:1.15.0 go build -o kool
15+
install:
16+
- mv kool /usr/local/bin/kools

0 commit comments

Comments
 (0)