From b4b5e03319aa5d752e00d6a3caebccf5f0a0259a Mon Sep 17 00:00:00 2001 From: Anatoliy Bazko Date: Thu, 7 May 2020 09:19:44 +0300 Subject: [PATCH] Update RELEASE.md Signed-off-by: Anatoliy Bazko --- RELEASE.md | 21 +++++++++++++++------ make-release.sh | 31 +++++++++++++++++++------------ 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 864574321..60e5d5172 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,12 +2,20 @@ ## 1. Release files -### Prerequisites -- export environment variables `QUAY_USERNAME` and `QUAY_PASSWORD` - +Export environment variables: +1. `QUAY_USERNAME` and `QUAY_PASSWORD` to access https://quay.io/organization/eclipse +2. `GIT_USER` and `GIT_PASSWORD` to create PR into https://github.com/operator-framework/community-operators ```bash -./make-release.sh +./make-release.sh --push-olm-files --push-git-changes +``` + +```bash +Usage: ./make-release.sh [RELEASE_VERSION] --branch [SOURCE_PATH] --push-olm-files --push-git-changes + --push-olm-files: to push OLM files to quay.io. This flag should be omitted + if already a greater version released. For instance, we are releasing 7.9.3 version but + 7.10.0 alread exists. Otherwise it breaks the linear update path of the stable channel. + --push-git-changes: to create release branch and push changes into. ``` ## 2. Testing release on openshift @@ -46,7 +54,7 @@ xdg-open http://$(kubectl get ingress -n eclipse-che-preview-test | grep ^che | Validate that the release version is installed and workspace can be created: -## 4. Testing release on minishift +## 4. Testing release on minishift (when chectl is released) Login to local minishift cluster: @@ -54,7 +62,7 @@ Login to local minishift cluster: oc login ``` -Install the previous version of Eclipse Che: +Install the previous version of Eclipse Che using the corresponding version of `chectl`: ```bash chectl server:start --platform=minishift --installer=operator --che-operator-image=quay.io/eclipse/che-operator: @@ -63,6 +71,7 @@ chectl server:start --platform=minishift --installer=operator --che-operator-im Update Eclipse Che to the latest version. Validate that the correct version is installed and workspace can be created: ```bash +chectl update stable chectl server:update --platform=minishift --installer=operator xdg-open http://$(kubectl get ingress -n che | grep ^che | awk -F ' ' '{ print $2 }') ``` diff --git a/make-release.sh b/make-release.sh index e2e56b9e8..00290ca7a 100755 --- a/make-release.sh +++ b/make-release.sh @@ -17,7 +17,8 @@ init() { RELEASE="$1" BRANCH=$(echo $RELEASE | sed 's/.$/x/') GIT_REMOTE_UPSTREAM="git@github.com:eclipse/che-operator.git" - PULL_REQUEST=false + PULL_REQUEST_TO_X_BRANCH=false + PULL_REQUEST_TO_X_MASTER=false PUSH_OLM_FILES=false PUSH_GIT_CHANGES=false RELEASE_DIR=$(cd "$(dirname "$0")"; pwd) @@ -27,7 +28,6 @@ init() { while [[ "$#" -gt 0 ]]; do case $1 in '--branch') BRANCH="$2"; shift 1;; - '--pr') PULL_REQUEST=true; shift 0;; '--push-olm-files') PUSH_OLM_FILES=true; shift 0;; '--push-git-changes') PUSH_GIT_CHANGES=true; shift 0;; '--help'|'-h') usage; exit;; @@ -54,7 +54,11 @@ init() { } usage () { - echo "Usage: $0 [RELEASE_VERSION] --branch [SOURCE_PATH] --pr " + echo "Usage: $0 [RELEASE_VERSION] --branch [SOURCE_PATH] --push-olm-files --push-git-changes" + echo -e "\t--push-olm-files: to push OLM files to quay.io. This flag should be omitted " + echo -e "\t\tif already a greater version released. For instance, we are releasing 7.9.3 version but" + echo -e "\t\t7.10.0 alread exists. Otherwise it breaks the linear update path of the stable channel." + echo -e "\t--push-git-changes: to create release branch and push changes into." } resetChanges() { @@ -223,8 +227,14 @@ pushGitChanges() { git push --tags origin } -createPRInCheOperatorRepository() { - echo "[INFO] Creating pull request into $GIT_REMOTE_UPSTREAM repository" +createPRToXBranch() { + echo "[INFO] Creating pull request into ${BRANCH} branch" + hub pull-request --base ${BRANCH} --head ${RELEASE} --browse -m "Release version ${RELEASE}" +} + +createPRToMasterBranch() { + echo "[INFO] Creating pull request into master branch" + git diff refs/heads/${BRANCH}...refs/heads/${RELEASE} hub pull-request --base ${BRANCH} --head ${RELEASE} --browse -m "Release version ${RELEASE}" } @@ -240,14 +250,11 @@ run() { if [[ $PUSH_GIT_CHANGES == "true" ]]; then pushGitChanges + createPRToXBranch + # createPRToMasterBranch fi } init "$@" - -if [[ $PULL_REQUEST == "true" ]]; then - createPRInCheOperatorRepository -else - echo "[INFO] Release '$RELEASE' from branch '$BRANCH'" - run "$@" -fi +echo "[INFO] Release '$RELEASE' from branch '$BRANCH'" +run "$@"