简体   繁体   中英

aws opsworks chef, git cloning

I am using AWS opworks chef to test out deployment features and what not. I have local git server/repo on the network and i am simply trying to clone a repo to a directory within the instance from that server. I saw that chef has a resource for git,so in turn i added this to my recipe:

git 'test_deploy' do
      repository 'http://git@192.0.0.10/scm/in/test.git'
      revision 'master'
      action :sync
      destination '/home/ubuntu'   
 end

When Opsworks has finished, the instance is 'online' with no errors in the console output :

[2016-09-19T13:37:01+00:00] INFO: Processing git[test_deploy] action sync (test::default line 38)
[2016-09-19T13:37:02+00:00] INFO: Chef Run complete in 10.401210434 seconds

For a couple days now i had issues trying to get SSH working which to no avail and did not worked, so to tried and go around this i just used HTTP instead and made the repo public(to stop ssh prompt) to see if i can get anything on the instance when the 'setup' phase has been issued through opworks.

Considering there are no errors and when i log into the instance, no source code has been clone to the home user directory??? not sure how to debug this. Can anyone help me out here on what i am doing wrong, i dunno why its so finicky to just clone something??

PS the chef git resource documentation where that helpful for me (unless i am missing something here) kinda sad there are no clear examples. i did run ruby -c against my rb files to check the sytax which is all good

Any advice will be must appreciated

This was the answer to the initial problem below:

@Tensibai adding '/home/ubuntu/test' actually worked :O argh! instead of just doing '/home/ubuntu' this is very subtle it seems, as in the chef aws opworks console it did not actually display the git fatal error of 'directory already exist'. Rather, it just says the message above stating it executed/ran the git resource successfully.so painful. Also i assumed the git clone would create the folder it needs to put the source like the usual process. But thankyou for looking at it different way, this problem did catch me out partly cos the chef aws console didnt display that error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM