Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Prettify releases (#9)
Browse files Browse the repository at this point in the history
* Prettify releases

* Update readme
  • Loading branch information
danmx authored Mar 19, 2019
1 parent b8272e8 commit 46e6b35
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin/
dist/
6 changes: 3 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ steps:
- name: build-release
image: golang:1.12
commands:
- make build
- make release
environment:
REVISION: "${DRONE_COMMIT}"
VERSION: "${DRONE_TAG}"
Expand Down Expand Up @@ -71,13 +71,13 @@ steps:
- sha256
- sha512
files:
- "bin/release/*"
- "dist/*"
when:
event:
- tag

---
kind: signature
hmac: 901f0710cced99e0a6773ba2ad29e6bfaa825c20cb418a4b01262004c2212daf
hmac: 2820ac74026f750371398745d9e947db025b3a32dc5e0294bd99c339e281df1c

...
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ RUN dpkg -i session-manager-plugin.deb

FROM gcr.io/distroless/base:debug as debug
COPY --from=build /usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/local/bin/
COPY --from=build /go/src/app/bin/dev/sigil-linux /sigil
COPY --from=build /go/src/app/bin/dev/linux/amd64/sigil /sigil
ENTRYPOINT [ "/sigil" ]
CMD [ "--help" ]

FROM gcr.io/distroless/base as prod
COPY --from=build /usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/local/bin/
COPY --from=build /go/src/app/bin/release/sigil-linux /sigil
COPY --from=build /go/src/app/bin/release/linux/amd64/sigil /sigil
ENTRYPOINT [ "/sigil" ]
CMD [ "--help" ]
24 changes: 18 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,37 @@ build: bootstrap build-linux build-mac build-windows
.PHONY: build-dev
build: bootstrap build-linux-dev build-mac-dev build-windows-dev

.PHONY: release
release: build release-windows release-linux release-darwin

release-windows:
@mkdir -p dist && tar -czvf dist/$(NAME)_windows-amd64.tar.gz -C bin/release/windows/amd64/ $(NAME).exe

release-linux:
@mkdir -p dist && tar -czvf dist/$(NAME)_linux-amd64.tar.gz -C bin/release/linux/amd64/ $(NAME)

release-darwin:
@mkdir -p dist && tar -czvf dist/$(NAME)_darwin-amd64.tar.gz -C bin/release/darwin/amd64/ $(NAME)

build-windows: export GOARCH=amd64
build-windows:
@GOOS=windows go build -mod=vendor -v \
--ldflags="-w -X main.AppName=$(NAME) -X main.Version=$(VERSION) \
-X main.Revision=$(REVISION)" -o bin/release/$(NAME)-windows cmd/$(NAME)/main.go
-X main.Revision=$(REVISION)" -o bin/release/windows/amd64/$(NAME).exe cmd/$(NAME)/main.go

build-linux: export GOARCH=amd64
build-linux: export CGO_ENABLED=0
build-linux:
@GOOS=linux go build -mod=vendor -v \
--ldflags="-w -X main.AppName=$(NAME) -X main.Version=$(VERSION) \
-X main.Revision=$(REVISION)" -o bin/release/$(NAME)-linux cmd/$(NAME)/main.go
-X main.Revision=$(REVISION)" -o bin/release/linux/amd64/$(NAME) cmd/$(NAME)/main.go

build-mac: export GOARCH=amd64
build-mac: export CGO_ENABLED=0
build-mac:
@GOOS=darwin go build -mod=vendor -v \
--ldflags="-w -X main.AppName=$(NAME) -X main.Version=$(VERSION) \
-X main.Revision=$(REVISION)" -o bin/release/$(NAME)-darwin cmd/$(NAME)/main.go
-X main.Revision=$(REVISION)" -o bin/release/darwin/amd64/$(NAME) cmd/$(NAME)/main.go

build-docker:
@docker build --build-arg VER=$(VERSION) --build-arg REV=$(REVISION) -t $(NAME):$(VERSION) .
Expand All @@ -47,23 +59,23 @@ build-windows-dev:
@GOOS=windows go build -mod=vendor -v \
--ldflags="-w -X main.LogLevel=debug -X main.AppName=$(NAME) \
-X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/dev/$(NAME)-windows cmd/$(NAME)/main.go
-o bin/dev/windows/amd64/$(NAME).exe cmd/$(NAME)/main.go

build-linux-dev: export GOARCH=amd64
build-linux-dev: export CGO_ENABLED=0
build-linux-dev:
@GOOS=linux go build -mod=vendor -v \
--ldflags="-w -X main.LogLevel=debug -X main.AppName=$(NAME) \
-X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/dev/$(NAME)-linux cmd/$(NAME)/main.go
-o bin/dev/linux/amd64/$(NAME) cmd/$(NAME)/main.go

build-mac-dev: export GOARCH=amd64
build-mac-dev: export CGO_ENABLED=0
build-mac-dev:
@GOOS=darwin go build -mod=vendor -v \
--ldflags="-w -X main.LogLevel=debug -X main.AppName=$(NAME) \
-X main.Version=$(VERSION) -X main.Revision=$(REVISION)" \
-o bin/dev/$(NAME)-darwin cmd/$(NAME)/main.go
-o bin/dev/darwin/amd64/$(NAME) cmd/$(NAME)/main.go

.PHONY: get-version
get-version:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ make build-[linux|mac|windows|docker]

Binaries are located in:

- Linux: `dist/sigil-linux`
- Mac: `dist/sigil-darwin`
- Windows: `dist/sigil-windows`
- Linux: `bin/release/linux/amd64/sigil`
- Mac: `bin/release/darwin/amd64/sigil`
- Windows: `bin/release/darwin/amd64/sigil.exe`

### Docker

Expand All @@ -47,11 +47,11 @@ docker run --rm -it -v ${HOME}/.sigil:/home/.sigil -v ${HOME}/.aws:/home/.aws da
Binary:

```console
sigil-darwin -r eu-west-1 session --type instance-id --target i-xxxxxxxxxxxxxxxxx
sigil -r eu-west-1 session --type instance-id --target i-xxxxxxxxxxxxxxxxx
```

While using [aws-vault](https://github.com/99designs/aws-vault):

```console
aws-vault exec AWS_PROFILE -- sigil-darwin -r eu-west-1 session --type instance-id --target i-xxxxxxxxxxxxxxxxx
aws-vault exec AWS_PROFILE -- sigil -r eu-west-1 session --type instance-id --target i-xxxxxxxxxxxxxxxxx
```

0 comments on commit 46e6b35

Please sign in to comment.