This is an old revision of the document!
update d'une version CAS a une autres, exemple ici passage d'un 7.1.4 a 7.2.6
l'objectif etant de conserver nos parametrage, dependencies ldap, CSS / views etc …
summary
OpenRewrite recipes are produced by CAS itself and are essentially YAML files that make minimally invasive changes to your CAS build allowing you to upgrade from one version to the next with minimal effort. The recipe contains almost everything that is required for a CAS build system to navigate from one version to other and automates tedious aspects of the upgrade such as finding the correct versions of CAS, relevant libraries and plugins as well as any possible structural changes to one’s CAS build.
[root@cas cas-overlay-template]# ./gradlew casVersion --no-configuration-cache -q Using Amazon Corretto as the JVM vendor for the Java toolchain Building CAS version 7.1.4 with application server -tomcat 7.1.4
ask the build to discover and list all upgrade recipes that might be applicable for the task at hand
[root@cas cas-overlay-template]# time ./gradlew --init-script openrewrite.gradle rewriteDiscover -PtargetVersion=7.2.6 --no-configuration-cache --no-daemon | grep "org.apereo.cas"
org.apereo.cas.cas726
org.apereo.cas.cas725
org.apereo.cas.cas724
org.apereo.cas.cas720
org.apereo.cas.cas721
org.apereo.cas.cas723
org.apereo.cas.cas722
org.apereo.cas.cas710-RC5
org.apereo.cas.cas710-RC6
org.apereo.cas.cas710-RC2
org.apereo.cas.cas710-RC1
org.apereo.cas.cas720-RC1
org.apereo.cas.cas710
org.apereo.cas.cas720-RC2
org.apereo.cas.cas720-RC3
org.apereo.cas.cas720-RC6
org.apereo.cas.cas700
org.apereo.cas.cas720-RC4
org.apereo.cas.cas720-RC5
real 0m31.579s
Next, we can dry-run our selected recipe, org.apereo.cas.cas702, and see which files would be changed in the build log. This does not alter your source files on disk at all. This goal can be used to preview the changes that would be made by the active recipes.
[root@cas cas-overlay-template]# time ./gradlew --init-script openrewrite.gradle rewriteDryRun -PtargetVersion=7.2.6 -DactiveRecipe="org.apereo.cas.cas726" --no-configuration-cache --no-daemon
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.12.1/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build
Configuration on demand is an incubating feature.
> Configure project :
Using Amazon Corretto as the JVM vendor for the Java toolchain
Building CAS version 7.1.4 with application server -tomcat
> Task :rewriteDryRun
Validating active recipes
Scanning sources in project :
Using active styles []
There were problems parsing some source files, run with --info to see full stack traces
There were problems parsing build.gradle
There were problems parsing gradle/tasks.gradle
There were problems parsing helm/cas-server/templates/casconfig-configmap.yaml
There were problems parsing helm/cas-server/templates/ingress.yaml
There were problems parsing helm/cas-server/templates/role.yaml
There were problems parsing helm/cas-server/templates/rolebinding.yaml
There were problems parsing helm/cas-server/templates/script-configmap.yaml
There were problems parsing helm/cas-server/templates/service.yaml
There were problems parsing helm/cas-server/templates/serviceaccount.yaml
There were problems parsing helm/cas-server/templates/statefulset.yaml
There were problems parsing helm/cas-server/templates/tests/test-cas-server.yaml
All sources parsed, running active recipes: org.apereo.cas.cas726
These recipes would make changes to gradle.properties:
org.openrewrite.gradle.AddProperty: {key=cas.version, value=7.2.6, overwrite=true, filePattern=gradle.properties}
org.openrewrite.gradle.AddProperty: {key=version, value=7.2.6, overwrite=true, filePattern=gradle.properties}
org.openrewrite.gradle.AddProperty: {key=springBootVersion, value=3.4.4, overwrite=true, filePattern=gradle.properties}
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
org.openrewrite.gradle.AddProperty: {key=tomcatVersion, value=10.1.43, overwrite=false, filePattern=gradle.properties}
org.openrewrite.gradle.AddProperty: {key=jibVersion, value=3.4.5, overwrite=true, filePattern=gradle.properties}
These recipes would make changes to gradle/wrapper/gradle-wrapper.jar:
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
These recipes would make changes to gradlew:
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
These recipes would make changes to gradlew.bat:
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
These recipes would make changes to gradle/wrapper/gradle-wrapper.properties:
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
These recipes would make changes to gradlew:
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
These recipes would make changes to gradlew.bat:
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
These recipes would make changes to gradle/wrapper/gradle-wrapper.jar:
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
These recipes would make changes to gradle/wrapper/gradle-wrapper.properties:
org.openrewrite.gradle.UpdateGradleWrapper: {version=8.13, addIfMissing=true}
Report available:
/opt/cas-src/cas-overlay-template/build/reports/rewrite/rewrite.patch
Estimate time saved: 45m
Run 'gradle rewriteRun' to apply the recipes.
[Incubating] Problems report is available at: file:///opt/cas-src/cas-overlay-template/build/reports/problems/problems-report.html
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.12.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD SUCCESSFUL in 2m 13s
6 actionable tasks: 2 executed, 4 up-to-date
real 2m14.409s
user 2m31.799s
sys 0m12.976s