forked from sorintlab/stolon
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use goreleaser to publish GC releases
While we work on stolon, it will be important for us to use pre-release candidates of our own changes. This commit adds goreleaser to automatically create these on our own forks build.
- Loading branch information
1 parent
0ac3839
commit 2681361
Showing
6 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ bin/ | |
/release/ | ||
|
||
.idea | ||
|
||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
################################################################################ | ||
# build | ||
################################################################################ | ||
|
||
FROM golang:1.12 AS build | ||
COPY . /go/src/github.com/sorintlab/stolon | ||
WORKDIR /go/src/github.com/sorintlab/stolon | ||
|
||
# If we're running goreleaser, then our binaries will already be copied into our | ||
# work directory. Otherwise we should build them. | ||
RUN set -x \ | ||
&& \ | ||
if [ ! -f stolonctl ]; then \ | ||
./build; \ | ||
mv -v bin/* ./; \ | ||
fi | ||
|
||
################################################################################ | ||
# release | ||
################################################################################ | ||
|
||
FROM ubuntu:18.04 AS release | ||
RUN set -x \ | ||
&& apt-get update -y \ | ||
&& apt-get install -y curl gpg \ | ||
&& sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main\ndeb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg 11" > /etc/apt/sources.list.d/pgdg.list' \ | ||
&& curl --silent https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ | ||
&& apt-get update -y \ | ||
&& apt-get install -y software-properties-common pgbouncer postgresql-client \ | ||
&& mkdir -pv /var/run/postgresql /var/log/postgresql | ||
|
||
COPY --from=build /go/src/github.com/sorintlab/stolon/stolon* /usr/local/bin/ | ||
USER postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.13.0-gc-rc1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
version: 2 | ||
|
||
jobs: | ||
release: | ||
working_directory: /go/src/github.com/sorintlab/stolon | ||
docker: | ||
- image: golang:1.12 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Release | ||
command: | | ||
CURRENT_VERSION="v$(cat VERSION)" | ||
if [[ $(git tag -l "${CURRENT_VERSION}") == "${CURRENT_VERSION}" ]]; then | ||
echo "Version ${CURRENT_VERSION} is already released" | ||
exit 0 | ||
fi | ||
curl -L -o /tmp/goreleaser_Linux_x86_64.tar.gz https://github.com/goreleaser/goreleaser/releases/download/v0.106.0/goreleaser_Linux_x86_64.tar.gz | ||
tar zxf /tmp/goreleaser_Linux_x86_64.tar.gz -C /tmp | ||
git tag "${CURRENT_VERSION}" | ||
git push --tags | ||
/tmp/goreleaser --rm-dist | ||
workflows: | ||
version: 2 | ||
build-integration: | ||
jobs: | ||
- release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# View goreleaser docs for configuration settings | ||
# https://goreleaser.com | ||
|
||
--- | ||
project_name: stolon | ||
|
||
release: | ||
github: | ||
owner: gocardless | ||
name: stolon | ||
|
||
builds: | ||
- binary: stolonctl | ||
main: cmd/stolonctl/main.go | ||
goos: &goos | ||
- linux | ||
goarch: &goarch | ||
- amd64 | ||
ldflags: &ldflags > | ||
-X cmd.Version={{.Version}} | ||
-X cmd.Commit={{.Commit}} | ||
-X cmd.Date={{.Date}} | ||
-a | ||
-installsuffix cgo | ||
env: &env | ||
- CGO_ENABLED=0 | ||
- binary: stolon-keeper | ||
main: cmd/keeper/main.go | ||
goos: *goos | ||
goarch: *goarch | ||
ldflags: *ldflags | ||
env: *env | ||
- binary: stolon-proxy | ||
main: cmd/proxy/main.go | ||
goos: *goos | ||
goarch: *goarch | ||
ldflags: *ldflags | ||
env: *env | ||
- binary: stolon-sentinel | ||
main: cmd/sentinel/main.go | ||
goos: *goos | ||
goarch: *goarch | ||
ldflags: *ldflags | ||
env: *env |