|
6 | 6 | - { path: "{{symfony2_project_root}}/releases/{{symfony2_project_release}}" } |
7 | 7 | - { path: "{{symfony2_project_root}}/shared" } |
8 | 8 | - { path: "{{symfony2_project_root}}/shared/app/config" } |
9 | | - - { path: "{{symfony2_project_root}}/shared/app/uploads" } |
10 | 9 | - { path: "{{symfony2_project_root}}/shared/app/logs" } |
| 10 | + - { path: "{{symfony2_project_root}}/shared/web/uploads" } |
11 | 11 |
|
12 | 12 | - name: Pull sources from the repository. |
13 | 13 | git: repo={{symfony2_project_repo}} dest={{symfony2_project_root}}/releases/{{symfony2_project_release}} version={{symfony2_project_branch}} accept_hostkey=yes |
|
16 | 16 | file: state=absent path={{symfony2_project_root}}/releases/{{symfony2_project_release}}/.git |
17 | 17 | when: symfony2_project_clean_versioning == true |
18 | 18 |
|
| 19 | +# will be replaced with symlink |
| 20 | +- name: Ensure logs directory is not present. |
| 21 | + file: state=absent path={{symfony2_project_root}}/releases/{{symfony2_project_release}}/app/logs |
| 22 | + |
19 | 23 | - name: Create symlinks to shared directories. |
20 | 24 | file: state=link src={{item.src}} path={{item.path}} |
21 | 25 | with_items: |
22 | | - - { src: "{{symfony2_project_root}}/shared/web/uploads", path: "{{symfony2_project_root}}/releases/{{symfony2_project_release}}/uploads" } |
23 | | - - { src: "{{symfony2_project_root}}/shared/app/logs", path: "{{symfony2_project_root}}/releases/{{symfony2_project_release}}/logs" } |
| 26 | + - { src: "{{symfony2_project_root}}/shared/app/logs", path: "{{symfony2_project_root}}/releases/{{symfony2_project_release}}/app/logs" } |
| 27 | + - { src: "{{symfony2_project_root}}/shared/web/uploads", path: "{{symfony2_project_root}}/releases/{{symfony2_project_release}}/web/uploads" } |
| 28 | + |
| 29 | +- name: Check if config dir exists. |
| 30 | + stat: path={{symfony2_project_root}}/releases/{{symfony2_project_release}}/app/config |
| 31 | + register: config_dir |
| 32 | + |
| 33 | +- name: Link configs dir if not yet exists. |
| 34 | + file: state=link src={{symfony2_project_root}}/shared/app/config path={{symfony2_project_root}}/releases/{{symfony2_project_release}}/app/config |
| 35 | + when: config_dir.stat.exists == false |
24 | 36 |
|
25 | 37 | - name: Check if shared/app/config/parameters.ini exists. |
26 | 38 | stat: path={{symfony2_project_root}}/shared/app/config/parameters.ini |
|
31 | 43 | when: parameters_ini.stat.exists |
32 | 44 |
|
33 | 45 | - name: Check if composer exists. |
34 | | - stat: path={{symfony2_project_composer_path}} |
| 46 | + stat: path={{symfony2_project_composer_path}}/composer.phar |
35 | 47 | register: composer_file |
36 | 48 |
|
37 | 49 | - name: Install composer. |
38 | 50 | get_url: url=https://getcomposer.org/composer.phar dest={{symfony2_project_composer_path}} mode=0755 validate_certs=no |
39 | 51 | when: composer_file.stat.exists == false |
40 | 52 |
|
41 | 53 | - name: Update composer if already exists. |
42 | | - shell: "{{symfony2_project_composer_path}} selfupdate" |
| 54 | + shell: "{{symfony2_project_composer_path}}/composer.phar selfupdate" |
43 | 55 | when: composer_file.stat.exists == true |
44 | 56 |
|
45 | 57 | - name: Run composer install. |
46 | | - shell: cd {{symfony2_project_root}}/releases/{{symfony2_project_release}} && {{symfony2_project_php_path}} {{symfony2_project_root}}/composer.phar install {{symfony2_project_composer_opts}} |
| 58 | + shell: cd {{symfony2_project_root}}/releases/{{symfony2_project_release}} && export SYMFONY_ENV={{symfony2_project_env}} && {{symfony2_project_php_path}} {{symfony2_project_composer_path}}/composer.phar install {{symfony2_project_composer_opts}} |
47 | 59 |
|
48 | 60 | - name: Dump assets. |
49 | 61 | shell: cd {{symfony2_project_root}}/releases/{{symfony2_project_release}} && {{symfony2_project_php_path}} app/console assetic:dump --env={{symfony2_project_env}} {{symfony2_project_console_opts}} |
|
0 commit comments