Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 7.8.0 #163

Merged
merged 3 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,36 @@

Start a cluster using `cluster-bot` application.

To be able to test update it is needed to created some user before. Login as `kubeadmin`. At the middle of the dashboard click `Update OAuth configuration`. Then `Identity providers` -> `Add` -> `HTPassword` and upload a htpassword file (can be created with HTPassword utility). Login using HTPassword, logout and login again as `kubeadmin`. Go to `kube:admin` menu -> `Copy Login Command` -> `Display Token` and launch to showing command in the terminal. Now it is possible to test update:
To be able to test update it is needed to created some user before. Login as `kubeadmin`. Click `Update the cluster OAuth configuration` at the middle of the dashboard, then `Identity providers` -> `Add` -> `HTPassword` and upload a htpassword file (can be created with HTPassword utility). Logout and login using HTPassword, then logout and login as `kubeadmin`. Go to `kube:admin` -> `Copy Login Command` -> `Display Token` and launch showing command in the terminal. Now it is possible to test update:

```bash
olm/testUpdates.sh openshift stable
olm/testUpdate.sh openshift stable
```

Open Eclipse Che dashboard in the anonymous to validate that the correct version is installed and workspace can be created:
Open Eclipse Che dashboard in an anonymous tab:

```bash
echo http://$(kubectl get ingress -n che | grep ^che | awk -F ' ' '{ print $2 }')
echo http://$(oc get route -n eclipse-che-preview-test | grep ^che | awk -F ' ' '{ print $2 }')
davidfestal marked this conversation as resolved.
Show resolved Hide resolved
```

Login using HTPassword then allow selected permissions. Validate that the release version is installed and workspace can be created:

## 3. Testing release on minikube

Run script to test updates:

```bash
olm/testUpdates.sh kubernetes stable
olm/testUpdate.sh kubernetes stable
```

Open Eclipse Che dashboard to validate that the correct version is installed and workspace can be created:
Open Eclipse Che dashboard:

```bash
xdg-open http://$(kubectl get ingress -n che | grep ^che | awk -F ' ' '{ print $2 }')
xdg-open http://$(kubectl get ingress -n eclipse-che-preview-test | grep ^che | awk -F ' ' '{ print $2 }')
```

Validate that the release version is installed and workspace can be created:

## 4. Testing release on minishift

Login to local minishift cluster:
Expand All @@ -47,7 +51,7 @@ oc login <LOCAL_MINISHIFT_CLUSTER_ADDRESS>
Install the previous version of Eclipse Che:

```bash
chectl server:start --platform=minikube --installer=operator --che-operator-image=quay.io/eclipse/che-operator:<PREVIOUS_RELEASE_VERSION>
chectl server:start --platform=minishift --installer=operator --che-operator-image=quay.io/eclipse/che-operator:<PREVIOUS_RELEASE_VERSION>
```

Update Eclipse Che to the latest version. Validate that the correct version is installed and workspace can be created:
Expand Down
68 changes: 46 additions & 22 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ init() {
NC='\e[0m'
YELLOW='\e[33m'
GREEN='\e[32m'

RELEASE="$1"
GIT_REMOTE_UPSTREAM="[email protected]:eclipse/che-operator.git"
CURRENT_DIR=$(pwd)
BASE_DIR=$(cd "$(dirname "$0")"; pwd)
}

check() {
Expand All @@ -37,17 +42,17 @@ check() {
command -v operator-sdk >/dev/null 2>&1 || { echo -e $RED"operator-sdk is not installed. Aborting."$NC; exit 1; }

local operatorVersion=$(operator-sdk version)
[[ ! $operatorVersion =~ .*v0.10.0.* ]] || { echo -e $RED"operator-sdk v0.10.0 is required"$NC; exit 1; }
[[ $operatorVersion =~ .*v0.10.0.* ]] || { echo -e $RED"operator-sdk v0.10.0 is required"$NC; exit 1; }
davidfestal marked this conversation as resolved.
Show resolved Hide resolved
}

ask() {
while true; do
echo -e $GREEN$@$NC" (Y)es or (N)o"
echo -e -n $GREEN$@$NC" (Y)es or (N)o "
read -r yn
case $yn in
[Yy]* ) return 0;;
[Nn]* ) return 1;;
* ) echo "Please answer (Y)es or (N)o.";;
* ) echo "Please answer (Y)es or (N)o. ";;
esac
done
}
Expand Down Expand Up @@ -79,6 +84,12 @@ createLocalBranch() {
fi
}

getPropertyValue() {
local file=$1
local key=$2
echo $(cat $file | grep -m1 "$key" | tr -d ' ' | tr -d '\t' | cut -d = -f2)
}

releaseOperatorCode() {
set +e
ask "3. Release operator code?"
Expand All @@ -87,15 +98,25 @@ releaseOperatorCode() {

if [[ $result == 0 ]]; then
local defaultsgo=$BASE_DIR/pkg/deploy/defaults.go
local extraimagesgo=$BASE_DIR/pkg/deploy/extra_images.go

echo "3.1 Launch 'release-operator-code.sh' script"
echo -e $GREEN"3.1 Launch 'release-operator-code.sh' script"$NC
. ${BASE_DIR}/release-operator-code.sh $RELEASE

echo "3.2 Validate pkg/deploy/defaults.go"
grep -q "defaultCheServerImageTag = \""$RELEASE"\"" $defaultsgo
grep -q "defaultDevfileRegistryUpstreamImage = \"quay.io/eclipse/che-devfile-registry:"$RELEASE"\"" $defaultsgo
grep -q "defaultPluginRegistryUpstreamImage = \"quay.io/eclipse/che-plugin-registry:"$RELEASE"\"" $defaultsgo
grep -q "defaultKeycloakUpstreamImage = \"quay.io/eclipse/che-keycloak:"$RELEASE"\"" $defaultsgo
echo -e $GREEN"3.2 Validate changes for $defaultsgo"$NC
[[ \"$RELEASE\" != $(getPropertyValue $defaultsgo defaultCheServerImageTag) ]] && { echo -e $RED"$defaultsgo cotains unexpected changes"$NC; exit 1; }
[[ \"quay.io/eclipse/che-devfile-registry:$RELEASE\" != $(getPropertyValue $defaultsgo defaultDevfileRegistryUpstreamImage) ]] && { echo -e $RED"$defaultsgo cotains unexpected changes"$NC; exit 1; }
[[ \"quay.io/eclipse/che-plugin-registry:$RELEASE\" != $(getPropertyValue $defaultsgo defaultPluginRegistryUpstreamImage) ]] && { echo -e $RED"$defaultsgo cotains unexpected changes"$NC; exit 1; }
[[ \"quay.io/eclipse/che-keycloak:$RELEASE\" != $(getPropertyValue $defaultsgo defaultKeycloakUpstreamImage) ]] && { echo -e $RED"$defaultsgo cotains unexpected changes"$NC; exit 1; }

echo -e $GREEN"3.3 Validate changes for $extraimagesgo"$NC
[[ \"\" == $(getPropertyValue $extraimagesgo defaultCheWorkspacePluginBrokerMetadataUpstreamImage) ]] && { echo $RED"$extraimagesgo cotains unexpected changes"$NC; exit 1; }
[[ \"\" == $(getPropertyValue $extraimagesgo defaultCheWorkspacePluginBrokerArtifactsUpstreamImage) ]] && { echo $RED"$extraimagesgo cotains unexpected changes"$NC; exit 1; }
[[ \"\" == $(getPropertyValue $extraimagesgo defaultCheServerSecureExposerJwtProxyUpstreamImage) ]] && { echo $RED"$extraimagesgo cotains unexpected changes"$NC; exit 1; }

echo -e $GREEN"3.4 Validate number of changed files"$NC
local changes=$(git status -s | wc -l)
[[ $changes -gt 2 ]] && { echo -e $RED"The number of changes are greated then 2. Check 'git status'."$NC; return 1; }
elif [[ $result == 1 ]]; then
echo -e $YELLOW"> SKIPPED"$NC
fi
Expand All @@ -108,7 +129,7 @@ commitDefaultsGoChanges() {
set -e

if [[ $result == 0 ]]; then
git commit -am "Update defaults tags to "$RELEASE --singoff
git commit -am "Update defaults tags to "$RELEASE --signoff
elif [[ $result == 1 ]]; then
echo -e $YELLOW"> SKIPPED"$NC
fi
Expand All @@ -135,26 +156,32 @@ releaseOlmFiles() {
set -e

if [[ $result == 0 ]]; then
echo "6.1 Launch 'olm/release-olm-files.sh' script"
echo -e $GREEN"6.1 Launch 'olm/release-olm-files.sh' script"$NC
cd $BASE_DIR/olm
. $BASE_DIR/olm/release-olm-files.sh $RELEASE
cd $CURRENT_DIR

local openshift=$BASE_DIR/olm/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift
local kubernetes=$BASE_DIR/olm/eclipse-che-preview-kubernetes/deploy/olm-catalog/eclipse-che-preview-kubernetes
local openshift=$BASE_DIR/eclipse-che-preview-openshift/deploy/olm-catalog/eclipse-che-preview-openshift
local kubernetes=$BASE_DIR/eclipse-che-preview-kubernetes/deploy/olm-catalog/eclipse-che-preview-kubernetes

echo "6.2 Validate files"
echo -e $GREEN"6.2 Validate files"$NC
grep -q "currentCSV: eclipse-che-preview-openshift.v"$RELEASE $openshift/eclipse-che-preview-openshift.package.yaml
grep -q "currentCSV: eclipse-che-preview-kubernetes.v"$RELEASE $kubernetes/eclipse-che-preview-kubernetes.package.yaml
grep -q "version: "$RELEASE $openshift/$RELEASE/eclipse-che-preview-openshift.v$RELEASE.clusterserviceversion.yaml
grep -q "version: "$RELEASE $kubernetes/$RELEASE/eclipse-che-preview-kubernetes.v$RELEASE.clusterserviceversion.yaml
test -f $kubernetes/$RELEASE/eclipse-che-preview-kubernetes.crd.yaml
test -f $openshift/$RELEASE/eclipse-che-preview-openshift.crd.yaml

echo "6.3 It is needed to check diff files manully"
echo -e $GREEN"6.3 It is needed to check diff files manully"$NC
echo $openshift/$RELEASE/eclipse-che-preview-openshift.v$RELEASE.clusterserviceversion.yaml.diff
echo $kubernetes/$RELEASE/eclipse-che-preview-kubernetes.v$RELEASE.clusterserviceversion.yaml.diff
echo $openshift/$RELEASE/eclipse-che-preview-openshift.crd.yaml.diff
echo $kubernetes/$RELEASE/eclipse-che-preview-kubernetes.crd.yaml.diff
read -p "Press enter to continue"

echo -e $GREEN"6.4 Validate number of changed files"$NC
local changes=$(git status -s | wc -l)
[[ $changes -gt 4 ]] && { echo -e $RED"The number of changed files are greated then 4. Check 'git status'."$NC; return 1; }
elif [[ $result == 1 ]]; then
echo -e $YELLOW"> SKIPPED"$NC
fi
Expand All @@ -168,7 +195,7 @@ commitOlmChanges() {

if [[ $result == 0 ]]; then
git add -A
git commit -m "Release OLM files to "$RELEASE --singoff
git commit -m "Release OLM files to "$RELEASE --signoff
elif [[ $result == 1 ]]; then
echo -e $YELLOW"> SKIPPED"$NC
fi
Expand All @@ -181,7 +208,9 @@ pushOlmFiles() {
set -e

if [[ $result == 0 ]]; then
cd $BASE_DIR/olm
. $BASE_DIR/olm/push-olm-files-to-quay.sh
cd $CURRENT_DIR

read -p "Validate RELEASES page on quay.io. Press enter to open the browser"
xdg-open https://quay.io/application/eclipse-che-operator-kubernetes/eclipse-che-preview-kubernetes
Expand All @@ -203,19 +232,14 @@ pushChanges() {

if [[ $result == 0 ]]; then
git push origin $RELEASE
git tag -a $RELEASE
git tag -a $RELEASE -m $RELEASE
git push --tags origin
elif [[ $result == 1 ]]; then
echo -e $YELLOW"> SKIPPED"$NC
fi
}

run() {
RELEASE="$1"
GIT_REMOTE_UPSTREAM="[email protected]:eclipse/che-operator.git"
CURRENT_DIR=$(pwd)
BASE_DIR=$(cd "$(dirname "$0")"; pwd)

resetLocalChanges
createLocalBranch
releaseOperatorCode
Expand Down
Loading