Skip to content

Commit ca306c6

Browse files
authored
add release process makefile (#72)
* Add release process items * fix ci * add docs & release install.sh * finish up install.sh
1 parent 65e4ead commit ca306c6

20 files changed

+18671
-76
lines changed

.ci/helm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ function ci::install_storage_provisioner() {
5555

5656
function ci::install_pulsar_charts() {
5757
echo "Installing the pulsar charts ..."
58-
git clone https://github.com/streamnative/charts.git
59-
cd charts
58+
git clone https://github.com/streamnative/charts.git pulsar-charts
59+
cd pulsar-charts
6060
cp ../.ci/clusters/values.yaml charts/pulsar/mini_values.yaml
6161
cd charts
6262
helm repo add loki https://grafana.github.io/loki/charts

.github/workflows/release.yml

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ jobs:
1717
docker rmi $(docker images -q) -f
1818
df -h
1919
20-
- uses: actions/checkout@v1
20+
- name: checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Login to Docker Hub
24+
uses: docker/login-action@v1
25+
with:
26+
username: ${{ secrets.DOCKER_USER }}
27+
password: ${{ secrets.DOCKER_PASSWORD }}
28+
2129
- name: Set up GO 1.13
2230
uses: actions/setup-go@v1
2331
with:
@@ -29,10 +37,38 @@ jobs:
2937
with:
3038
version: 2.3.1
3139

32-
- name: Publish
33-
uses: docker/build-push-action@v1
40+
- name: build release
41+
id: build_release
42+
env:
43+
VERSION: ${{ github.event.release.tag_name }}
44+
DOCKER_REPO: ${GITHUB_ACTOR}
45+
run: |
46+
DOCKER_REPO=${GITHUB_ACTOR} make release
47+
DOCKER_REPO=${GITHUB_ACTOR} make docker-push
48+
49+
- name: Upload crd.yaml to release
50+
uses: svenstaro/upload-release-action@v2
3451
with:
35-
repository: streamnative/function-mesh
36-
username: ${{ secrets.DOCKER_USER }}
37-
password: ${{ secrets.DOCKER_PASSWORD }}
38-
tags: ${{ github.event.release.tag_name }}
52+
repo_token: ${{ secrets.GITHUB_TOKEN }}
53+
file: manifests/crd.yaml
54+
asset_name: crd.yaml
55+
tag: ${{ github.ref }}
56+
overwrite: true
57+
58+
- name: Upload rbac.yaml to release
59+
uses: svenstaro/upload-release-action@v2
60+
with:
61+
repo_token: ${{ secrets.GITHUB_TOKEN }}
62+
file: manifests/rbac.yaml
63+
asset_name: rbac.yaml
64+
tag: ${{ github.ref }}
65+
overwrite: true
66+
67+
- name: Upload install.sh to release
68+
uses: svenstaro/upload-release-action@v2
69+
with:
70+
repo_token: ${{ secrets.GITHUB_TOKEN }}
71+
file: install.sh
72+
asset_name: install.sh
73+
tag: ${{ github.ref }}
74+
overwrite: true

Makefile

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
# Current Operator version
2-
VERSION ?= 0.1.1
3-
# Default bundle image tag
4-
BUNDLE_IMG ?= controller-bundle:$(VERSION)
2+
VERSION ?= v0.1.2
3+
# Default image tag
4+
DOCKER_REPO := $(if $(DOCKER_REPO),$(DOCKER_REPO),streamnative)
5+
BUNDLE_IMG ?= function-mesh-controller-bundle:$(VERSION)
6+
OPERATOR_IMG ?= ${DOCKER_REPO}/function-mesh:$(VERSION)
7+
OPERATOR_IMG_LATEST ?= ${DOCKER_REPO}/function-mesh:latest
8+
9+
GOOS := $(if $(GOOS),$(GOOS),linux)
10+
GOARCH := $(if $(GOARCH),$(GOARCH),amd64)
11+
GOENV := CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH)
12+
GO := $(GOENV) go
13+
GO_BUILD := $(GO) build -trimpath
14+
515
# Options for 'bundle-build'
616
ifneq ($(origin CHANNELS), undefined)
717
BUNDLE_CHANNELS := --channels=$(CHANNELS)
@@ -31,15 +41,15 @@ test: generate fmt vet manifests
3141

3242
# Build manager binary
3343
manager: generate fmt vet
34-
go build -o bin/manager main.go
44+
$(GO_BUILD) -o bin/function-mesh-controller-manager main.go
3545

3646
# Run against the configured Kubernetes cluster in ~/.kube/config
3747
run: generate fmt vet manifests
3848
go run ./main.go
3949

4050
# Install CRDs into a cluster
41-
install: manifests kustomize
42-
$(KUSTOMIZE) build config/crd | kubectl apply -f -
51+
install: manifests kustomize crd
52+
kubectl apply -f manifests/crd.yaml
4353

4454
# Uninstall CRDs from a cluster
4555
uninstall: manifests kustomize
@@ -70,10 +80,6 @@ generate: controller-gen
7080
docker-build: test
7181
docker build . -t ${IMG}
7282

73-
# Push the docker image
74-
docker-push:
75-
docker push ${IMG}
76-
7783
# find or download controller-gen
7884
# download controller-gen if necessary
7985
controller-gen:
@@ -118,3 +124,19 @@ bundle: manifests
118124
.PHONY: bundle-build
119125
bundle-build:
120126
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
127+
128+
crd: manifests
129+
$(KUSTOMIZE) build config/crd > manifests/crd.yaml
130+
131+
rbac: manifests
132+
$(KUSTOMIZE) build config/rbac > manifests/rbac.yaml
133+
134+
release: manifests crd rbac manager operator-docker-image
135+
136+
operator-docker-image: test
137+
docker build -f operator.Dockerfile -t $(OPERATOR_IMG) .
138+
docker tag $(OPERATOR_IMG) $(OPERATOR_IMG_LATEST)
139+
140+
docker-push:
141+
docker push $(OPERATOR_IMG)
142+
docker push $(OPERATOR_IMG_LATEST)

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Function-Mesh
22
A Kubernetes-Native way to run pulsar functions, connectors and composed function meshes.
33

4+
## Install
5+
6+
```bash
7+
curl -sSL https://github.com/streamnative/function-mesh/releases/download/v0.1.2/install.sh | bash
8+
```
9+
10+
The above command installs all the CRDs, required service account configuration, and all function-mesh operator components. Before you start running a function-mesh example, verify if Function Mesh is installed correctly.
11+
12+
Note:
13+
14+
> install.sh is suitable for trying Function Mesh out. If you want to use Function Mesh in production or other serious scenarios, Helm is the recommended deployment method.
15+
416
## Prerequisite
517
- Git
618
- [operator-sdk](https://sdk.operatorframework.io/)

0 commit comments

Comments
 (0)