Skip to content

Commit

Permalink
chore: remove Che Parent from release scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>
  • Loading branch information
mkuznyetsov committed Nov 5, 2024
1 parent 63cc78d commit 053b21a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 93 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ on:
description: 'The version that is going to be released. Should be in format 7.y.z'
required: true
default: ''
releaseParent:
description: 'If true, will also release Che Parent.'
required: false
default: 'false'
versionParent:
description: 'Specify Che Parent version here'
required: false
default: '7.15.0'
forceRecreateTags:
description: 'If true, tags will be overriden and regenerated. Use with caution.'
required: false
Expand All @@ -49,13 +41,6 @@ jobs:
with:
path: che-server
fetch-depth: 0
- uses: actions/checkout@v3
if: ${{ github.event.inputs.releaseParent == 'true' }}
with:
repository: eclipse/che-parent
token: ${{ secrets.CHE_BOT_GITHUB_TOKEN }}
path: che-parent
fetch-depth: 0
- name: Check existing tag
run: |
if [[ "$FORCE_RECREATE_TAGS" == "false" ]] && [[ $(cd che && git ls-remote --exit-code origin refs/tags/${{ github.event.inputs.version }}) ]]; then
Expand Down Expand Up @@ -113,8 +98,6 @@ jobs:
export CHE_GITHUB_SSH_KEY=${{ secrets.CHE_GITHUB_SSH_KEY}}
export CHE_NPM_AUTH_TOKEN=${{ secrets.CHE_NPM_AUTH_TOKEN}}
export RELEASE_CHE_PARENT="${{ github.event.inputs.releaseParent }}"
export VERSION_CHE_PARENT="${{ github.event.inputs.versionParent }}"
export DEPLOY_TO_NEXUS="${{ github.event.inputs.deployOnNexus }}"
export AUTORELEASE_ON_NEXUS="${{ github.event.inputs.autoReleaseOnNexus }}"
export REBUILD_FROM_EXISTING_TAGS="${{ github.event.inputs.rebuildFromExistingTags }}"
Expand Down
3 changes: 0 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Automated release workflow
Release is performed with GitHub Actions workflow [release.yml](https://github.com/eclipse/che/actions/workflows/release.yml).
It is also used to release [Che Parent](https://github.com/eclipse/che-parent), if appropriate input parameter `releaseParent` is set to true.
The release will perform the build of Maven Artifacts, build and push of all nesessary docker images, and bumping up development version.

[make-release.sh](https://github.com/eclipse/che/blob/master/make-release.sh) is the script that can be used for standalone release outside of GitHub Actions. However, ensure that all environment variables are set in place before invoking `./make-release.sh`, similarly to how it is outlined in [release.yml](https://github.com/eclipse/che/actions/workflows/release.yml):

RELEASE_CHE_PARENT - if `true`, will perform the release of Che Parent as well.
VERSION_CHE_PARENT - if RELEASE_CHE_PARENT is `true`, here the version of Che Parent must be provided.
REBUILD_FROM_EXISTING_TAGS - if `true`, release will not create new tag, but instead checkout to existing one. Use this to rerun failed attempts, without having to recreate the tag.
BUILD_AND_PUSH_IMAGES - if `true`, will build all asociated images in [dockerfiles](https://github.com/eclipse/che/tree/master/dockerfiles) directory. Set `false`, if this step needs to be skipped.
BUMP_NEXT_VERSION - if `true`, will increase the development versions in main and bugfix branches. Set false, if this step needs to be skipped
75 changes: 2 additions & 73 deletions make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,9 @@ evaluateCheVariables() {
BASEBRANCH="${BRANCH}"
fi
echo "Basebranch: ${BASEBRANCH}"
echo "Release che-parent: ${RELEASE_CHE_PARENT}"
echo "Version che-parent: ${VERSION_CHE_PARENT}"
}

checkoutProjects() {
if [[ ${RELEASE_CHE_PARENT} = "true" ]]; then
checkoutProject git@github.com:eclipse/che-parent
fi
checkoutProject git@github.com:eclipse-che/che-server
}

Expand Down Expand Up @@ -87,11 +82,6 @@ checkoutProject() {
}

checkoutTags() {
if [[ ${RELEASE_CHE_PARENT} = "true" ]]; then
cd che-parent
git checkout ${CHE_VERSION}
cd ..
fi
cd che-server
git checkout ${CHE_VERSION}
cd ..
Expand Down Expand Up @@ -145,9 +135,6 @@ commitChangeOrCreatePR() {
}

createTags() {
if [[ $RELEASE_CHE_PARENT = "true" ]]; then
tagAndCommit che-parent
fi
tagAndCommit che-server
}

Expand All @@ -171,23 +158,9 @@ tagAndCommit() {
}

prepareRelease() {
if [[ $RELEASE_CHE_PARENT = "true" ]]; then
pushd che-parent >/dev/null
# Install previous version, in case it is not available in central repo
# which is needed for dependent projects
mvn clean install
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${VERSION_CHE_PARENT}
mvn clean install
popd >/dev/null
echo "[INFO] Che Parent version has been updated to ${VERSION_CHE_PARENT}"
fi

pushd che-server >/dev/null
if [[ $RELEASE_CHE_PARENT = "true" ]]; then
mvn versions:update-parent -DgenerateBackupPoms=false -DallowSnapshots=false -DparentVersion=[${VERSION_CHE_PARENT}]
fi
mvn versions:set -DgenerateBackupPoms=false -DallowSnapshots=false -DnewVersion=${CHE_VERSION}
echo "[INFO] Che Server version has been updated to ${CHE_VERSION} (parentVersion = ${VERSION_CHE_PARENT})"
echo "[INFO] Che Server version has been updated to ${CHE_VERSION} "

# Replace dependencies in che-server parent
sed -i -e "s#<che.version>.*<\/che.version>#<che.version>${CHE_VERSION}<\/che.version>#" pom.xml
Expand All @@ -196,8 +169,7 @@ prepareRelease() {
# TODO pull parent pom version from VERSION file, instead of being hardcoded
pushd typescript-dto >/dev/null
sed -i -e "s#<che.version>.*<\/che.version>#<che.version>${CHE_VERSION}<\/che.version>#" dto-pom.xml
sed -i -e "/<groupId>org.eclipse.che.parent<\/groupId>/ { n; s#<version>.*<\/version>#<version>${VERSION_CHE_PARENT}<\/version>#}" dto-pom.xml
echo "[INFO] Dependencies updated in che typescript DTO (parent = ${VERSION_CHE_PARENT}, che server = ${CHE_VERSION})"
echo "[INFO] Dependencies updated in che typescript DTO (che server = ${CHE_VERSION})"
popd >/dev/null

# run mvn license format, in case some files that have old license headers have been updated
Expand All @@ -208,29 +180,6 @@ prepareRelease() {
releaseCheServer() {
set -x
tmpmvnlog=/tmp/mvn.log.txt
if [[ $RELEASE_CHE_PARENT = "true" ]]; then
pushd che-parent >/dev/null
rm -f $tmpmvnlog || true
set +e
mvn clean install -ntp -U -Pcodenvy-release -Dgpg.passphrase=$CHE_OSS_SONATYPE_PASSPHRASE | tee $tmpmvnlog
EXIT_CODE=$?
set -e
# try maven build again if we receive a server error
if grep -q -E "502 - Bad Gateway" $tmpmvnlog; then
rm -f $tmpmvnlog || true
mvn clean install -ntp -U -Pcodenvy-release -Dgpg.passphrase=$CHE_OSS_SONATYPE_PASSPHRASE | tee $tmpmvnlog
EXIT_CODE=$?
fi
# check log for errors if build successful; if failed, no need to check (already failed)
if [ $EXIT_CODE -eq 0 ]; then
checkLogForErrors $tmpmvnlog
echo 'Build of che-parent: Success!'
else
echo '[ERROR] 2. Build of che-parent: Failed!'
exit $EXIT_CODE
fi
popd >/dev/null
fi

pushd che-server >/dev/null
rm -f $tmpmvnlog || true
Expand Down Expand Up @@ -302,35 +251,15 @@ bumpVersion() {
set -x
echo "[info]bumping to version $1 in branch $2"

if [[ $RELEASE_CHE_PARENT = "true" ]]; then
pushd che-parent >/dev/null
git checkout $2
#install previous version, in case it is not available in central repo
#which is needed for dependent projects

mvn clean install
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${CHE_VERSION}
mvn clean install
# run mvn license format, in case some files that have old license headers have been updated
mvn license:format
commitChangeOrCreatePR ${CHE_VERSION} $2 "pr-${2}-to-${1}"
popd >/dev/null
fi

pushd che-server >/dev/null
git checkout $2
if [[ $RELEASE_CHE_PARENT = "true" ]]; then
mvn versions:update-parent -DgenerateBackupPoms=false -DallowSnapshots=true -DparentVersion=[${VERSION_CHE_PARENT}]
fi

# compute current version of root pom
current_root_pom_version=$(grep "<che.version>" pom.xml | sed -r -e "s#.+<che.version>([^<>]+)</che.version>.*#\1#")

mvn versions:set -DgenerateBackupPoms=false -DallowSnapshots=true -DnewVersion=$1
sed -i -e "s#<che.version>.*<\/che.version>#<che.version>$1<\/che.version>#" pom.xml
pushd typescript-dto >/dev/null
sed -i -e "s#<che.version>.*<\/che.version>#<che.version>${1}<\/che.version>#" dto-pom.xml
sed -i -e "/<groupId>org.eclipse.che.parent<\/groupId>/ { n; s#<version>.*<\/version>#<version>${VERSION_CHE_PARENT}<\/version>#}" dto-pom.xml
popd >/dev/null

# update integration tests to new root pom version
Expand Down

0 comments on commit 053b21a

Please sign in to comment.