Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native goreleaser #482

Merged
merged 7 commits into from
Jun 15, 2021
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
14 changes: 9 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ builds:
- main: ./cmd/flipt/.
env:
- CGO_ENABLED=1
- CC=x86_64-linux-musl-gcc
- CXX=x86_64-linux-musl-g++
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
- -linkmode external -extldflags -static
goos:
- linux
goarch:
Expand All @@ -15,7 +20,7 @@ archives:
- LICENSE
- README.md
- CHANGELOG.md
- ./config/migrations/*/**
- ./config/migrations/
- ./config/default.yml

checksum:
Expand All @@ -26,9 +31,7 @@ changelog:

dockers:
- dockerfile: ./build/Dockerfile
binaries:
- flipt
skip_push: true
use_buildx: true
image_templates:
- "markphelps/flipt:latest"
- "markphelps/flipt:{{ .Tag }}"
Expand All @@ -39,4 +42,5 @@ dockers:
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
extra_files:
- config
- config/migrations/
- config/default.yml
12 changes: 7 additions & 5 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
brew "go"
brew "cmake"
brew "pkg-config"
brew "sqlite"
brew "protobuf"
brew 'go'
brew 'cmake'
brew 'pkg-config'
brew 'sqlite'
brew 'protobuf'
brew 'FiloSottile/musl-cross/musl-cross'
brew 'goreleaser/tap/goreleaser'
6 changes: 2 additions & 4 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# https://goreleaser.com/docker/

ARG BINARY=flipt
ARG ALPINE_VERSION=3.10.9

FROM alpine:3.10
FROM alpine:${ALPINE_VERSION}
LABEL maintainer="[email protected]"
LABEL org.opencontainers.image.name="flipt"
LABEL org.opencontainers.image.source="https://github.com/markphelps/flipt"
Expand All @@ -21,7 +22,4 @@ COPY config/*.yml /etc/flipt/config/
EXPOSE 8080
EXPOSE 9000

# Docker exposes container ports to the IP address 0.0.0.0
ENV FLIPT_SERVER_HOST 0.0.0.0

CMD ["./flipt"]
15 changes: 2 additions & 13 deletions script/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,19 @@

set -euo pipefail

GORELEASER_VERSION=v0.148.0

cd "$(dirname "$0")/.." || exit

case "$1" in
"release")
github-release-notes -org markphelps -repo flipt --since-latest-release | tee release.out

docker run --rm --privileged \
-v "$PWD":/flipt \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /flipt \
-e GITHUB_TOKEN \
goreleaser/goreleaser:"$GORELEASER_VERSION"-cgo --rm-dist --release-notes release.out
goreleaser --rm-dist --release-notes release.out

rm release.out
;;

"snapshot")
docker run --rm --privileged \
-v "$PWD":/flipt \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /flipt \
goreleaser/goreleaser:"$GORELEASER_VERSION"-cgo --rm-dist --snapshot
goreleaser --rm-dist --snapshot
;;

"clients")
Expand Down