Skip to content

Commit

Permalink
Allow composer to be managed by other tools
Browse files Browse the repository at this point in the history
We handle composer in other roles and its installed / updated via
a user with higher privileges than the user the sites managed by. We
don't want the user the project is deployed as to be able to deal with
it. This is a backwards compatible change and seems to work.
  • Loading branch information
gnat42 committed Oct 7, 2015
1 parent 8da1721 commit c11b0a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ symfony2_project_php_path: php
symfony2_project_keep_releases: 5
symfony2_project_clean_versioning: true
symfony2_project_console_opts: ''
symfony2_project_maintain_composer: true
symfony2_project_composer_opts: '--no-dev --optimize-autoloader --no-interaction'
symfony2_fire_schema_update: false
symfony2_fire_migrations: false
5 changes: 3 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@
- name: Check if composer exists.
stat: path={{symfony2_project_composer_path}}/composer.phar
register: composer_file
when: symfony2_project_maintain_composer == true

- name: Install composer.
get_url: url=https://getcomposer.org/composer.phar dest={{symfony2_project_composer_path}} mode=0755 validate_certs=no
when: composer_file.stat.exists == false
when: symfony2_project_maintain_composer == true and composer_file.stat.exists == false

- name: Update composer if already exists.
shell: "{{symfony2_project_composer_path}}/composer.phar selfupdate"
when: composer_file.stat.exists == true
when: symfony2_project_maintain_composer == true and composer_file.stat.exists == true

- name: Run composer install.
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}}
Expand Down

0 comments on commit c11b0a5

Please sign in to comment.