Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically deploying Jenkins slaves on google compute engine for github commits

This is a question of integration:

I would like to run Jenkins on Google Compute Engine. I can do this, but I will quickly break my budget if I leave an 8-core virtual machine running at all times. As a solution, I think I can leave a micro instance with a low amount of memory powered on and acting as the jenkins master running at all times. It seems that I should be able to configure github to startup a jenkins slave (with 8 cores) whenever a push is performed. How do I connect github post-commit hooks to Google Compute Engine to achieve this? A complete answer is probably asking too much, but even just pointers to the relevant documentation would be helpful.

Alternatively, how would you solve my problem?

like image 272
interestedparty333 Avatar asked Aug 09 '14 21:08

interestedparty333


1 Answers

You can run an AppEngine instance and use the URL it provides as the target of your GitHub on-commit web hook. This way, you won't be charged unless the instance is actually running, which may even be cheaper than running a micro instance 24x7 on Compute Engine.

You can then start/stop instances on Compute Engine or trigger actions on them from your code running on App Engine.

Here's a related question which has an answer for how to authenticate to Compute Engine from code running on AppEngine.

like image 134
Misha Brukman Avatar answered Nov 15 '22 03:11

Misha Brukman