GitLab CI to install, configure and run a service on a remote host

27 views
Skip to first unread message

Maiken Pedersen

unread,
Jan 19, 2018, 8:40:13 AM1/19/18
to GitLab
Hi!

I want to use the GitLab CI to
1) build source code
2) create rpms
3) take these rpms and install and configure the software on a remote machine

1) and 2) are more or less ok, and I have already implemented this in our GitLab CI.

When it comes to 3):
I will have a set of persistent cloud-machines in our University cloud that I will use  to install, configure and run our software (Nordugrid ARC).

I wonder what would be the best way to do this in the GitLab CI.

I was thinking about one option to use a simple alpine+ansible docker image inside the runner.
I then need to be able to ship the ansible playbooks to the runner, or alternatively I can download it inside the runner.
Then the ansible playbooks are run to set up the remote machine.
But to do that I also need to have the ssh key-pair that I want to use on the gitlab runner.

Question 1) How to in a safe way ship the ssh key-pair (where the public key part of this is already in the authorized_keys file on the remote host) to the gitlab runner?

Question 2) Is the way I sketch out above a good way of deploying the software? Or are there other better ways?
I could deploy also just inside the runner, and send some test-jobs from within.

But as a real test, I need the software to be installed and run on a remote host for proper testing.


Best wishes,
Maiken
Reply all
Reply to author
Forward
0 new messages