Skip to content

Commit

Permalink
Update release process to align with new project structure (#1637)
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 authored Nov 21, 2021
1 parent 4401d84 commit e0c53a5
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 50 deletions.
3 changes: 2 additions & 1 deletion .ci/create-release-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ echo "${GITHUB_TOKEN}" | gh auth login --with-token
gh config set prompt disabled
gh release create \
-t "Release ${OPERATOR_VERSION}" \
"${OPERATOR_VERSION}"
"${OPERATOR_VERSION}" \
'dist/jaeger-operator.yaml#Installation manifest for Kubernetes'
15 changes: 1 addition & 14 deletions .ci/operatorhub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ fi
OLD_PWD=$(pwd)
VERSION=$(grep operator= versions.txt | awk -F= '{print $2}')

PKG_FILE=deploy/olm-catalog/jaeger-operator/jaeger-operator.package.yaml
CSV_FILE=deploy/olm-catalog/jaeger-operator/manifests/jaeger-operator.clusterserviceversion.yaml
CRD_FILE=deploy/crds/jaegertracing.io_jaegers_crd.yaml

# once we get a clarification on the following item, we might not need to have different file names
# https://github.com/operator-framework/community-operators/issues/701
DEST_PKG_FILE=jaeger.package.yaml
DEST_CSV_FILE=jaeger.v${VERSION}.clusterserviceversion.yaml

for dest in ${COMMUNITY_OPERATORS_REPOSITORY} ${UPSTREAM_REPOSITORY}; do
cd "${LOCAL_REPOSITORIES_PATH}/${dest}"
git remote | grep upstream > /dev/null
Expand All @@ -41,11 +32,7 @@ for dest in ${COMMUNITY_OPERATORS_REPOSITORY} ${UPSTREAM_REPOSITORY}; do
git checkout -q main
git rebase -q upstream/main

mkdir -p "operators/jaeger/${VERSION}"

cp "${OLD_PWD}/${PKG_FILE}" "operators/jaeger/${DEST_PKG_FILE}"
cp "${OLD_PWD}/${CSV_FILE}" "operators/jaeger/${VERSION}/${DEST_CSV_FILE}"
cp "${OLD_PWD}/${CRD_FILE}" "operators/jaeger/${VERSION}"
cp -r "${OLD_PWD}/bundle" "operators/jaeger/${VERSION}"

git checkout -q -b Update-Jaeger-to-${VERSION}
if [[ $? != 0 ]]; then
Expand Down
30 changes: 4 additions & 26 deletions .ci/prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,13 @@ if [[ "${OPERATOR_VERSION}x" == "x" ]]; then
exit 1
fi

BASE_BUILD_IMAGE=${BASE_BUILD_IMAGE:-"jaegertracing/jaeger-operator"}
TAG=${TAG:-"v${OPERATOR_VERSION}"}
BUILD_IMAGE=${BUILD_IMAGE:-"${BASE_BUILD_IMAGE}:${OPERATOR_VERSION}"}
PREVIOUS_VERSION=$(grep operator= versions.txt | awk -F= '{print $2}')

# changes to deploy/operator.yaml
sed "s~image: jaegertracing/jaeger-operator.*~image: ${BUILD_IMAGE}~gi" -i deploy/operator.yaml
PREVIOUS_VERSION=$(grep operator= versions.txt | awk -F= '{print $2}')

# change the versions.txt, bump only operator version.
sed "s~operator=${PREVIOUS_VERSION}~operator=${OPERATOR_VERSION}~gi" -i versions.txt

mkdir -p deploy/olm-catalog/jaeger-operator/${OPERATOR_VERSION}
cp deploy/olm-catalog/jaeger-operator/manifests/jaeger-operator.clusterserviceversion.yaml \
deploy/olm-catalog/jaeger-operator/${OPERATOR_VERSION}/jaeger-operator.v${OPERATOR_VERSION}.clusterserviceversion.yaml

operator-sdk generate csv \
--csv-channel=stable \
--make-manifests=false \
--csv-version=${OPERATOR_VERSION}
VERSION=${OPERATOR_VERSION} USER=jaegertracing make bundle

# changes to deploy/olm-catalog/jaeger-operator/manifests
sed "s~containerImage: docker.io/jaegertracing/jaeger-operator:${PREVIOUS_VERSION}~containerImage: docker.io/jaegertracing/jaeger-operator:${OPERATOR_VERSION}~i" -i deploy/olm-catalog/jaeger-operator/${OPERATOR_VERSION}/jaeger-operator.v${OPERATOR_VERSION}.clusterserviceversion.yaml
sed "s~image: jaegertracing/jaeger-operator:${PREVIOUS_VERSION}~image: jaegertracing/jaeger-operator:${OPERATOR_VERSION}~i" -i deploy/olm-catalog/jaeger-operator/${OPERATOR_VERSION}/jaeger-operator.v${OPERATOR_VERSION}.clusterserviceversion.yaml
sed "s~replaces: jaeger-operator.v.*~replaces: jaeger-operator.v${PREVIOUS_VERSION}~i" -i deploy/olm-catalog/jaeger-operator/${OPERATOR_VERSION}/jaeger-operator.v${OPERATOR_VERSION}.clusterserviceversion.yaml
sed "s~version: ${PREVIOUS_VERSION}~version: ${OPERATOR_VERSION}~i" -i deploy/olm-catalog/jaeger-operator/${OPERATOR_VERSION}/jaeger-operator.v${OPERATOR_VERSION}.clusterserviceversion.yaml
sed "s~name: jaeger-operator.v${PREVIOUS_VERSION}~name: jaeger-operator.v${OPERATOR_VERSION}~i" -i deploy/olm-catalog/jaeger-operator/${OPERATOR_VERSION}/jaeger-operator.v${OPERATOR_VERSION}.clusterserviceversion.yaml

# changes to deploy/olm-catalog/jaeger-operator/jaeger-operator.package.yaml
sed "s~currentCSV: jaeger-operator.v${PREVIOUS_VERSION}~currentCSV: jaeger-operator.v${OPERATOR_VERSION}~i" -i deploy/olm-catalog/jaeger-operator/jaeger-operator.package.yaml

cp deploy/olm-catalog/jaeger-operator/${OPERATOR_VERSION}/jaeger-operator.v${OPERATOR_VERSION}.clusterserviceversion.yaml \
deploy/olm-catalog/jaeger-operator/manifests/jaeger-operator.clusterserviceversion.yaml
# changes to deploy/operator.yaml
sed "s~replaces: jaeger-operator.v.*~replaces: jaeger-operator.v${OPERATOR_VERSION}~i" -i config/manifests/bases/jaeger-operator.clusterserviceversion.yaml
31 changes: 22 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
name: "Release"

name: "Prepare the release"
on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
unit-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- uses: actions/[email protected]
- uses: jpkrohling/[email protected]

- name: "install kubebuilder"
run: ./hack/install-kubebuilder.sh

- name: "install kustomize"
run: ./hack/install-kustomize.sh

- uses: jpkrohling/[email protected]
with:
operator-sdk-version: v0.18.2
- uses: docker/[email protected]
- uses: docker/[email protected]
- name: "perform the release"
operator-sdk-version: v1.13.1

- name: "generate release resources"
run: make release-artifacts USER=jaegertracing

- name: "create the release in GitHub"
env:
GITHUB_TOKEN: ${{ github.token }}
run: ./.ci/create-release-github.sh

- name: "publishes the images"
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -

.PHONY: operatorhub
operatorhub: check-operatorhub-pr-template
$(VECHO)./.ci/operatorhub.sh

.PHONY: check-operatorhub-pr-template
check-operatorhub-pr-template:
$(VECHO)curl https://raw.githubusercontent.com/operator-framework/community-operators/master/docs/pull_request_template.md -o .ci/.operatorhub-pr-template.md -s > /dev/null 2>&1
Expand Down Expand Up @@ -598,6 +602,13 @@ install-git-hooks:
set-test-image-vars:
$(eval IMG=local/jaeger-operator:e2e)


# Generates the released manifests
release-artifacts: set-image-controller
mkdir -p dist
$(KUSTOMIZE) build config/default -o dist/jaeger-operator.yaml


kuttl:
ifeq (, $(shell which kubectl-kuttl))
echo ${PATH}
Expand Down Expand Up @@ -644,3 +655,7 @@ install-tools:
golang.org/x/tools/cmd/goimports \
github.com/securego/gosec/cmd/[email protected] \
./.ci/install-gomplate.sh

.PHONY: prepare-release
prepare-release:
$(VECHO)./.ci/prepare-release.sh
7 changes: 7 additions & 0 deletions bundle/manifests/jaeger-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,14 @@ spec:
links:
- name: Jaeger Operator Source Code
url: https://github.com/jaegertracing/jaeger-operator
maintainers:
- email: [email protected]
name: Jaeger Google Group
maturity: alpha
provider:
name: CNCF
replaces: jaeger-operator.v1.27.0
selector:
matchLabels:
name: jaeger-operator
version: 1.28.0
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,14 @@ spec:
links:
- name: Jaeger Operator Source Code
url: https://github.com/jaegertracing/jaeger-operator
maintainers:
- email: [email protected]
name: Jaeger Google Group
maturity: alpha
provider:
name: CNCF
replaces: jaeger-operator.v1.27.0
selector:
matchLabels:
name: jaeger-operator
version: 0.0.0

0 comments on commit e0c53a5

Please sign in to comment.