Skip to content

Commit 57cea91

Browse files
author
Gufran
committed
Add support for custom templeate file
1 parent a8e06fc commit 57cea91

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

build-custom.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set -eou pipefail
2+
3+
GIT_SHA=$(git rev-parse --short HEAD)
4+
LD_FLAGS_VERSION="-X github.com/kyleconroy/sqlc/internal/cmd.version=custom-${GIT_SHA}"
5+
6+
export CGO_ENABLED=1
7+
8+
set -x
9+
go build -v -o pkg/sqlc -ldflags "-extldflags \"-static\" ${LD_FLAGS_VERSION}" ./cmd/sqlc

custom.Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM golang:1.15 as builder
2+
3+
COPY . /workspace
4+
WORKDIR /workspace
5+
6+
RUN /bin/bash build-custom.sh
7+
8+
FROM scratch
9+
COPY --from=builder /workspace/pkg/sqlc /sqlc
10+
ENTRYPOINT ["/sqlc"]

0 commit comments

Comments
 (0)