It would be great to be able to create a Git backed automation domain through the API. An example use case is bootstraping a ManageIQ appliance with domains managed with Git. This would also be helpful in a CI/CD approach as only the dev environment would have non Git domains. The Git repository should not be exposed on its own. I would expect an API call similar to: POST /api/automate_domains { "name": "AwesomeDomain", "description": "Bob's awesome domain", "source": "git", "git_repository": { "url": "https://github.com/Bob/AwesomeDomain", "branch": "production" } } The Git repository object would be created by the backend because the user creates a Git backed domain. Then, in a CI/CD context, there would be developers' domains, with a merge policy. Then, a tool like Jenkins would call the refresh_from_source action on the repo when the content of the repo changes.
https://github.com/ManageIQ/manageiq-ui-classic/pull/5416
https://github.com/ManageIQ/manageiq-api/pull/571
New commit detected on ManageIQ/manageiq-ui-classic/master: https://github.com/ManageIQ/manageiq-ui-classic/commit/1c84269e3a0f97ed18502d615f21a5687ba65df1 commit 1c84269e3a0f97ed18502d615f21a5687ba65df1 Author: Joe VLcek <jvlcek> AuthorDate: Mon Apr 1 17:12:33 2019 -0400 Commit: Joe VLcek <jvlcek> CommitDate: Mon Apr 1 17:12:33 2019 -0400 Add support for passing custom options for import_git_url Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1600961 app/services/git_based_domain_import_service.rb | 4 +- spec/services/git_based_domain_import_service_spec.rb | 30 +- 2 files changed, 27 insertions(+), 7 deletions(-)
New commit detected on ManageIQ/manageiq-api/master: https://github.com/ManageIQ/manageiq-api/commit/7dc297024a5d57f79d17cf22ee2d9a1992706d92 commit 7dc297024a5d57f79d17cf22ee2d9a1992706d92 Author: Joe VLcek <jvlcek> AuthorDate: Mon Mar 18 14:17:30 2019 -0400 Commit: Joe VLcek <jvlcek> CommitDate: Mon Mar 18 14:17:30 2019 -0400 Add create Git backed automation domain Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1600961 app/controllers/api/automate_domains_controller.rb | 42 + config/api.yml | 6 +- spec/requests/automate_domains_spec.rb | 60 + 3 files changed, 107 insertions(+), 1 deletion(-)
FIXED. Verified on 5.11.0.7. One suggestion: Unlike the UI import, this imported datastore is disabled at first, it needs to be enabled later on. It would be nice to keep both UI and REST behaviour consistent.
(In reply to Parthvi Vala from comment #6) > FIXED. Verified on 5.11.0.7. > > One suggestion: Unlike the UI import, this imported datastore is disabled at > first, it needs to be enabled later on. It would be nice to keep both UI and > REST behavior consistent. I guess this depends on the datastore that's being imported, ignore the suggestion then!
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:4199