Sometimes it seems that the CLI needs the password again to complete the requested task. For a deploy operation, the password prompt happens after the installation file has been prepared and uploaded.
Then, after the password is re-entered, it has to do at least the upload again (which can take some time).
Is it possible to do the password check right at the start, to avoid this repetition?
Example of the process:
Deploying to myserver
Saving tar file to:
/home/ubuntu/workspace/temporary-captain-to-deploy.tar
Pushing last commit on master: 5eb941187cc6be39rac8105e62a3d943bf4becd1
Uploading file to https://captain.myserver.mydomain.com
This might take several minutes. PLEASE BE PATIENT...
[after a long time uploading file...]
Your auth token is not valid anymore. Try to login again.
? Please enter your password for https://captain.myserver.mydomain.com [hidden]
You are now logged back in to https://captain.myserver.mydomain.com
Saving tar file to:
/home/ubuntu/workspace/temporary-captain-to-deploy.tar
Pushing last commit on master: 5eb941187cc6be39rac8105e62a3d943bf4becd1
Uploading file to https://captain.myserver.mydomain.com
uploading [=====---------------] 25% (ETA 74.6s)
Password is required to be re-entered if Captain has been restarted. Usually, it's not needed.
For use in automated process, there is a command where you can pre-specify your username and password:
captainduckduck deploy -s -h https://captain.root.domain.com -a app-name -p password -b branchName
This will never ask for the password again.
I know that a password can be set explicitly in the command line, but my suggestion was merely that, where the password is not specified (which is likely to be most common, particularly where the user is sat at the console typing commands and patiently waiting for the deploy to finish), the check is made not after preparing and uploading the tar file (and then finding that it cannot proceed) but instead made before preparing and uploading the tar file. Is that not possible/sensible?
I see. It requires some rewrite of deploy. I'll look into it on the next release.
This enhancement would be appreciated. There's been a few times recently where I've set the deploy process going, seen the "uploading" message, and gone away while the deploy process continues, only to come back to find that the deploy process has not completed, asking for a password to be entered again. If this check could be done at the start, it would be much better :)
This is on my radar and will be implemented soon.
Fixed in CLI 1.0.13 available on npm
https://github.com/githubsaturn/captainduckduck/commit/dc765fdf96342b5a19c501c3350d684927edd1db
Most helpful comment
Fixed in CLI 1.0.13 available on npm
https://github.com/githubsaturn/captainduckduck/commit/dc765fdf96342b5a19c501c3350d684927edd1db