Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion group_vars/all/helpers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ composer_authentications: "{{ vault_wordpress_sites[site].composer_authenticatio
# Default `type` is `http-basic`.
composer_authentications_using_basic_auth: "{{ composer_authentications | rejectattr('type', 'defined') | union( composer_authentications | selectattr('type', 'defined') | selectattr('type', 'equalto', 'http-basic') ) }}"
composer_authentications_using_bitbucket_oauth: "{{ composer_authentications | selectattr('type', 'defined') | selectattr('type', 'equalto', 'bitbucket-oauth') }}"
composer_authentications_using_other_token: "{{ composer_authentications | selectattr('type', 'defined') | rejectattr('type', 'equalto', 'http-basic') | rejectattr('type', 'equalto', 'bitbucket-oauth') }}"
composer_authentications_using_custom_headers: "{{ composer_authentications | selectattr('type', 'defined') | selectattr('type', 'equalto', 'custom-headers') }}"
composer_authentications_using_other_token: "{{ composer_authentications | selectattr('type', 'defined') | rejectattr('type', 'equalto', 'http-basic') | rejectattr('type', 'equalto', 'bitbucket-oauth') | rejectattr('type', 'equalto', 'custom-headers') }}"
16 changes: 16 additions & 0 deletions roles/deploy/hooks/build-after.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@
loop_control:
label: "{{ item.type }}.{{ item.hostname }}"

- name: Setup composer authentications (Custom Headers)
composer:
command: config
arguments: --auth custom-headers.{{ item.hostname | quote }} {{ item.headers | map('quote') | join(' ') }}
working_dir: "{{ deploy_helper.new_release_path }}"
no_log: true
changed_when: false
when:
- item.hostname is defined and item.hostname != ""
- item.headers is defined and item.headers | length > 0
- item.headers is sequence
- item.headers is not string
loop: "{{ composer_authentications_using_custom_headers }}"
loop_control:
label: "{{ item.type }}.{{ item.hostname }}"

- name: Setup composer authentications (Other Tokens)
composer:
command: config
Expand Down
17 changes: 17 additions & 0 deletions roles/wordpress-install/tasks/composer-authentications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@
loop_control:
label: "{{ item.type }}.{{ item.hostname }}"

- name: "Setup composer authentications (Custom Headers) - {{ site }}"
composer:
command: config
arguments: --auth custom-headers.{{ item.hostname | quote }} {{ item.headers | map('quote') | join(' ') }}
working_dir: "{{ working_dir }}"
become: no
no_log: true
changed_when: false
when:
- item.hostname is defined and item.hostname != ""
- item.headers is defined and item.headers | length > 0
- item.headers is sequence
- item.headers is not string
loop: "{{ composer_authentications_using_custom_headers }}"
loop_control:
label: "{{ item.type }}.{{ item.hostname }}"

- name: "Setup composer authentications (Other Tokens) - {{ site }}"
composer:
command: config
Expand Down
Loading