-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Add ability to deploy js adapter to maven repository. #23425
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl . | ||
| mvn help:evaluate -Dexpression=project.version -DforceStdout --quiet --non-recursive -pl . |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,32 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| NEW_VERSION=$1 | ||
| NEW_NPM_VERSION=${2:-${1}} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still think we should not be using a seperate version for NPM. Instead the input versions should all adhere to valid semantic versions.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line has nothing to do with using valid semantic versions. It allows our downstream build script to override the NPM version if needed (mainly for debug/investigation purpose).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would it need to do that? Wouldn't you just override all the versions?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The internal build system assigns version to keycloak (and aligns dependencies) before start of maven build.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Or the version can be a valid semantic version, in which case it would work for both. |
||
|
|
||
| # Maven | ||
| mvn versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=* | ||
| if [ $NEW_VERSION == 'use_current' ] ; then | ||
| # obtain NEW_VERSION from maven pom file | ||
| # - useful for downstream projects which already set the version in pom files | ||
| NEW_VERSION=$(./get-version.sh) | ||
| NEW_NPM_VERSION=$(echo $NEW_VERSION | awk -F '.' '{ print $1"."$2"."$3"+"$4 }') | ||
| else | ||
|
Comment on lines
+6
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the purpose of this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Follow up from #23425 (comment). |
||
| # Maven | ||
| mvn versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false -DgroupId=org.keycloak* -DartifactId=* | ||
| fi | ||
|
|
||
| # Docker | ||
| sed -i "s/ENV KEYCLOAK_VERSION .*/ENV KEYCLOAK_VERSION $NEW_VERSION/" quarkus/container/Dockerfile | ||
|
|
||
| # Documentation | ||
| cd docs/documentation | ||
| SHORT_VERSION=`echo $NEW_VERSION | awk -F '.' '{ print $1"."$2 }'` | ||
| SHORT_VERSION=`echo $NEW_NPM_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_versionNpm: .*/:project_versionNpm: '$NEW_NPM_VERSION'/' topics/templates/document-attributes.adoc | ||
| sed -i 's/:project_versionDoc: .*/:project_versionDoc: '$NEW_VERSION'/' topics/templates/document-attributes.adoc | ||
| cd - | ||
|
|
||
| # Keycloak JS | ||
| echo "$(jq '. += {"version": "'$NEW_VERSION'"}' js/libs/keycloak-js/package.json)" > js/libs/keycloak-js/package.json | ||
| echo "$(jq '. += {"version": "'$NEW_NPM_VERSION'"}' js/libs/keycloak-js/package.json)" > js/libs/keycloak-js/package.json | ||
|
|
||
| # Keycloak Admin Client | ||
| echo "$(jq '. += {"version": "'$NEW_VERSION'"}' js/libs/keycloak-admin-client/package.json)" > js/libs/keycloak-admin-client/package.json | ||
| echo "$(jq '. += {"version": "'$NEW_NPM_VERSION'"}' js/libs/keycloak-admin-client/package.json)" > js/libs/keycloak-admin-client/package.json | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks unnecessarily complex, and adds some custom Maven registry settings just for this module. Why not just attach the tgz with:
and change the configuration for
maven-deploy-pluginto `true. That way it's just uploaded along the other artifacts.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can certainly do this. I just didn't want to alter original maven build behavior.