Skip to content

Commit

Permalink
Release v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
everesio committed Apr 29, 2020
1 parent ad6df0a commit 785f346
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
dist: dist
builds:
- main: ./main.go
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
ldflags:
- -w -s
archives:
- name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
wrap_in_directory: false
files:
- LICENSE
checksum:
name_template: 'CHECKSUM'
release:
github:
owner: grepplabs
name: rabbitmq-mv
draft: false
prerelease: auto
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ ARG GOARCH=amd64
WORKDIR "/code"
ADD . "/code"
RUN make BINARY=rabbitmq-mv GOOS=${GOOS} GOARCH=${GOARCH} os.build

FROM alpine:3.11
COPY --from=builder /code/rabbitmq-mv /rabbitmq-mv
ENTRYPOINT ["/rabbitmq-mv"]
ENTRYPOINT ["/rabbitmq-mv"]
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

.PHONY: clean build fmt test

TAG ?= "v0.0.1"

BUILD_FLAGS ?=
BINARY ?= rabbitmq-mv
VERSION ?= $(shell git describe --tags --always --dirty)
Expand All @@ -13,6 +15,8 @@ GOOS ?= linux
LOCAL_IMAGE ?= local/$(GOOS)-$(GOARCH)/$(BINARY)
LOCAL_BIN ?= $(BINARY)-$(GOOS)-$(GOARCH)

CLOUD_IMAGE ?= grepplabs/rabbitmq-mv:$(TAG)

ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

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

.PHONY: docker.push
docker.push:
docker build -f Dockerfile -t $(LOCAL_IMAGE) .
docker tag $(LOCAL_IMAGE) $(CLOUD_IMAGE)
docker push $(CLOUD_IMAGE)

.PHONY: build.os
build.os: clean docker.copy

Expand Down Expand Up @@ -79,3 +89,20 @@ vendor:
tidy:
GO111MODULE=on go mod tidy

.PHONY: tag
tag:
git tag $(TAG)

.PHONY: release.setup
release.setup:
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh

.PHONY: release.skip-publish
release.skip-publish: release.setup
$(ROOT_DIR)/bin/goreleaser release --rm-dist --skip-publish --snapshot

.PHONY: release.publish
release.publish: release.setup
@[ "${GITHUB_TOKEN}" ] && echo "releasing $(TAG)" || ( echo "GITHUB_TOKEN is not set"; exit 1 )
git push origin $(TAG)
$(ROOT_DIR)/bin/goreleaser release --rm-dist
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

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

## Install binary release

1. Download the latest release

Linux

curl -Ls https://github.com/grepplabs/rabbitmq-mv/releases/download/v0.0.1/rabbitmq-mv-v0.0.1-linux-amd64.tar.gz | tar xz

macOS

curl -Ls https://github.com/grepplabs/rabbitmq-mv/releases/download/v0.0.1/rabbitmq-mv-v0.0.1-darwin-amd64.tar.gz | tar xz

windows

curl -Ls https://github.com/grepplabs/rabbitmq-mv/releases/download/v0.0.1/rabbitmq-mv-v0.0.1-windows-amd64.tar.gz | tar xz

2. Move the binary in to your PATH.

```
sudo mv ./rabbitmq-mv /usr/local/bin/rabbitmq-mv
```
## Build binary
Expand Down Expand Up @@ -35,7 +56,9 @@ rabbitmq-mv is a utility to move messages from one rabbitmq queue to another one
Use producer transactions (slow)
## Docker
docker run -it --rm grepplabs/rabbitmq-mv:v0.0.1 -help
## Usage examples
Expand Down

0 comments on commit 785f346

Please sign in to comment.