Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2230

Quickstarts release: Automate syncing stable from development branch

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None
    • 2020 Week 46-48 (from Nov 9), 2020 Week 49-51 (from Nov 30), 2020 Week 52-03 (from Dec 21), 2021 Week 04-06 (from Jan 25)
    • 5
    • Undefined
    • NEW
    • NEW

      These commands worked well for the 8.0.0.Beta1 release.
      They should go into a script somewhere and it needs more verification fail fasts (including all the TODO's).

      export newVersion=8.0.0.Beta1
      
      git checkout stable
      git pull --rebase
      git reset --hard origin/development
      
      ################################################
      # Update OptaPlanner version
      ################################################
      
      mvn versions:set-property -Dproperty="version.org.optaplanner" -DnewVersion="${newVersion}" -DgenerateBackupPoms=false
      # In case it doesn't work, this works, but it hard codes the versions-maven-plugin version, which is bad:
      # mvn org.codehaus.mojo:versions-maven-plugin:2.8.1:set-property -Dproperty="version.org.optaplanner" -DnewVersion="${newVersion}" -DgenerateBackupPoms=false
      
      sed -i -E "s/def optaplannerVersion = \"[^\"\\s]+\"/def optaplannerVersion = \"${newVersion}\"/" */build.gradle
      
      mvn versions:update-parent -DparentVersion="${newVersion}" -DgenerateBackupPoms=false
      # In case it doesn't work, this works, but it hard codes the versions-maven-plugin version, which is bad:
      # mvn org.codehaus.mojo:versions-maven-plugin:2.8.1:update-parent -DparentVersion="${newVersion}" -DgenerateBackupPoms=false
      
      # Required to upgrade the aggregator and distribution modules.
      mvn versions:update-child-modules  -DgenerateBackupPoms=false
      
      // TODO Check if grep for "SNAPSHOT" in pom.xml and build.gradle has 0 results except for "1.0-SNAPSHOT" and fail fast if it doesn't!
      
      ################################################
      # Remove jboss Nexus from Maven and Gradle files
      ################################################
      
      sed -i ':a;N;$!ba;s/\n *<repositories>.*<\/repositories>//g' */pom.xml
      sed -i ':a;N;$!ba;s/\n *<repositories>.*<\/repositories>//g' pom.xml
      sed -i ':a;N;$!ba;s/\n *\/\/ To get snapshots during development[^{}]*maven {[^{}]*mavenContent {[^{}]*snapshotsOnly[^{}]*}[^{}]*}//g' */build.gradle
      
      // TODO Check if grep for "repository.jboss.org" in pom.xml and build.gradle has 0 results and fail fast if it doesn't!
      
      ################################################
      # Commit
      ################################################
      
      git add ...
      git commit -m"[Release] Bump version to ${newVersion}"
      
      // TODO force push (but toggle the forcing pushing off and one first)
      

      See also this discussion on how Quarkus does it:
      https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/How.20is.20quickstarts.20master.20synced.20from.20development.3F

            adupliak Anna Dupliak
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: