Fix setting versions for docs (#19826)

Closes #19801
This commit is contained in:
Stian Thorgersen 2023-04-20 09:07:05 +02:00 committed by GitHub
parent 2484e87ffc
commit 6b3eb46314
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 45 deletions

View file

@ -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

View file

@ -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

View file

@ -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 -