Skip to content

Commit 4eeb7a2

Browse files
authored
release: v1.0.0-beta1 release fixes (#117)
This patch fixes a slew of broken things ranging from unsupported brew options to missing ldflags and S3 binary uploads. * Updates the Goreleaser image to Go 1.13.x * Updates the Goreleaser version itself to v0.123.3 * Removes the Brew section since we're not updating binaries via goreleaser renders the automatic brew formula generation unusable. * Adds missing BUILT ldflag to .goreleaser.yml * Modifies the goreleaser config so it doesn't upload artifacts GitHub or create a GitHub release at all * Corrects the v1.0.0-beta1.md release notes. * Updates `scripts/goreleaser` so that it uploads binaries and checksums to AWS S3, and publish the GitHub release via `hub`. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent 36d40be commit 4eeb7a2

File tree

6 files changed

+110
-174
lines changed

6 files changed

+110
-174
lines changed

.goreleaser.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,7 @@ release:
88
name: ecctl
99
name_template: '{{.Tag}}'
1010
draft: false
11-
brews:
12-
- github:
13-
owner: elastic
14-
name: homebrew-ecctl
15-
commit_author:
16-
name: elasticloudbot
17-
email: cloud-tooling@elastic.co
18-
homepage: "https://github.com/elastic/ecctl"
19-
description: Elastic Cloud Control, the official Elastic Cloud and ECE command line interface
20-
install: |
21-
bin.install "ecctl"
22-
system "#{bin}/ecctl", "generate", "completions", "-l", "#{var}/ecctl.auto"
23-
caveats: |
24-
If you have previously built ecctl from source, make sure you've removed that binary from any directory that has been added to your user $PATH.
25-
To enable autocompletion make sure to run `source <(ecctl generate completions)` and add it to your shell interpreter configuration file by running `echo "source <(ecctl generate completions)" >> ~/.bash_profile` or `echo "source <(ecctl generate completions)" >> ~/.zshrc` in case you are using ZSH.
26-
test: system "#{bin}/ecctl version"
27-
folder: Formula
11+
disable: true
2812
builds:
2913
- main: .
3014
env:
@@ -38,7 +22,7 @@ builds:
3822
ignore:
3923
- goos: darwin
4024
goarch: 386
41-
ldflags: -s -w -X main.version={{.Env.VERSION }} -X main.commit={{.Commit}} -X main.owner={{.Env.OWNER}} -X main.repo={{.Env.REPO}}
25+
ldflags: -s -w -X main.version={{.Env.VERSION }} -X main.commit={{.Commit}} -X main.owner={{.Env.OWNER}} -X main.repo={{.Env.REPO}} -X main.built={{.Env.BUILT}}
4226
binary: ecctl
4327
lang: go
4428
archives:
@@ -51,7 +35,7 @@ archives:
5135
snapshot:
5236
name_template: SNAPSHOT-{{ .Commit }}
5337
nfpms:
54-
- name_template: "{{ .ProjectName }}_{{ .Env.VERSION }}_{{ .Os }}_{{ .Arch }}"
38+
- file_name_template: "{{ .ProjectName }}_{{ .Env.VERSION }}_{{ .Os }}_{{ .Arch }}"
5539
license: Apache 2.0
5640
replacements:
5741
amd64: 64-bit
@@ -61,4 +45,4 @@ nfpms:
6145
- rpm
6246
checksum:
6347
name_template: '{{ .ProjectName }}_{{ .Env.VERSION }}_checksums.txt'
64-
dist: dist
48+
dist: dist

build/Dockerfile.goreleaser

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM golang:1.12-alpine
1+
FROM golang:1.13-alpine
22

33
RUN apk add --no-cache bash \
44
rpm \
55
git
66

7-
ENV GORELEASER_VERSION=v0.112.2
7+
ENV GORELEASER_VERSION=v0.123.3
88

99
RUN cd /tmp && wget https://github.com/goreleaser/goreleaser/releases/download/${GORELEASER_VERSION}/goreleaser_Linux_x86_64.tar.gz && \
1010
tar x -f goreleaser_Linux_x86_64.tar.gz && \

build/Makefile.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ BUILD_OUTPUT ?= "pkg/$(BINARY)_{{.OS}}_{{.Arch}}"
55
CURRENT_ARCH := $(shell uname -s | tr '[:upper:]' '[:lower:]')
66
export OWNER := elastic
77
export REPO := ecctl
8+
export BUILT := $(shell date -u +%a_%d_%b_%H:%M:%S_%Y)
89

910
DEFAULT_LDFLAGS ?= -X main.version=$(VERSION)-dev -X main.commit=$(shell git rev-parse HEAD) -X main.owner=$(OWNER) -X main.repo=$(REPO) -X main.built=$(shell date -u +%a_%d_%b_%H:%M:%S_%Y)
1011

@@ -44,8 +45,9 @@ release:
4445
ifneq ($(SKIP_TAG),true)
4546
@ $(MAKE) tag
4647
endif
47-
@ echo "-> Releasing $(BINARY) v$(VERSION)..."
48-
@ ./scripts/goreleaser release --rm-dist --release-notes=notes/$(VERSION).md
48+
@ echo "-> Releasing $(BINARY) $(VERSION)..."
49+
@ okta-awscli
50+
@ ./scripts/goreleaser release --skip-validate --rm-dist --release-notes=notes/$(VERSION).md
4951

5052
## Generates a changelog file in notes/$(VERSION) for the next release.
5153
changelog:

notes/v1.0.0-beta1.md

Lines changed: 85 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@
22

33
Release binaries can be downloaded with the following links:
44

5-
<https://download.elastic.co/downloads/ecctl/1.0.0-beta1/ecctl_1.0.0-beta1_darwin_amd64.tar.gz>
6-
7-
<https://download.elastic.co/downloads/ecctl/1.0.0-beta1/ecctl_1.0.0-beta1_linux_32-bit.deb>
8-
9-
<https://download.elastic.co/downloads/ecctl/1.0.0-beta1/ecctl_1.0.0-beta1_linux_32-bit.rpm>
10-
11-
<https://download.elastic.co/downloads/ecctl/1.0.0-beta1/ecctl_1.0.0-beta1_linux_386.tar.gz>
12-
13-
<https://download.elastic.co/downloads/ecctl/1.0.0-beta1/ecctl_1.0.0-beta1_linux_64-bit.deb>
14-
15-
<https://download.elastic.co/downloads/ecctl/1.0.0-beta1/ecctl_1.0.0-beta1_linux_64-bit.rpm>
16-
17-
<https://download.elastic.co/downloads/ecctl/1.0.0-beta1/ecctl_1.0.0-beta1_linux_amd64.tar.gz>
5+
<https://download.elastic.co/downloads/ecctl/v1.0.0-beta1/ecctl_v1.0.0-beta1_darwin_amd64.tar.gz>
6+
<https://download.elastic.co/downloads/ecctl/v1.0.0-beta1/ecctl_v1.0.0-beta1_linux_32-bit.deb>
7+
<https://download.elastic.co/downloads/ecctl/v1.0.0-beta1/ecctl_v1.0.0-beta1_linux_32-bit.rpm>
8+
<https://download.elastic.co/downloads/ecctl/v1.0.0-beta1/ecctl_v1.0.0-beta1_linux_386.tar.gz>
9+
<https://download.elastic.co/downloads/ecctl/v1.0.0-beta1/ecctl_v1.0.0-beta1_linux_64-bit.deb>
10+
<https://download.elastic.co/downloads/ecctl/v1.0.0-beta1/ecctl_v1.0.0-beta1_linux_64-bit.rpm>
11+
<https://download.elastic.co/downloads/ecctl/v1.0.0-beta1/ecctl_v1.0.0-beta1_linux_amd64.tar.gz>
1812

13+
Checksums can be found [here](https://download.elastic.co/downloads/ecctl/v1.0.0-beta1/ecctl_v1.0.0-beta1_checksums.txt)
1914

2015
## Breaking changes
2116
<!-- Add the list of breaking changes, remove otherwise.-->
@@ -24,12 +19,13 @@ Release binaries can be downloaded with the following links:
2419

2520
Removed all the plurals in ecctl and instead only kept the `ecctl <COMMAND> list` format. Commands removed
2621
by this change are:
27-
* allocators
28-
* constructors
29-
* enrollment-tokens
30-
* proxies
31-
* stacks
32-
* filtered-groups
22+
23+
* allocators
24+
* constructors
25+
* enrollment-tokens
26+
* proxies
27+
* stacks
28+
* filtered-groups
3329

3430
### Removed deployment elasticsearch create command
3531

@@ -151,132 +147,73 @@ The command now works as expected.
151147
### Detailed changes
152148
<!-- AUTOGENERATED COMMIT LIST -->
153149

154-
97c3985 Adding ecctl icon to repo (#111)
155-
156-
a752cec Fix command wording (#108)
157-
158-
5939798 stack: Skip returning an error on packed __MACOSX (#105)
159-
160-
0f5a632 elasticsearch: Fix broken diagnostics command (#110)
161-
162-
4945fbb cmd: Add default region to APM and Kibana create (#109)
163-
164-
398bf99 cmd: Remove newer version check on ecctl version (#103)
165-
166-
4fcde59 Add auto completion intruction to docs (#101)
167-
168-
f3d653a user: Fix key show command (#106)
169-
170-
f8eb428 Convert command reference files to Asciidoctor (#61)
171-
172-
997c7e2 fix refid discovery and require confirmation (#104)
173-
174-
99b8d28 Update ecctl-getting-started.asciidoc (#102)
175-
176-
0b30073 Add timeout values to ecctl.Config (#100)
177-
178-
35bcb95 dep: update cloud-sdk-go to v1.0.0-bc9 (#98)
179-
180-
67baf3d go.sum: Update hashes to the latest version (#97)
181-
182-
ce54eda cmd: Add ref-id auto-discovery to resource upgrade (#92)
183-
184-
f3d09b3 cmd: update resource params to use common struct (#96)
185-
186-
7c2be04 cmd: Add deployment resource delete command (#88)
187-
188-
bd7c910 Version: Change to v1.0.0-beta1 (#94)
189-
190-
1579791 cmd: Add deployment resource restore command (#87)
191-
192-
706b480 cmd: add deployment resource start/start-maintenance commands (#89)
193-
194-
033f06d cmd: Add deployment resource stop and stop-maintenance cmds (#81)
195-
196-
d2c27b5 cmd: Add deployment resource shutdown command (#86)
197-
198-
dbad10d cmd: Remove elasticsearch create (#93)
199-
200-
d4ee664 build(deps): bump github.com/go-openapi/runtime from 0.19.8 to 0.19.9 (#85)
201-
202-
c56296c build(deps): bump github.com/go-openapi/strfmt from 0.19.3 to 0.19.4 (#84)
203-
204-
e642e41 cmd: Add --track flag to deployment commands (#80)
205-
206-
c66d3bf cmd: Migrate apm create to deployments API (#79)
207-
208-
bd75994 Support vacate override failsafe (#82)
209-
210-
73c0fac cmd: Add deployment resource upgrade command (#76)
211-
212-
d1409c8 build(deps): bump github.com/spf13/viper from 1.5.0 to 1.6.1 (#75)
213-
214-
aaa5d87 cmd: Migrate kibana create to deployments API (#71)
215-
216-
88c7938 cmd: Add deployment plan cancel (#72)
217-
218-
520dbf8 docs: Remove tap pin step from brew instructions (#70)
219-
220-
ea03569 cmd: Move elasticsearch create to deployment API (#67)
221-
222-
ce9bbdd Remove ErrCatchTransport from default http client (#66)
223-
224-
a318a5f cmd: Fix init command on unexisting .ecctl folder (#64)
225-
226-
8dcfa6e deployment: Fix show resource type command (#57)
227-
228-
841ddef elasticsearch: Add keystore management commands (#58)
229-
230-
72fc278 http: Add api.DefaultTransport in http.Client (#59)
231-
232-
21176cd deployment: Add update command (#55)
233-
234-
143ffe5 init: Remove mentions of ESS in config bootstrap (#54)
235-
236-
c0ae026 docs: Remove region mentions (#50)
237-
238-
7d63ff8 version: Extend output to include ECE API Version (#53)
239-
240-
8d72808 init: Ensure homepath is created (#51)
241-
242-
a4eb0ac docs: Change the term Kibana Cluster to instance (#49)
243-
244-
78dd825 go.mod: Update cloud-sdk-go to version v1.0.0-bc4 (#48)
245-
246-
7ba34cc remove plural aliases and update docs (#47)
247-
248-
d05811e init: Skips TLS validation on API calls (#39)
249-
250-
1bd7726 deployment: Add restore command (#38)
251-
252-
b32c889 deployment: Add create command (#36)
253-
254-
f1c5258 deployment: Add delete command (#35)
255-
256-
912f410 build(deps): bump github.com/spf13/viper from 1.4.0 to 1.5.0 (#24)
257-
258-
93444fd build(deps): bump github.com/go-openapi/runtime from 0.19.7 to 0.19.8 (#33)
259-
260-
fb7681b deployment: Add search command (#34)
261-
262-
ee092c6 deployment: Add shutdown command (#32)
263-
264-
a01959c deployment: Add list command (#30)
265-
266-
df2d729 Add CONTIBUTING note about GitHub Actions in Forks (#29)
267-
268-
eade2fb Bump Go version to 1.13 (#31)
269-
270-
3a3c81f Beta doc updates (#23)
271-
272-
d994fa4 Improve user documentation (#22)
273-
274-
7d10b3e trivial: fixes various typos (#19)
275-
276-
ad77c57 trivial: bump golanci version to 1.21 (#20)
277-
278-
ddafa35 ci: run go build action in PRs (#21)
279-
280-
3b1b1ef Convert the ecctl docs to Asciidoctor (#7)
281-
282-
0472113 ci: remove uneccesary gh info (#16)
150+
* 36d40be cmd: Fix deployment notes (#114)
151+
* 772b255 deployments: Change refID defaults to use 'main-' prefix (#118)
152+
* f363be6 cmd: Fix deployment create typo (#115)
153+
* 510e829 cmd: Use force flag with instance override (#113)
154+
* 3c20f53 notes: Generate changelog for v1.0.0-beta1 release (#112)
155+
* 97c3985 Adding ecctl icon to repo (#111)
156+
* a752cec Fix command wording (#108)
157+
* 5939798 stack: Skip returning an error on packed __MACOSX (#105)
158+
* 0f5a632 elasticsearch: Fix broken diagnostics command (#110)
159+
* 4945fbb cmd: Add default region to APM and Kibana create (#109)
160+
* 398bf99 cmd: Remove newer version check on ecctl version (#103)
161+
* 4fcde59 Add auto completion intruction to docs (#101)
162+
* f3d653a user: Fix key show command (#106)
163+
* f8eb428 Convert command reference files to Asciidoctor (#61)
164+
* 997c7e2 fix refid discovery and require confirmation (#104)
165+
* 99b8d28 Update ecctl-getting-started.asciidoc (#102)
166+
* 0b30073 Add timeout values to ecctl.Config (#100)
167+
* 35bcb95 dep: update cloud-sdk-go to v1.0.0-bc9 (#98)
168+
* 67baf3d go.sum: Update hashes to the latest version (#97)
169+
* ce54eda cmd: Add ref-id auto-discovery to resource upgrade (#92)
170+
* f3d09b3 cmd: update resource params to use common struct (#96)
171+
* 7c2be04 cmd: Add deployment resource delete command (#88)
172+
* bd7c910 Version: Change to v1.0.0-beta1 (#94)
173+
* 1579791 cmd: Add deployment resource restore command (#87)
174+
* 706b480 cmd: add deployment resource start/start-maintenance commands (#89)
175+
* 033f06d cmd: Add deployment resource stop and stop-maintenance cmds (#81)
176+
* d2c27b5 cmd: Add deployment resource shutdown command (#86)
177+
* dbad10d cmd: Remove elasticsearch create (#93)
178+
* d4ee664 build(deps): bump github.com/go-openapi/runtime from 0.19.8 to 0.19.9 (#85)
179+
* c56296c build(deps): bump github.com/go-openapi/strfmt from 0.19.3 to 0.19.4 (#84)
180+
* e642e41 cmd: Add --track flag to deployment commands (#80)
181+
* c66d3bf cmd: Migrate apm create to deployments API (#79)
182+
* bd75994 Support vacate override failsafe (#82)
183+
* 73c0fac cmd: Add deployment resource upgrade command (#76)
184+
* d1409c8 build(deps): bump github.com/spf13/viper from 1.5.0 to 1.6.1 (#75)
185+
* aaa5d87 cmd: Migrate kibana create to deployments API (#71)
186+
* 88c7938 cmd: Add deployment plan cancel (#72)
187+
* 520dbf8 docs: Remove tap pin step from brew instructions (#70)
188+
* ea03569 cmd: Move elasticsearch create to deployment API (#67)
189+
* ce9bbdd Remove ErrCatchTransport from default http client (#66)
190+
* a318a5f cmd: Fix init command on unexisting .ecctl folder (#64)
191+
* 8dcfa6e deployment: Fix show resource type command (#57)
192+
* 841ddef elasticsearch: Add keystore management commands (#58)
193+
* 72fc278 http: Add api.DefaultTransport in http.Client (#59)
194+
* 21176cd deployment: Add update command (#55)
195+
* 143ffe5 init: Remove mentions of ESS in config bootstrap (#54)
196+
* c0ae026 docs: Remove region mentions (#50)
197+
* 7d63ff8 version: Extend output to include ECE API Version (#53)
198+
* 8d72808 init: Ensure homepath is created (#51)
199+
* a4eb0ac docs: Change the term Kibana Cluster to instance (#49)
200+
* 78dd825 go.mod: Update cloud-sdk-go to version v1.0.0-bc4 (#48)
201+
* 7ba34cc remove plural aliases and update docs (#47)
202+
* d05811e init: Skips TLS validation on API calls (#39)
203+
* 1bd7726 deployment: Add restore command (#38)
204+
* b32c889 deployment: Add create command (#36)
205+
* f1c5258 deployment: Add delete command (#35)
206+
* 912f410 build(deps): bump github.com/spf13/viper from 1.4.0 to 1.5.0 (#24)
207+
* 93444fd build(deps): bump github.com/go-openapi/runtime from 0.19.7 to 0.19.8 (#33)
208+
* fb7681b deployment: Add search command (#34)
209+
* ee092c6 deployment: Add shutdown command (#32)
210+
* a01959c deployment: Add list command (#30)
211+
* df2d729 Add CONTIBUTING note about GitHub Actions in Forks (#29)
212+
* eade2fb Bump Go version to 1.13 (#31)
213+
* 3a3c81f Beta doc updates (#23)
214+
* d994fa4 Improve user documentation (#22)
215+
* 7d10b3e trivial: fixes various typos (#19)
216+
* ad77c57 trivial: bump golanci version to 1.21 (#20)
217+
* ddafa35 ci: run go build action in PRs (#21)
218+
* 3b1b1ef Convert the ecctl docs to Asciidoctor (#7)
219+
* 0472113 ci: remove uneccesary gh info (#16)

scripts/generate-changelog.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ read -p "=> Previous release was ${PREV_TAG}, is that correct? " -n 1 -r
1717
if [[ ${REPLY} =~ ^[Yy]$ ]]; then
1818
echo ""
1919
cp scripts/changelog.tpl.md ${CHANGELOGFILE}
20-
git -c log.showSignature=false log --pretty=oneline --abbrev-commit --no-decorate --no-color tags/${PREV_TAG}...master >> ${CHANGELOGFILE}
20+
git -c log.showSignature=false log --pretty="* %h %s" --no-decorate --no-color tags/${PREV_TAG}...master >> ${CHANGELOGFILE}
2121

2222
echo "=> Changelog generated."
2323
VISUAL="${VISUAL:-"${EDITOR:-vim}"}"

scripts/goreleaser

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ OWNER_VAR_CANNOT_BE_EMPTY="OWNER environment variable must be populated"
88
REPO_VAR_CANNOT_BE_EMPTY="REPO environment variable must be populated"
99
GITHUB_TOKEN_VAR_CANNOT_BE_EMPTY="GITHUB_TOKEN environment variable must be populated"
1010
VERSION_VAR_CANNOT_BE_EMPTY="VERSION environment variable must be populated"
11+
BUILT_VAR_CANNOT_BE_EMPTY="BUILT environment variable must be populated"
1112
ERROR=false
1213

1314
if [[ -z ${OWNER} ]]; then echo "${OWNER_VAR_CANNOT_BE_EMPTY}"; ERROR=true; fi
1415
if [[ -z ${REPO} ]]; then echo "${REPO_VAR_CANNOT_BE_EMPTY}"; ERROR=true; fi
1516
if [[ -z ${GITHUB_TOKEN} ]]; then echo "${GITHUB_TOKEN_VAR_CANNOT_BE_EMPTY}"; ERROR=true; fi
1617
if [[ -z ${VERSION} ]]; then echo "${VERSION_VAR_CANNOT_BE_EMPTY}"; ERROR=true; fi
18+
if [[ -z ${BUILT} ]]; then echo "${BUILT_VAR_CANNOT_BE_EMPTY}"; ERROR=true; fi
1719

1820
if ${ERROR}; then exit 1; fi
1921

@@ -22,6 +24,17 @@ docker build -f ./build/Dockerfile.goreleaser -t ecctl:goreleaser .
2224
docker run --rm -ti --privileged \
2325
-e OWNER="${OWNER}" -e REPO="${REPO}" -e GO111MODULE=on \
2426
-e GITHUB_TOKEN="${GITHUB_TOKEN}" -e VERSION="${VERSION}" \
25-
-v "$GOPATH:/go" \
27+
-e BUILT="${BUILT}" -v "$GOPATH:/go" \
2628
-v "$(pwd):/go/src/github.com/${OWNER}/${REPO}" \
2729
-w "/go/src/github.com/${OWNER}/${REPO}" ecctl:goreleaser ${*}
30+
31+
# Upload the binaries and the checksums.
32+
for f in dist/*.{tar.gz,deb,rpm,txt}; do
33+
aws --profile ecsecurity s3 cp --acl bucket-owner-full-control \
34+
${f} s3://download.elasticsearch.org/downloads/ecctl/${VERSION}/
35+
done
36+
37+
# Create the actual Github Release.
38+
hub release create -F notes/${VERSION}.md -m ${VERSION}
39+
40+
echo "-> Please update the brew formula https://github.com/elastic/homebrew-ecctl with the new version and checksums"

0 commit comments

Comments
 (0)