Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bin
outputs
dist/
37 changes: 37 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This is an example .goreleaser.yml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
env:
- GO111MODULE=on

before:
hooks:
- go mod download
- go install github.com/gobuffalo/packr/v2/packr2
- cd cli && packr2

builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cli/main.go
binary: op
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Get current directory of a Makefile: https://stackoverflow.com/a/23324703

# Builds cli for all supported platforms
.PHONY: build
build:
goreleaser --snapshot --skip-publish --rm-dist

.PHONY: clean
clean: clean-workspace clean-docker

Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ This repository contains:
- Redis
- vSphere

## Building

This project utilizes `goreleaser` to build the cli binaries for all supported
platforms. Please see [goreleaser installation](https://goreleaser.com/install/)
for instructions on making that available to you.

Once `goreleaser` is installed building the cli is as follows:

```
$ make build
```

This will put the built distribution inside of `dist` in the current working directory.

## Contributing

### pre-commit
Expand Down
1 change: 1 addition & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
op
.github
packrd
10 changes: 0 additions & 10 deletions cli/Building.md

This file was deleted.

15 changes: 0 additions & 15 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,8 @@ ROOT_DIR:=$(CURDIR)
include ../commons.mk

TEST_TIMEOUT?=5m

GO_IMAGE?='golang'
GO_VERSION='$(shell cat ../.go-version )'
GO_IMAGE_TAG?='stretch'
GOOS?='linux'
GOARCH?='amd64'
LOG_LEVEL?=INFO

.PHONY: build
build:
docker run --rm \
-v $(ROOT_DIR):/go/src/github.com/elastic/e2e-testing/cli \
-w /go/src/github.com/elastic/e2e-testing/cli \
-e TARGET_OS=$(GOOS) -e TARGET_ARCH=$(GOARCH) -e GO111MODULE=on \
$(GO_IMAGE):$(GO_VERSION)-$(GO_IMAGE_TAG) \
scripts/build-cli.sh

.PHONY: install
install:
go get -v -t ./...
Expand Down
64 changes: 0 additions & 64 deletions cli/scripts/build-cli.sh

This file was deleted.