Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ fmt:
# Build for current platform
build GOOS=(GOOS) GOARCH=(GOARCH):
#!/usr/bin/env bash
set -euo pipefail
mkdir -p {{ RELEASE }}
CGO_ENABLED=0 GOOS={{ GOOS }} GOARCH={{ GOARCH }} \
go build -trimpath -o {{ RELEASE }}/cachewd-{{ GOOS }}-{{ GOARCH }} \
-ldflags "-s -w -X main.version={{ VERSION }} -X main.gitCommit={{ GIT_COMMIT }}" \
./cmd/cachewd
test "{{ GOOS }}-{{ GOARCH }}" = "$(go env GOOS)-$(go env GOARCH)" && (cd {{ RELEASE }} && ln -sf cachewd-{{ GOOS }}-{{ GOARCH }} cachewd)
echo "✓ Built {{ RELEASE }}/cachewd-{{ GOOS }}-{{ GOARCH }}"
for binary in cachew cachewd; do
echo "⏲ Building dist/$binary-{{ GOOS }}-{{ GOARCH }}"
CGO_ENABLED=0 GOOS={{ GOOS }} GOARCH={{ GOARCH }} \
go build -trimpath -o {{ RELEASE }}/${binary}-{{ GOOS }}-{{ GOARCH }} \
-ldflags "-s -w -X main.version={{ VERSION }} -X main.gitCommit={{ GIT_COMMIT }}" \
./cmd/${binary}
test "{{ GOOS }}-{{ GOARCH }}" = "$(go env GOOS)-$(go env GOARCH)" && (cd {{ RELEASE }} && ln -sf ${binary}-{{ GOOS }}-{{ GOARCH }} ${binary})
echo "✓ Done"
done

# Build all platforms
build-all:
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ WORKDIR /app

# Copy pre-built binary from host (built by Justfile)
COPY dist/cachewd-linux-${TARGETARCH} /usr/local/bin/cachewd
COPY dist/cachew-linux-${TARGETARCH} /usr/local/bin/cachew

# Copy default configuration file
COPY cachew.hcl /app/cachew.hcl
Expand Down