Skip to content
Snippets Groups Projects
Commit 919be2a3 authored by jurgenhaas's avatar jurgenhaas
Browse files

Merge remote-tracking branch 'origin/master'

parents 1cd34345 1f1dd20f
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,10 @@ You can also setup a global composer directory and make the bin directory availa
composer_global_packages:
phpunit/phpunit: "@stable"
## Auth.json
### Github OAuth token
If your project use a lot of libraries from github, you may see next message during `composer install`:
Could not fetch `...`, enter your GitHub credentials to go over the API rate limit
......@@ -35,6 +39,17 @@ To prevent that, you must configure github oauth token to go over the API rate l
composer_github_oauth: f03401aae1e276abb073f987c08a32410f462e73
### HTTP Basic auth
You can provide HTTP Basic auth credentials to any repository like this:
```
composer_http_basic:
repo.magento.com:
username: 52fe41da9d8caa70538244c10f367d0a
password: 238fe32d374a2573c4527bd45a7e6f54
```
## Example Playbook
roles:
......
......@@ -12,3 +12,4 @@ composer_global_packages: {}
# Visit https://github.com/settings/applications
# and generate personal access token
composer_github_oauth: false
composer_http_basic: false
......@@ -4,4 +4,4 @@
template:
src: ".composer/auth.json.j2"
dest: "{{ composer_home_path|default('~/.composer') }}/auth.json"
when: composer_github_oauth != false
when: composer_github_oauth != false or composer_http_basic != false
......@@ -3,6 +3,6 @@
- include: install.yml
- include: test.yml
- include: configure.yml
- include: oauth.yml
- include: auth_json.yml
- include: update.yml
when: composer_update == true
{
"github-oauth": {
"github.com": "{{ composer_github_oauth }}"
{% if composer_http_basic %}
"http-basic": {
{% for repository,credentials in composer_http_basic.iteritems() %}
{% if loop.index0 %},{% endif %}
"{{ repository }}": {
"username": "{{ credentials.username }}",
"password": "{{ credentials.password }}"
}
{% endfor %}
}
{% endif %}
{% if composer_http_basic and composer_http_basic %},{% endif %}
{% if composer_github_oauth %}
"github-oauth": {
"github.com": "{{ composer_github_oauth }}"
}
{% endif %}
}
......@@ -4,6 +4,10 @@
become: true
vars:
composer_github_oauth: f03401aae1e276abb073f987c08a32410f462e73
composer_http_basic:
repo.magento.com:
username: 52fe41da9d8caa70538244c10f367d0a
password: 238fe32d374a2573c4527bd45a7e6f54
roles:
- { role: common, tags: apt }
- { role: ../../ansible-role-composer, tags: composer }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment