Use docker orchestration from within test suite to spin-up environment
It may be interesting to use Docker-related scenarios store in lib/scenario/docker/
to orchiestrate environment for particular scenarios.
Example:
Scenario::Docker::Install::LDAP.perform do
domain 'example.gitlab.com'
admin_password 'some password'
end
We would be able to create GitLab Runner as well:
Scenario::Docker::Gitlab::Runner::Install.perform do
registration_token @some_token
tags [:docker, :ruby]
coordinator @gitlab_url
end
With this approach configuring external services like GitLab Runner, LDAP server or running complex scenarios (version upgrade, backup store/restore) can be as simple as:
feature 'continuous integration' do
before do
Scenario::Docker::Gitlab::Runner::Install.perform do
name 'awesome runner'
registration_token @some_token
tags [:docker, :ruby]
coordinator @gitlab_url
end
end
scenario 'install gitlab runner' do
# [...]
Pages::Project.act { go_to_runners }
expect(page).to have_content('awesome runner')
end
scenario 'run simple ci pipeline' do
end
end
docker-api
gem can be helpful here.
cc @marin @tmaczukin