Allow to give services an alias
What does this MR do?
Allow docker services referenced in .gitlab-ci.yml to be aliased.
Example:
services:
- kaixhin/ssh as origin
- kaixhin/ssh as destination
The as
part is optional, should be backwards compatible.
Why was this MR needed?
- The generated names aren't always intuitive and can become very long.
- A service can only be used once, which is limiting (e.g. we needed to transfer files between two ssh hosts).
Are there points in the code the reviewer needs to double check?
I have not worked with go before, so yes ;)
Does this MR meet the acceptance criteria?
- [ x] CHANGELOG entry added
- [ x] Documentation created/updated
- Tests
- [ x] Added for this feature/bug
-
All builds are passing
- [ x] Branch has no merge conflicts with
master
(if you do - rebase it please)
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1284
Merge request reports
Activity
I'm not sure it's the best way to do this, but I wanted to be downwards compatible. https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1284# suggests to use a map. This would also allow more elaborate configuration (and basically rebuild the structure docker-compose?)
Edited by username-removed-724140Thanks for the feedback! I absolutely agree, it's a bit hackish. If I find time I'll gladly look at an alternative implementation. As I said I think copying docker-compose would be the best solution. We'd not only solve the naming issue, but also a per-service configuration (i.e. per-service environment variables, volumes etc.). Any thoughts?
Mentioned in issue #1284 (closed)