diff --git a/.goreleaser.yml b/.goreleaser.yml index a242431f79..6e89428560 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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: @@ -15,7 +20,7 @@ archives: - LICENSE - README.md - CHANGELOG.md - - ./config/migrations/*/** + - ./config/migrations/ - ./config/default.yml checksum: @@ -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 }}" @@ -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 \ No newline at end of file diff --git a/Brewfile b/Brewfile index f60d6f44a7..87289f2455 100644 --- a/Brewfile +++ b/Brewfile @@ -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' diff --git a/build/Dockerfile b/build/Dockerfile index 84a4d20835..5dd08e8056 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -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="mark.aaron.phelps@gmail.com" LABEL org.opencontainers.image.name="flipt" LABEL org.opencontainers.image.source="https://github.com/markphelps/flipt" @@ -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"] diff --git a/script/build b/script/build index 8440f0ed00..f26f8db234 100755 --- a/script/build +++ b/script/build @@ -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")