Skip to content

Commit 785f346

Browse files
committed
Release v0.0.1
1 parent ad6df0a commit 785f346

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

.goreleaser.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
dist: dist
2+
builds:
3+
- main: ./main.go
4+
env:
5+
- CGO_ENABLED=0
6+
goos:
7+
- linux
8+
- darwin
9+
- windows
10+
goarch:
11+
- amd64
12+
ldflags:
13+
- -w -s
14+
archives:
15+
- name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
16+
wrap_in_directory: false
17+
files:
18+
- LICENSE
19+
checksum:
20+
name_template: 'CHECKSUM'
21+
release:
22+
github:
23+
owner: grepplabs
24+
name: rabbitmq-mv
25+
draft: false
26+
prerelease: auto

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ ARG GOARCH=amd64
66
WORKDIR "/code"
77
ADD . "/code"
88
RUN make BINARY=rabbitmq-mv GOOS=${GOOS} GOARCH=${GOARCH} os.build
9+
10+
FROM alpine:3.11
911
COPY --from=builder /code/rabbitmq-mv /rabbitmq-mv
10-
ENTRYPOINT ["/rabbitmq-mv"]
12+
ENTRYPOINT ["/rabbitmq-mv"]

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
.PHONY: clean build fmt test
44

5+
TAG ?= "v0.0.1"
6+
57
BUILD_FLAGS ?=
68
BINARY ?= rabbitmq-mv
79
VERSION ?= $(shell git describe --tags --always --dirty)
@@ -13,6 +15,8 @@ GOOS ?= linux
1315
LOCAL_IMAGE ?= local/$(GOOS)-$(GOARCH)/$(BINARY)
1416
LOCAL_BIN ?= $(BINARY)-$(GOOS)-$(GOARCH)
1517

18+
CLOUD_IMAGE ?= grepplabs/rabbitmq-mv:$(TAG)
19+
1620
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
1721

1822
default: build
@@ -39,6 +43,12 @@ docker.copy: docker.build
3943
$(eval RESULT=$(shell sh -c "docker rmi $(LOCAL_IMAGE)"))
4044
echo "Binary copied to local directory"
4145

46+
.PHONY: docker.push
47+
docker.push:
48+
docker build -f Dockerfile -t $(LOCAL_IMAGE) .
49+
docker tag $(LOCAL_IMAGE) $(CLOUD_IMAGE)
50+
docker push $(CLOUD_IMAGE)
51+
4252
.PHONY: build.os
4353
build.os: clean docker.copy
4454

@@ -79,3 +89,20 @@ vendor:
7989
tidy:
8090
GO111MODULE=on go mod tidy
8191

92+
.PHONY: tag
93+
tag:
94+
git tag $(TAG)
95+
96+
.PHONY: release.setup
97+
release.setup:
98+
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
99+
100+
.PHONY: release.skip-publish
101+
release.skip-publish: release.setup
102+
$(ROOT_DIR)/bin/goreleaser release --rm-dist --skip-publish --snapshot
103+
104+
.PHONY: release.publish
105+
release.publish: release.setup
106+
@[ "${GITHUB_TOKEN}" ] && echo "releasing $(TAG)" || ( echo "GITHUB_TOKEN is not set"; exit 1 )
107+
git push origin $(TAG)
108+
$(ROOT_DIR)/bin/goreleaser release --rm-dist

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@
22

33
rabbitmq-mv is a utility to move messages from one rabbitmq queue to another one.
44

5+
## Install binary release
6+
7+
1. Download the latest release
8+
9+
Linux
10+
11+
curl -Ls https://github.com/grepplabs/rabbitmq-mv/releases/download/v0.0.1/rabbitmq-mv-v0.0.1-linux-amd64.tar.gz | tar xz
12+
13+
macOS
14+
15+
curl -Ls https://github.com/grepplabs/rabbitmq-mv/releases/download/v0.0.1/rabbitmq-mv-v0.0.1-darwin-amd64.tar.gz | tar xz
16+
17+
windows
18+
19+
curl -Ls https://github.com/grepplabs/rabbitmq-mv/releases/download/v0.0.1/rabbitmq-mv-v0.0.1-windows-amd64.tar.gz | tar xz
20+
21+
2. Move the binary in to your PATH.
22+
23+
```
24+
sudo mv ./rabbitmq-mv /usr/local/bin/rabbitmq-mv
25+
```
526
627
## Build binary
728
@@ -35,7 +56,9 @@ rabbitmq-mv is a utility to move messages from one rabbitmq queue to another one
3556
Use producer transactions (slow)
3657
3758
59+
## Docker
3860
61+
docker run -it --rm grepplabs/rabbitmq-mv:v0.0.1 -help
3962
4063
## Usage examples
4164

0 commit comments

Comments
 (0)