Skip to content

Commit

Permalink
Fix composer home (#42)
Browse files Browse the repository at this point in the history
* fix(composer): COMPOSER_HOME setup

* chore(composer): set default lephare_composer_home to ~/.config/composer

Co-authored-by: Thibaut Selingue <[email protected]>

* doc(readme): set default composer 2 config path

* doc(readme): set default Composer 2 config path

Co-authored-by: Thibaut Selingue <[email protected]>

---------

Co-authored-by: Thibaut Selingue <[email protected]>
  • Loading branch information
pierreboissinot and thislg authored Jul 31, 2023
1 parent 31b8327 commit 9b8e6d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ The defaults vars declared in this module:
lephare_cachetool_apcu_clear: true
lephare_cachetool_scheme: https

lephare_composer_home: '~/.config/composer'

lephare_rollbar_notify: true
lephare_rollbar_environment: production

Expand Down
15 changes: 7 additions & 8 deletions config/steps/composer/private_registry.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
- name: LEPHARE | COMPOSER | Ensure configuration directory exists
file:
path: "{{ composer_facts.home }}"
state: directory
recurse: yes
mode: 0755
register: composer_home_directory
- name: Add lephare_composer_home directory to current user $PATH.
ansible.builtin.lineinfile:
path: ~/.profile
line: 'export COMPOSER_HOME={{ lephare_composer_home }}'
create: true
backup: true

- name: LEPHARE | COMPOSER | Setup private registry
template:
src: composer/auth.json.j2
dest: "{{ composer_home_directory.path }}/auth.json"
dest: "{{ lephare_composer_home }}/auth.json"
mode: 0600
when: lephare_packagist_com_token is defined
2 changes: 0 additions & 2 deletions config/steps/gather_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@
php_facts:
version: "{{ php_version.stdout }}"
extensions: "{{ php_extensions.stdout_lines }}"
composer_facts:
home: "{{ lookup('env', 'COMPOSER_HOME') | default('~/.composer', true) }}"
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ lephare_run_doctrine_migrations: true
lephare_console_path: bin/console
lephare_composer_options: "--no-dev --optimize-autoloader --apcu-autoloader --no-interaction"
lephare_composer_dump_environment: true
lephare_composer_home: '~/.config/composer'

lephare_cloudfront_invalidate: false
lephare_cloudfront_path: ["/*"]
Expand Down

0 comments on commit 9b8e6d8

Please sign in to comment.