From 6b3eb463144763ade3afb4b4d29378eecafffc2b Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Thu, 20 Apr 2023 09:07:05 +0200 Subject: [PATCH] Fix setting versions for docs (#19826) Closes #19801 --- docs/documentation/set-version.sh | 12 ------------ docs/documentation/sync.sh | 29 ----------------------------- set-version.sh | 8 ++++---- 3 files changed, 4 insertions(+), 45 deletions(-) delete mode 100755 docs/documentation/set-version.sh delete mode 100755 docs/documentation/sync.sh diff --git a/docs/documentation/set-version.sh b/docs/documentation/set-version.sh deleted file mode 100755 index 830c897093..0000000000 --- a/docs/documentation/set-version.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -e - -VERSION=$1 -SHORT_VERSION=`echo $VERSION | awk -F '.' '{ print $1"."$2 }'` -NPM_VERSION=`echo $VERSION | sed 's/.Final//' | sed 's/.CR/-cr./' | sed 's/.Beta/-beta./' | sed 's/.Alpha/-alpha./'` - -mvn versions:set -DnewVersion=$VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=* - -sed -i 's/:project_version: .*/:project_version: '$VERSION'/' topics/templates/document-attributes.adoc -sed -i 's/:project_versionMvn: .*/:project_versionMvn: '$VERSION'/' topics/templates/document-attributes.adoc -sed -i 's/:project_versionNpm: .*/:project_versionNpm: '$NPM_VERSION'/' topics/templates/document-attributes.adoc -sed -i 's/:project_versionDoc: .*/:project_versionDoc: '$SHORT_VERSION'/' topics/templates/document-attributes.adoc diff --git a/docs/documentation/sync.sh b/docs/documentation/sync.sh deleted file mode 100755 index 3a92f272f5..0000000000 --- a/docs/documentation/sync.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -BRANCHES="upstream/master prod/3.4.x prod/4.8.x prod/9.0.x" - -echo "-----------------------------------------------------------------" - -echo "Fetching remotes" -echo "" - -git fetch upstream -git fetch gitlab -git fetch prod - -echo "-----------------------------------------------------------------" - -for i in $BRANCHES; do - TARGET_BRANCH=`echo $i | cut -d '/' -f 2` - - echo "Syncing $i to gitlab/$TARGET_BRANCH" - echo "" - - git branch | grep " tmp-$TARGET_BRANCH$" &>/dev/null && git branch -D tmp-$TARGET_BRANCH - git checkout $i -b tmp-$TARGET_BRANCH - git push gitlab tmp-$TARGET_BRANCH:$TARGET_BRANCH - git checkout master - git branch -D tmp-$TARGET_BRANCH - - echo "-----------------------------------------------------------------" -done diff --git a/set-version.sh b/set-version.sh index 41891f3a07..985224a496 100755 --- a/set-version.sh +++ b/set-version.sh @@ -17,10 +17,10 @@ cd - # Documentation cd docs/documentation -SHORT_VERSION=`echo $VERSION | awk -F '.' '{ print $1"."$2 }'` -sed -i 's/:project_version: .*/:project_version: '$VERSION'/' topics/templates/document-attributes.adoc -sed -i 's/:project_versionMvn: .*/:project_versionMvn: '$VERSION'/' topics/templates/document-attributes.adoc -sed -i 's/:project_versionNpm: .*/:project_versionNpm: '$VERSION'/' topics/templates/document-attributes.adoc +SHORT_VERSION=`echo $NEW_VERSION | awk -F '.' '{ print $1"."$2 }'` +sed -i 's/:project_version: .*/:project_version: '$NEW_VERSION'/' topics/templates/document-attributes.adoc +sed -i 's/:project_versionMvn: .*/:project_versionMvn: '$NEW_VERSION'/' topics/templates/document-attributes.adoc +sed -i 's/:project_versionNpm: .*/:project_versionNpm: '$NEW_VERSION'/' topics/templates/document-attributes.adoc sed -i 's/:project_versionDoc: .*/:project_versionDoc: '$SHORT_VERSION'/' topics/templates/document-attributes.adoc cd -