They use ssh+git:// as their protocol to access the remote repository (do not ask me why...)
The remote repository URL ends up looking like: ssh+git://{login}@git.{datacenter_location}.gpaas.net/{vhost}.git
Because of the + character, there are no matches in regular expression in the git_push method and the deploy fails.
Workaround
After creating the remote repository and failing the deploy a first time, I escape the + character in my _deploy.yml file: ssh\+git://{login}@git.{datacenter_location}.gpaas.net/{vhost}.git
I can then retry the deploy and it works.
Alternative: I can also enter the .deploy/ directory and do a git push deploy master from there.
Proposed Solution
Use Regexp::quote to escape the @repo variable, which is the most likely to contain a character with a special meaning in a regular expression like it was in my case.
Overview
Use
Regexp::quote
method to escape the@repo
variable when checking if theremote
deploy repository exists in thegit_push
method.Problem
ssh+git://
as their protocol to access the remote repository (do not ask me why...)ssh+git://{login}@git.{datacenter_location}.gpaas.net/{vhost}.git
+
character, there are no matches in regular expression in thegit_push
method and the deploy fails.Workaround
+
character in my_deploy.yml
file:ssh\+git://{login}@git.{datacenter_location}.gpaas.net/{vhost}.git
.deploy/
directory and do agit push deploy master
from there.Proposed Solution
Use
Regexp::quote
to escape the@repo
variable, which is the most likely to contain a character with a special meaning in a regular expression like it was in my case.