Skip to content

Commit 1f7afbb

Browse files
committed
changelog is no longer generated to be committed, and installation doc
have been updated to remove version string dependency
1 parent b11186c commit 1f7afbb

File tree

7 files changed

+71
-1163
lines changed

7 files changed

+71
-1163
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/build
66
/dist
77
/tools/bin
8+
/changelog/generated
89

910
# Website
1011
website/public/

.goreleaser.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1+
# Global environment variables for builds.
2+
env:
3+
- CGO_ENABLED=0
4+
- GO111MODULE=on
5+
- REPO=github.com/operator-framework/operator-sdk
6+
7+
# Hooks to run before any build is run.
18
before:
29
hooks:
310
- go version | grep --quiet "go1\.15\.2" || echo "Go binary version must be 1.15.2"
411
- go mod download
12+
13+
# Binary builds.
514
builds:
15+
# operator-sdk build steps
616
- id: operator-sdk
717
main: ./cmd/operator-sdk
818
binary: operator-sdk
9-
env:
10-
- CGO_ENABLED=0
11-
- GO111MODULE=on
12-
- REPO=github.com/operator-framework/operator-sdk
1319
mod_timestamp: "{{ .CommitTimestamp }}"
1420
asmflags:
15-
- all=-trimpath={{ dir .ArtifactPath | dir | dir | dir }}
21+
- all=-trimpath={{ .Env.PWD }}
1622
gcflags:
17-
- all=-trimpath={{ dir .ArtifactPath | dir | dir | dir }}
23+
- all=-trimpath={{ .Env.PWD }}
1824
ldflags:
1925
- -X {{ .Env.REPO }}/internal/version.Version={{ if not .IsSnapshot }}v{{ end }}{{ .Version }}
2026
- -X {{ .Env.REPO }}/internal/version.GitVersion={{ .Tag }}
@@ -40,15 +46,11 @@ builds:
4046
- id: ansible-operator
4147
main: ./cmd/ansible-operator
4248
binary: ansible-operator
43-
env:
44-
- CGO_ENABLED=0
45-
- GO111MODULE=on
46-
- REPO=github.com/operator-framework/operator-sdk
4749
mod_timestamp: "{{ .CommitTimestamp }}"
4850
asmflags:
49-
- all=-trimpath={{ dir .ArtifactPath | dir | dir | dir }}
51+
- all=-trimpath={{ .Env.PWD }}
5052
gcflags:
51-
- all=-trimpath={{ dir .ArtifactPath | dir | dir | dir }}
53+
- all=-trimpath={{ .Env.PWD }}
5254
ldflags:
5355
- -X {{ .Env.REPO }}/internal/version.Version={{ if not .IsSnapshot }}v{{ end }}{{ .Version }}
5456
- -X {{ .Env.REPO }}/internal/version.GitVersion={{ .Tag }}
@@ -74,15 +76,11 @@ builds:
7476
- id: helm-operator
7577
main: ./cmd/helm-operator
7678
binary: helm-operator
77-
env:
78-
- CGO_ENABLED=0
79-
- GO111MODULE=on
80-
- REPO=github.com/operator-framework/operator-sdk
8179
mod_timestamp: "{{ .CommitTimestamp }}"
8280
asmflags:
83-
- all=-trimpath={{ dir .ArtifactPath | dir | dir | dir }}
81+
- all=-trimpath={{ .Env.PWD }}
8482
gcflags:
85-
- all=-trimpath={{ dir .ArtifactPath | dir | dir | dir }}
83+
- all=-trimpath={{ .Env.PWD }}
8684
ldflags:
8785
- -X {{ .Env.REPO }}/internal/version.Version={{ if not .IsSnapshot }}v{{ end }}{{ .Version }}
8886
- -X {{ .Env.REPO }}/internal/version.GitVersion={{ .Tag }}
@@ -111,9 +109,10 @@ snapshot:
111109
# We don't use archives, so skip creating them.
112110
archives:
113111
- format: binary
112+
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
114113

115114
checksum:
116-
name_template: 'checksums.txt'
115+
name_template: "checksums.txt"
117116

118117
# Sign checksum files with the local default PGP key.
119118
# TODO(estroz): configure CI PGP key

CHANGELOG.md

Lines changed: 0 additions & 1081 deletions
This file was deleted.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ test-e2e-integration:: ## Run integration tests
145145
./hack/tests/integration.sh
146146
./hack/tests/subcommand-olm-install.sh
147147

148+
.PHONY: release
149+
release: ## Release the Operator SDK
150+
@rm -rf dist/
151+
$(MAKE) -f release/Makefile GO_BUILD_ARGS='$(GO_BUILD_ARGS)'
152+
148153
.DEFAULT_GOAL := help
149154
.PHONY: help
150155
help: ## Show this help screen.

release/Makefile

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
SHELL = /bin/bash
55
.SHELLFLAGS = -O extglob -c
66

7-
GIT_VERSION = $(shell git describe --dirty --always --tags)
7+
# Repo prefix for image tags.
8+
IMAGE_REPO ?= quay.io/operator-framework
9+
10+
# Dry run flags.
811
ifneq ($(DRY_RUN),)
912
SNAPSHOT_FLAGS = --snapshot --skip-publish --rm-dist
1013
TAG ?= $(GIT_VERSION)
@@ -20,34 +23,37 @@ all: release
2023

2124
.PHONY: check_tag
2225
check_tag:
23-
ifeq ($(TAG),)
26+
ifeq (,$(TAG))
2427
$(error "TAG must be set to a release tag")
2528
endif
2629

30+
.PHONY: check_k8s_version
31+
check_k8s_version:
32+
ifeq (,$(K8S_VERSION))
33+
$(error "K8S_VERSION must be set to a Kubernetes release version")
34+
endif
35+
36+
.PHONY: release
37+
TOOLS_DIR ?= tools/bin
38+
SCRIPTS_DIR ?= tools/scripts
39+
release: check_tag check_k8s_version changelog ## Release all operator-sdk binaries with notes. $TAG must be explicitly set to avoid ambiguity.
40+
$(SCRIPTS_DIR)/fetch goreleaser
41+
GORELEASER_CURRENT_TAG=$(TAG) K8S_VERSION=$(K8S_VERSION) $(TOOLS_DIR)/goreleaser $(SNAPSHOT_FLAGS) --release-notes=changelog/generated/$(TAG).md --parallelism 5
42+
2743
.PHONY: changelog
2844
changelog: check_tag ## Generate the changelog.
29-
mkdir -p changelog/generated
45+
@mkdir -p changelog/generated
3046
go run ./release/changelog/gen-changelog.go -tag=$(TAG) -changelog=changelog/generated/$(TAG).md
3147
ifeq ($(DRY_RUN),)
3248
rm -f ./changelog/fragments/!(00-template.yaml)
3349
endif
3450

35-
.PHONY: release
36-
K8S_VERSION = v1.18.2
37-
release: check_tag goreleaser ## Release all operator-sdk binaries with notes. $TAG must be explicitly set to avoid ambiguity.
38-
GORELEASER_CURRENT_TAG=$(TAG) K8S_VERSION=$(K8S_VERSION) ./bin/goreleaser $(SNAPSHOT_FLAGS) --release-notes=changelog/generated/$(TAG).md --parallelism 5
39-
40-
.PHONY: goreleaser
41-
goreleaser: ## Install goreleaser locally.
42-
@[[ -f ./bin/goreleaser ]] || curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
43-
4451
.PHONY: image-push image-push-multiarch
4552
IMAGE_TARGET_LIST = operator-sdk helm-operator ansible-operator scorecard-test scorecard-test-kuttl custom-scorecard-tests
4653
image-push: $(foreach i,$(IMAGE_TARGET_LIST),image-push/$(i)) ## Push all images for the host architecture.
4754
image-push-multiarch: $(foreach i,$(IMAGE_TARGET_LIST),image-push-multiarch/$(i)) ## Push the manifest list for all architectures.
4855

4956
# Push image for an architecture.
50-
IMAGE_REPO ?= quay.io/operator-framework
5157
GO_ARCH := $(shell go env GOARCH)
5258
image-push/%: IMAGE_PUSH_TAG = $(IMAGE_REPO)/$*-$(GO_ARCH)
5359
image-push/%:

tools/scripts/fetch

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ fetch() {
3434
ver_cmd="cat ${DEST}/.envtest_version 2>/dev/null"
3535
fetch_cmd="(test -f ${DEST}/setup-envtest.sh || curl -sSLo ${DEST}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v${ver}/hack/setup-envtest.sh) && (source ${DEST}/setup-envtest.sh; fetch_envtest_tools ${DEST}/../) && echo ${ver} > ${DEST}/.envtest_version"
3636
;;
37+
"goreleaser")
38+
[[ -z "$ver" ]] || (echo "cannot set goreleaser version" && exit 1)
39+
ver="${DEST}/goreleaser"
40+
ver_cmd="command -v ${DEST}/goreleaser"
41+
fetch_cmd="curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh -s -- -b ${DEST}"
42+
;;
3743
*)
3844
echo "unknown tool $tool"
3945
return 1

website/content/en/docs/installation/install-operator-sdk.md

Lines changed: 22 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
title: "Installation"
3-
linkTitle: "Installation"
4-
date: 2020-03-25
2+
title: Installation
3+
linkTitle: Installation
54
weight: 2
65
description: Install the Operator SDK CLI
76
---
@@ -24,87 +23,60 @@ description: Install the Operator SDK CLI
2423
If you are using [Homebrew][homebrew_tool], you can install the SDK CLI tool with the following command:
2524

2625
```sh
27-
$ brew install operator-sdk
26+
brew install operator-sdk
2827
```
2928

3029
## Install from GitHub release
3130

3231
### Download the release binaries
3332

3433
```sh
35-
# Set the release version variable
36-
$ RELEASE_VERSION=v1.1.0
3734
# Linux
38-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
39-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/ansible-operator-${RELEASE_VERSION}-x86_64-linux-gnu
40-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/helm-operator-${RELEASE_VERSION}-x86_64-linux-gnu
35+
curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/latest/download/operator-sdk_"$(uname -m)"_linux
4136
# macOS
42-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin
43-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/ansible-operator-${RELEASE_VERSION}-x86_64-apple-darwin
44-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/helm-operator-${RELEASE_VERSION}-x86_64-apple-darwin
37+
curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/latest/download/operator-sdk_"$(uname -m)"_darwin
4538
```
4639

4740
#### Verify the downloaded release binaries
4841

4942
```sh
50-
# Linux
51-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
52-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/ansible-operator-${RELEASE_VERSION}-x86_64-linux-gnu.asc
53-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/helm-operator-${RELEASE_VERSION}-x86_64-linux-gnu.asc
54-
# macOS
55-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
56-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/ansible-operator-${RELEASE_VERSION}-x86_64-apple-darwin.asc
57-
$ curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/helm-operator-${RELEASE_VERSION}-x86_64-apple-darwin.asc
43+
curl -LO https://github.com/operator-framework/operator-sdk/releases/latest/download/checksums.txt
5844
```
5945

6046
To verify a release binary using the provided asc files, place the binary and corresponding asc file into the same directory and use the corresponding command:
6147

6248
```sh
63-
# Linux
64-
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc
65-
$ gpg --verify ansible-operator-${RELEASE_VERSION}-x86_64-linux-gnu.asc
66-
$ gpg --verify helm-operator-${RELEASE_VERSION}-x86_64-linux-gnu.asc
67-
# macOS
68-
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
69-
$ gpg --verify ansible-operator-${RELEASE_VERSION}-x86_64-apple-darwin.asc
70-
$ gpg --verify helm-operator-${RELEASE_VERSION}-x86_64-apple-darwin.asc
49+
gpg --verify ./operator-sdk
7150
```
7251

7352
If you do not have the maintainers public key on your machine, you will get an error message similar to this:
7453

75-
```sh
76-
$ gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin.asc
77-
$ gpg: assuming signed data in 'operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin'
78-
$ gpg: Signature made Fri Apr 5 20:03:22 2019 CEST
79-
$ gpg: using RSA key <KEY_ID>
80-
$ gpg: Can't check signature: No public key
54+
```console
55+
$ gpg --verify operator-sdk
56+
gpg: assuming signed data in './operator-sdk.asc'
57+
gpg: Signature made Fri Apr 5 20:03:22 2019 CEST
58+
gpg: using RSA key <KEY_ID>
59+
gpg: Can\'t check signature: No public key
8160
```
8261

83-
To download the key, use the following command, replacing `$KEY_ID` with the RSA key string provided in the output of the previous command:
62+
To download the key, use the following command, replacing `$KEY_ID` with the "RSA key" string provided in the output of the previous command:
8463

8564
```sh
86-
$ gpg --recv-key "$KEY_ID"
65+
gpg --recv-key "$KEY_ID"
8766
```
8867

8968
You'll need to specify a key server if one hasn't been configured. For example:
9069

9170
```sh
92-
$ gpg --keyserver keyserver.ubuntu.com --recv-key "$KEY_ID"
71+
gpg --keyserver keyserver.ubuntu.com --recv-key "$KEY_ID"
9372
```
9473

9574
Now you should be able to verify the binary.
9675

9776
### Install the release binary in your PATH
9877

9978
```sh
100-
# Linux
101-
$ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && sudo mkdir -p /usr/local/bin/ && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk && rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
102-
$ chmod +x ansible-operator-${RELEASE_VERSION}-x86_64-linux-gnu && sudo mkdir -p /usr/local/bin/ && sudo cp ansible-operator-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/ansible-operator && rm ansible-operator-${RELEASE_VERSION}-x86_64-linux-gnu
103-
$ chmod +x helm-operator-${RELEASE_VERSION}-x86_64-linux-gnu && sudo mkdir -p /usr/local/bin/ && sudo cp helm-operator-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/helm-operator && rm helm-operator-${RELEASE_VERSION}-x86_64-linux-gnu
104-
# macOS
105-
$ chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin && sudo mkdir -p /usr/local/bin/ && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin /usr/local/bin/operator-sdk && rm operator-sdk-${RELEASE_VERSION}-x86_64-apple-darwin
106-
$ chmod +x ansible-operator-${RELEASE_VERSION}-x86_64-apple-darwin && sudo mkdir -p /usr/local/bin/ && sudo cp ansible-operator-${RELEASE_VERSION}-x86_64-apple-darwin /usr/local/bin/ansible-operator && rm ansible-operator-${RELEASE_VERSION}-x86_64-apple-darwin
107-
$ chmod +x helm-operator-${RELEASE_VERSION}-x86_64-apple-darwin && sudo mkdir -p /usr/local/bin/ && sudo cp helm-operator-${RELEASE_VERSION}-x86_64-apple-darwin /usr/local/bin/helm-operator && rm helm-operator-${RELEASE_VERSION}-x86_64-apple-darwin
79+
chmod +x operator-sdk && sudo mv operator-sdk /usr/local/bin/
10880
```
10981

11082
## Compile and install from master
@@ -117,11 +89,11 @@ $ chmod +x helm-operator-${RELEASE_VERSION}-x86_64-apple-darwin && sudo mkdir -p
11789
- [go][go_tool] version v1.15+.
11890

11991
```sh
120-
$ git clone https://github.com/operator-framework/operator-sdk
121-
$ cd operator-sdk
122-
$ git checkout master
123-
$ make tidy
124-
$ make install
92+
git clone https://github.com/operator-framework/operator-sdk
93+
cd operator-sdk
94+
git checkout master
95+
make tidy
96+
make install
12597
```
12698

12799
**Note:** Ensure that your `GOPROXY` is set with its default value for Go

0 commit comments

Comments
 (0)