Skip to content

Commit

Permalink
CRW-1387 use /latest instead of /7.y.z in che.properties (#18822)
Browse files Browse the repository at this point in the history
* CRW-1387 use /latest instead of /7.y.z in che.properties; replace need for two set_tag_version_images* scripts with a single on that works on linux and macos; update readme

Change-Id: I3eb783131dfa4741f58e384a5d5c6d35d46c81ff
Signed-off-by: nickboldt <nboldt@redhat.com>

* rename set_tag_version_images_linux.sh -> set_tag_version_images.sh

Change-Id: I6f0b586e4dc561d57d7c84b24d90031678fd3558
Signed-off-by: nickboldt <nboldt@redhat.com>

* make sed replacements more legible

Change-Id: Ibe3794f8574708658fc6f3458e1c446be02f4c23
Signed-off-by: nickboldt <nboldt@redhat.com>
  • Loading branch information
nickboldt committed Jan 19, 2021
1 parent 337c64f commit 2c7b403
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 64 deletions.
34 changes: 34 additions & 0 deletions .ci/set_tag_version_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
# Copyright (c) 2017-2021 Red Hat, Inc.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html

sed_in_place() {
SHORT_UNAME=$(uname -s)
if [ "$(uname)" == "Darwin" ]; then
sed -i '' "$@"
elif [ "${SHORT_UNAME:0:5}" == "Linux" ]; then
sed -i "$@"
fi
}

# only use /latest plugins so updates are smoother (old plugins are deleted from registries with each new release)
plugin_version="latest"
sed_in_place -r -e "s#che.factory.default_editor=eclipse/che-theia/.*#che.factory.default_editor=eclipse/che-theia/$plugin_version#g" ../assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties
sed_in_place -r -e "s#che.factory.default_plugins=eclipse/che-machine-exec-plugin/.*#che.factory.default_plugins=eclipse/che-machine-exec-plugin/$plugin_version#g" ../assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties
sed_in_place -r -e "s#che.workspace.devfile.default_editor=eclipse/che-theia/.*#che.workspace.devfile.default_editor=eclipse/che-theia/$plugin_version#g" ../assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties
sed_in_place -r -e "s#che.workspace.devfile.default_editor.plugins=eclipse/che-machine-exec-plugin/.*#che.workspace.devfile.default_editor.plugins=eclipse/che-machine-exec-plugin/$plugin_version#g" ../assembly/assembly-wsmaster-war/src/main/webapp/WEB-INF/classes/che/che.properties

# use actual image tags, so a new container is used after each update
image_version="$1"
sed_in_place -r -e "s#che-plugin-registry:.*#che-plugin-registry:$image_version#g" ../deploy/kubernetes/helm/che/custom-charts/che-plugin-registry/values.yaml
sed_in_place -r -e "s#che-devfile-registry:.*#che-devfile-registry:$image_version#g" ../deploy/kubernetes/helm/che/custom-charts/che-devfile-registry/values.yaml
sed_in_place -r -e "s#che-postgres:.*#che-postgres:$image_version#g" ../deploy/kubernetes/helm/che/custom-charts/che-postgres/values.yaml
sed_in_place -r -e "s#che-keycloak:.*#che-keycloak:$image_version#g" ../deploy/kubernetes/helm/che/custom-charts/che-keycloak/values.yaml
sed_in_place -r -e "s#eclipse/che-server:.*#eclipse/che-server:$image_version#g" ../deploy/kubernetes/helm/che/values.yaml
sed_in_place -r -e "s#eclipse/che-dashboard:.*#eclipse/che-dashboard:$image_version#g" ../deploy/kubernetes/helm/che/values.yaml

sed_in_place -r -e "s#che-endpoint-watcher:nightly#che-endpoint-watcher:$image_version#g" ../deploy/kubernetes/helm/che/custom-charts/che-keycloak/templates/deployment.yaml
sed_in_place -r -e "s#che-endpoint-watcher:nightly#che-endpoint-watcher:$image_version#g" ../deploy/kubernetes/helm/che/templates/deployment.yaml
21 changes: 0 additions & 21 deletions .ci/set_tag_version_images_linux.sh

This file was deleted.

20 changes: 0 additions & 20 deletions .ci/set_tag_version_images_macos.sh

This file was deleted.

60 changes: 39 additions & 21 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ In series, the following will be released via [che-release](https://github.com/e
* che-theia, che-machine-exec, che-devfile registry,
* che-plugin-registry (once che-theia and machine-exec are done)
* che-parent, che-dashboard, che-workspace-loader, and che (server assembly)
* che-parent, che-dashboard, che-workspace-loader
* che (server assembly, with maven artifacts + containers)
Then manually:
Expand All @@ -29,11 +30,13 @@ Then by script:
* chectl
- [ ] che-theia, che-machine-exec, che-devfile-registry, che-plugin-registry
- [ ] che-parent, che-dashboard, che-workspace-loader, che
- [ ] che-parent, che-dashboard, che-workspace-loader
- [ ] che
- [ ] che-operator _(depends on all of the above)_
- [ ] chectl _(depends on all of the above)_
- [ ] community operator PRs _(depends on all of the above)_
- [ ] https://github.com/operator-framework/community-operators/pull/ ???
- [ ] https://github.com/operator-framework/community-operators/pull/ ???
- [ ] chectl _(depends on all of the above)_
If this is a .0 release:
Expand All @@ -52,41 +55,56 @@ If this is a .0 release:
| @mkuznyetsov | [che-parent](https://github.com/eclipse/che/blob/master/RELEASE.md) | [cico_release.sh](https://github.com/eclipse/che-release/blob/master/cico_release.sh) | [centos](https://ci.centos.org/job/devtools-che-release-che-release) | [che-parent](https://search.maven.org/search?q=a:che-parent) |
| @mkuznyetsov | [che-dashboard](https://github.com/eclipse/che-dashboard/blob/master/RELEASE.md) | [cico_release.sh](https://github.com/eclipse/che-release/blob/master/cico_release.sh) | [centos](https://ci.centos.org/job/devtools-che-release-che-release/) | [`che-dashboard`](https://quay.io/repository/eclipse/che-dashboard?tag=next&tab=tags) |
| @mkuznyetsov | [che-workspace-loader](https://github.com/eclipse/che-workspace-loader/blob/master/RELEASE.md) | [cico_release.sh](https://github.com/eclipse/che-release/blob/master/cico_release.sh) | [centos](https://ci.centos.org/job/devtools-che-release-che-release) | [`che-workspace-loader`](https://quay.io/repository/eclipse/che-workspace-loader?tag=next&tab=tags) |
| @mkuznyetsov | [che](https://github.com/eclipse/che/blob/master/RELEASE.md) | [cico_release.sh](https://github.com/eclipse/che-release/blob/master/cico_release.sh) | [centos](https://ci.centos.org/job/devtools-che-release-che-release) | [che.core](https://search.maven.org/search?q=che.core),<br/> [`eclipse/che-server`](https://quay.io/eclipse/che-server),<br/>[`eclipse/che-endpoint-watcher`](https://quay.io/eclipse/che-endpoint-watcher),<br/> [`eclipse/che-keycloak`](https://quay.io/eclipse/che-keycloak),<br/> [`eclipse/che-postgres`](https://quay.io/eclipse/che-postgres),<br/> [`eclipse/che-server`](https://quay.io/eclipse/che-server),<br/> [`eclipse/che-e2e`](https://quay.io/eclipse/che-e2e) |
| @mkuznyetsov | [che](https://github.com/eclipse/che/blob/master/RELEASE.md) | [cico_release.sh](https://github.com/eclipse/che-release/blob/master/cico_release.sh) | [centos](https://ci.centos.org/job/devtools-che-release-che-release) | [che.core](https://search.maven.org/search?q=che.core), [che.server](https://mvnrepository.com/artifact/org.eclipse.che/che-server)<br/> [`eclipse/che-server`](https://quay.io/eclipse/che-server),<br/>[`eclipse/che-endpoint-watcher`](https://quay.io/eclipse/che-endpoint-watcher),<br/> [`eclipse/che-keycloak`](https://quay.io/eclipse/che-keycloak),<br/> [`eclipse/che-postgres`](https://quay.io/eclipse/che-postgres),<br/> [`eclipse/che-server`](https://quay.io/eclipse/che-server),<br/> [`eclipse/che-e2e`](https://quay.io/eclipse/che-e2e) |
| @tolusha| [che-operator](https://github.com/eclipse/che-operator/blob/master/RELEASE.md) | [make-release.sh](https://github.com/eclipse/che-operator/blob/master/make-release.sh) | ? | [`eclipse/che-operator`](https://quay.io/eclipse/che-operator)|
| @tolusha| [chectl](https://github.com/che-incubator/chectl/blob/master/RELEASE.md) | [make-release.sh](https://github.com/che-incubator/chectl/blob/master/make-release.sh) | [travis](https://travis-ci.org/che-incubator/chectl) | [chectl releases](https://github.com/che-incubator/chectl/releases)
RELEASE-TEMPLATE-END
-->

##### 1. Create branch for release preparation and next bugfixes:
* `git branch {branchname} #e.g 7.7.x`
* `git push --set-upstream origin {branchname}`
##### 2. Create PR for switch master to the next development version :
* `git branch set_next_version_in_master_{next_version} #e.g 7.8.0-SNAPSHOT`
* Update parent version : `mvn versions:update-parent versions:commit -DallowSnapshots=true -DparentVersion={next_version}`
* Update dependencies: `sed -i -e "s#{version_old}#{next_version}#" pom.xml`
* `git commit`
* `git push --set-upstream origin set_next_version_in_master_{next_version}`

```
git branch {branchname} # e.g 7.7.x
git push --set-upstream origin {branchname}
```

##### 2. Create PR for switch master to the next development version:

```
git branch set_next_version_in_master_{next_version} # e.g 7.8.0-SNAPSHOT
# Update parent version
mvn versions:update-parent versions:commit -DallowSnapshots=true -DparentVersion={next_version}
# Update dependencies
sed -i -e "s#{version_old}#{next_version}#" pom.xml
git commit
git push --set-upstream origin set_next_version_in_master_{next_version}
```

* Create PR
##### 3. In release branch of Che need to set up released version of plugin registry and plugins:
1 Update deploy_che.sh (should be deprecated soon - https://github.com/eclipse/che/issues/14069) default environment variables
2 Update default version of plugins and editors in che.properties to released tag e.g `7.7.0`
3 Update Helm charts with released tag e.g `7.7.0`

To do this execute commands:
* `cd .ci`
* on Linux machine: `set_tag_version_images_linux.sh {tag}`
* on MacOS: `set_tag_version_images_macos.sh {tag}`
* `git commit`
* `git push`
```
cd .ci
set_tag_version_images.sh 7.25.0
git commit
git push
```
##### 4. Start pre-release testing.
##### 5. If pre-release test passed need to merge branch to the `release` branch and push changes, release process will start by webhook:
* Set released parent version
* Update dependencies in pom.xml
* `git checkout release`
* `git merge -X theirs {branchname}`
* `git push -f`
* Update dependencies in pom.xml, then:
```
git checkout release
git merge -X theirs {branchname}
git push -f
```

##### 6. Close/release repository on Nexus
https://oss.sonatype.org/#stagingRepositories

Expand Down
4 changes: 2 additions & 2 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ if [[ "${BASEBRANCH}" != "${BRANCH}" ]]; then
git checkout "${BRANCH}"

cd .ci
./set_tag_version_images_linux.sh ${VERSION}
./set_tag_version_images.sh ${VERSION}
cd ..
git commit -a -s -m "Update image tags to ${VERSION} version"
fi
Expand All @@ -128,7 +128,7 @@ if [[ $PRERELEASE_TESTING -eq 1 ]]; then
# create pre-release branch and update image tags
git checkout release-candidate
cd .ci
./set_tag_version_images_linux.sh ${VERSION}
./set_tag_version_images.sh ${VERSION}
cd ..
git commit -a -s -m "Update image tags to ${VERSION} version"
git push origin release-candidate -f
Expand Down

0 comments on commit 2c7b403

Please sign in to comment.