I've got a stack in Amazon OpsWorks and within this stack I got a RailsApp Layer. The repository is only accessible via https and is protected with username and password. On my machine I can clone the repo via:
git clone https://username:password@XXX.com/repo.git
OpsWorks complains that the URL is invalid because of the :
Is there a way to set the password explicitly before chef tries to clone the repo?
All the articles I red just describe how to cache credentials but they have to be typed in manually the first time. I look for a way to fully automate this.
Any ideas?
Best Answer
Are you trying to manually clone the repo? Then a
.netrc
file is a fine answer.The OpsWorks recipes accomplish this during the deploy event by setting up a custom
.netrc
file for the deploy user. Instead of cloning the repo manually, you can run the OpsWorks deploy event either from the OpsWorks UI, or manually on the instance (after you have run it at least once from the UI) with theopsworks-agent-cli
command:sudo opsworks-agent-cli run_command deploy