Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70124

Encoded forward slashes in branch name break docker-compose build in multibranch pipeline projects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None

      When using a branch name which contains forward slashes ("/") in it (e.g. "feature/my-feature"), docker-compose based pipelines using Jenkins `BUILD_TAG` as the project name fail to build. This happens because slashes in the branch name get incorrectly url-encoded into "%2F" for the `JOB_NAME` variable, which in turns is used to create the `BUILD_TAG` variable. These encoded characters are passed in the docker-compose command option, which doesn't accept the "%" character, and this breaks the build.

      `BUILD_TAG` already takes care of replacing possible forward slashes with dashes ("-"), so it's not `BUILD_TAG` at fault here. Clearly, it's also not docker-compse at fault for not accepting special characters.

      The Bitbucket Source Plugin plugin, when assembling the `JOB_NAME` variable from the branch name, should simply preserve the slashes, according to the Pipeline Syntax:

      and that would be sufficient to unbreak the building of branches with slashes in their name.

            Unassigned Unassigned
            marcopus Marco
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: