0

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?

soupdiver
  • 797
  • 2
  • 8
  • 26

2 Answers2

0

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 the opsworks-agent-cli command:

sudo opsworks-agent-cli run_command deploy

Shlomo Swidler
  • 721
  • 5
  • 5
0

You can also configure an SSH key then do a git clone through SSH:

git clone --depth 1 git@github.com:MyPathTo/MyRepo.git --branch 1.x --single-branch /var/www/temp
J. Lawson
  • 86
  • 10