-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins: v2.378
Bitbucket Branch Source Plugin: Version791.vb_eea_a_476405b
OS: Ubuntu 22.04 on amd64 Linux 5.15.0-53-generic
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.specification.vendor: Oracle Corporation
java.vm.specification.version: 11
java.vm.vendor: Ubuntu
java.vm.version: 11.0.17+8-post-Ubuntu-1ubuntu222.04Jenkins: v2.378 Bitbucket Branch Source Plugin: Version791.vb_eea_a_476405b OS: Ubuntu 22.04 on amd64 Linux 5.15.0-53-generic java.vm.name: OpenJDK 64-Bit Server VM java.vm.specification.vendor: Oracle Corporation java.vm.specification.version: 11 java.vm.vendor: Ubuntu java.vm.version: 11.0.17+8-post-Ubuntu-1ubuntu222.04
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.