Closed marcovtwout closed 10 years ago
You can send a PR to develop
if you want, from what I understand it's a simple fix no ?
If I understand correctly, the function getCredentials() should get username and password from scm.php. I haven't looked much deeper yet, can you see why that fails?
https://github.com/Anahkiasen/rocketeer/blob/3591b74208e632ce5ffe090ffcd19330785feb77/src/Rocketeer/Scm/Svn.php#L111 https://github.com/Anahkiasen/rocketeer/blob/cc287bee0344b64e09eb970a357387c01db327bf/src/Rocketeer/Rocketeer.php#L356
Can you try to go in artisan tinker
and do app('rocketeer.rocketeer')->getCredentials()
?
Sorry, I am not using Lavarel?
Then try in tasks.php
or events.php
to do var_dump(Rocketeer::getFacadeApplication()['rocketeer.rocketeer']->getCredentials()
, see what that yields when you do rocketeer --version
or something.
I grabbed a copy of the source code and debugged into the following function: https://github.com/Anahkiasen/rocketeer/blob/master/src/Rocketeer/Rocketeer.php#L358
I modified it like this:
$credentials = $this->app['rocketeer.server']->getValue('credentials');
print_r($credentials);
//if (!$credentials) {
$credentials = $this->getOption('scm');
//}
print_r($credentials);
It returns:
// first:
Array
(
[repository] => svn://localhost/test
)
// second:
Array
(
[scm] => svn
[repository] => svn://localhost/test
[username] => xxx
[password] => xxx
[branch] => trunk
[shallow] => 1
[submodules] => 1
)
It seems to me we need the second piece of information. How exactly did you intend this piece of code to work?
The first one returns the data from prompt which should have been merged with the second data but hasn't been somehow which is why the condition passes but we don't have any credentials. Weird, not sure how that happened.
What do you mean "from prompt". Do you mean the questions on rocketeer setup
?
No I mean, if you leave a field empty, Rocketeer prompts you for its value, this is used to not have to track credentials in the Rocketeer config while still saving it somewhere safe to not ask for it everytime. That's why the config isn't used directly.
Ah, right. I do not see any prompt for credentials.
Note that I am using a url in the svn:// format. Does this have anything to do with it?
I also found: https://github.com/Anahkiasen/rocketeer/pull/54
Is svn://
similar to git://
? If yes you may want to switch to HTTP cloning unless your server has SSH access to your repo.
Yes and no:
The svn:// protocol provides direct access to the svn-server over port 3690, while the http protocol provides indirect access (with WebDav). This is different to svn+ssh, in which case you also require ssh access to the remote svn server. Access through the ssh protocol is faster and does not require to set up an additional webserver like Apache for the http(s) tunneling.
Concluding, like you said, Rocketeer should prompt for the username/password inputs, but does not.
I just started using Rocketeer (in combination with Laravel) and I tried to deploy the application from my SVN server. I also ran into the problem that svn stops with the following error:
svn: Can't get username or password
My settings for the scm.php are all configured:
'scm' => 'svn', 'repository' => 'svn://[ip]:[port]/[repo]', 'username' => 'xxx', 'password' => 'xxx',
Too bad because Rocketeer seems promising, but this is blocking to deploy my application
@Anahkiasen I see this bug is labeled as unverified? I think this is an important feature for svn users, do you need more information to fix the issue?
Any progress on this issue?
Is this still happening on develop ?
This issue is not fixed yet on latest develop with newly created config.
C:\www\test>php ..\rocketeer\bin\rocketeer deploy --verbose
-- Running: Deploy (Deploys the website)
Cloning repository in "/data/www/example.com/releases/20140812195423"
[user@example] (production#0) svn: E170001: Unable to connect to a repository at URL 'svn://example.com/test/trunk'
[user@example] (production#0) svn: E170001: Can't get username or password
Can you run that with --pretend
see if the credentials flags are properly passed to svn co ?
They are not passed, exactly like the earlier log in the top post describes. Username and password fields are set in scm.php.
rocketeer deploy --pretend
-- Running: Deploy (Deploys the website)
Cloning repository in "/data/www/example.com/releases/20140813181447"
svn co svn://example.com/test/trunk /data/www/example.com/releases/20140813181447 --non-interactive
Note: It does not matter if I leave the username and password in scm.php empty, I am not prompted for credentials in that case.
Should be fixed by 0e32fb3200c298e4a01ef9db254493ede90680d5, will reopen if the issue still occurs.
Confirmed, thanks.
I have the same issue but for git cloning with v 2.1.2 on debian 7
I cannot manage to get the repository cloned with a password (prompted or not ):
my scm.php:
// The SCM used (supported: "git", "svn")
'scm' => 'git',
'repository' => 'user@xx.xx.xx.xx:/path/to/repo'
'username' => 'user',
'password' => ''',
'branch' => 'dev',
'shallow' => true,
'submodules' => true,
rocketeer tries do to : git clone "user@xx.xx.xx.xx:/path/to/repo "/path/to/prod/releases/20150811190024" --branch="dev" --depth="1"
git clone "user@xx.xx.xx.xx:/path/to/repo" works on my terminal, it prompts me the password.
Kind regards
I have setup Rocketeer to deploy using my svn repository. When I execute
rocketeer deploy
, I run into the following error:Final lines from logs/production--xxx.log:
My scm.php looks like this:
When I look at the source code, the username and password should be passed to the checkout command, but as you can see in the log file, they are being omitted. https://github.com/Anahkiasen/rocketeer/blob/3591b74208e632ce5ffe090ffcd19330785feb77/src/Rocketeer/Scm/Svn.php#L80