Harden .evergreen/publish.sh: fix RELEASE default expansion and use arrays for task lists

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Java Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Following this PR in Mongo Hibernate https://github.com/mongodb/mongo-hibernate/pull/196 

      mongo-hibernate PR fixed several release-publishing defects; parts of it could be applied to the Java driver's .evergreen/publish.sh:

      1. RELEASE=${RELEASE:false} is missing the - in the default-value expansion (${RELEASE:-false}). As written it is substring expansion, so the default of false is never applied and RELEASE stays empty when unset. The release path is currently only entered because the comparison [ "$RELEASE" == "true" ] fails for the empty string, i.e., correctness is accidental.
      2. TASK="publishArchives closeAndReleaseSonatypeStagingRepository" depends on unquoted word-splitting. In the per-Scala-version invocations (:bson-scala:${TASK} :driver-scala:${TASK}), the expansion attaches the project prefix only to the first word — closeAndReleaseSonatypeStagingRepository runs as an unprefixed root task, which is unintended even if currently harmless. Replace TASK (and SYSTEM_PROPERTIES) with bash arrays expanded as "${TASKS[@]}" so each task is passed as a distinct, explicit argument

       

            Assignee:
            Ross Lawley
            Reporter:
            Almas Abdrazak
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: