ansistrano / deploy

Ansible role to deploy scripting applications like PHP, Python, Ruby, etc. in a capistrano style
https://ansistrano.com
MIT License
2.37k stars 343 forks source link

Question : directory structure and git repository #281

Closed mediafigaro closed 6 years ago

mediafigaro commented 6 years ago

Hi, when I deploy I get the correct 3 repositories into my ansistrano_deploy_to directory but into current (= ./releases/201801xxxxxxxxx/) I don't have the sources but a directory which is the name (of course) of my git repository eg. git@bucket.org:user/directory.git. What may be misconfigured by me or how should I handle this to get my Symfony directories and files directly under current/ ?

Otherwise that would mean I'd have to write the directory name into these commands : release_console_path: "{{ ansistrano_release_path.stdout }}/bin/console" => release_console_path: "{{ ansistrano_release_path.stdout }}/directory/bin/console" :(

thanks for your help and code !

mediafigaro commented 6 years ago

hi @ricardclau :)

ricardclau commented 6 years ago

Hey, this is weird, it never happened to me before

Maybe if you can paste your playbook I will be able to provide some insight

mediafigaro commented 6 years ago

thanks @ricardclau ! : https://gist.github.com/mediafigaro/f0284287b94d14bb542af11bc5d6722d

mediafigaro commented 6 years ago

my fault I was with the rsync option instead of "git"...

maciejmatczak commented 5 years ago

Hi @ricardclau, why it is chosen to have different folder structure whether rsync or git is used? Exactly as @mediafigaro stated, there is additional directory when deploying strategy is rsync. Like so (2nd one was done with rsync):

django_lesson_1
├── current -> ./releases/20181112193047Z
├── releases
│   ├── 20181112191908Z
│   │   ├── ansible
│   │   ├── home
│   │   ├── my_project
│   │   ├── users
│   │   └── venv_dev
│   ├── 20181112192931Z
│   │   └── django_lesson_1
│   │       ├── ansible
│   │       ├── home
│   │       ├── my_project
│   │       ├── users
│   │       └── venv_dev
ricardclau commented 5 years ago

I think you need to add an extra final / in the deploy_from argument so that the extra folder (presumably this is how your working directory is called?) is not created

This is how rsync works, nothing to do with Ansistrano

maciejmatczak commented 5 years ago

Ahh yes, I was thinking about / but actually tried it on the 'deploy to'. Will try that Tomorrow.

Though this means that with the same configuration and only switching channel of providing data you are getting different results.

ricardclau commented 5 years ago

Bear in mind ansistrano_deploy_from is only used in the copy, rsync and svn strategies (not used for instance in the git strategy) and of course different adaptors need different configurations. They rely on Linux tools such as rsync or scp that are not always unified

maciejmatczak commented 5 years ago

Sure, I totally understand that and agree. I just wasn't expecting this differences when running initially. Thanks for help!

mediafigaro commented 5 years ago

@maciejmatczak 👍 did you get it clear also to handle the hooks and to have the right composer update &cache clear ? Would you mind sharing an anonymous conf on gist for exemple ?

maciejmatczak commented 5 years ago

@mediafigaro I am not sure about what exactly you are asking of. I didn't use any handles from this role yet and totally have no idea what do you mean by composer update and clearing cache in context of Ansistrono Deploy (aren't those your technology stack dependent operations? I am working with Python's Django, didn't get to nginx and Gunicorn yet...).