-
-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup composer HTTP basic authentication for multiple repositories #1091
Conversation
Well this is much better! Shame we didn't do it this way originally.
It might be possible to keep the existing |
Done. The current implementation is ugly. Leave a comment if you think of more elegant alternatives. Note: Need help testing this pull requests on vagrant! |
rebased onto #1092 and removed ansible 2.4 from trhe test matrix |
Working fine for me locally. Config settings got set properly. Only thing I noticed was this:
|
Added Example (vagrant):
Example (deploy):
|
✨ fancy, didn't know about that |
Thank you! |
how would you authenticate plugins from private repository as well as paid plugins like WPMU? |
This feature has not been documented in https://roots.io/docs/trellis. One example can be found here https://discourse.roots.io/t/gitlab-private-repo-as-composer-package/20592/19 PRs to https://github.com/roots/docs/ is welcomed. |
What about WPMU? Will this work ?
|
Try it and report back please. |
it doesn't work any suggestions? |
I suggest running the composer commands manually locally (or on your server) to see if it works. It's not likely to be an actual issue with Trellis itself. Here's what Trellis does: trellis/roles/deploy/hooks/build-after.yml Lines 13 to 16 in 9c5ac56
So if you run |
so composer config --auth http-basic.wpmudev.com on local came up with {"username":"APIvalue","password":null}. It also added auth.json file next to composer.json. On the server this command gave me When I removed composer_authentications from the vault and deploy with auth.json Deploy went through |
Can I confirm |
yes, I have it as however when I run
|
Thanks for reporting. Created #1306 to track the issue. |
I have upgrade trellis to 1.9 added composer_authentications: - { hostname: wpmudev.com, username: 123456789 , password: null } to production vault and still get the same error on deploy {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false} I also found out on Trellis documentation [https://roots.io/docs/trellis/master/composer-http-basic-authentication/] next to last line states "The password cannot be null, or an empty string" Please advice |
See: #1306 PRs are welcomed. |
I have both of these entries (trellis/group_vars/all/helpers.yml and trellis/roles/wordpress-install/tasks/composer-authentications.yml) as they are part of 1.9 update. |
Trellis (as of v1.9.0) doesn't support PRs are welcomed. |
OK, so is there any solution I could test? Sorry I do not understand what you mean by "PRs" |
As @tangrufus has said a few times, Trellis does not support "PR" means "Pull Request" which is another way of saying: Trellis is an open-source project and we welcome contributions. Supporting |
Usage
Notes
Loops
Bumping ansible
version_requirement
to2.5.0.0
to start usingloop
.Setup packagist.com authentication
Keeping the original
Setup packagist.com authentication
task for backward compatibility.Maybe remove it in Trellis v2?
Help Wanted
Vagrant
When you remove an item from
composer_authentications
, re-provisioning vagrant VM won't delete the removed item.Send pull request if you have a better way to do it.
Why the ugly
include_tasks: tasks/composer-authentications.yml
?Seems ansible has no way to make a
foreach
inside aforeach
loop.Send pull request if you have a better way to do it.