LAGUREN.NET
  • HOME
  • Projects
  • About Me

Using GIST in Jenkins

1/13/2017

 
Normally, I have Jenkins checkout of a git repo to do a build.  However, there are times where I just need it to run an individual script.  It seems rather wasteful to add it to an existing repo, since Jenkins would checkout out the entire repo to run a single script.  Additionally, it doesn't make sense to create a repo for a single script.  That's probably why Github has gists.

So, here's how I currently get Jenkins to checkout a gist by adding the following to the shell build step.

ssh -o StrictHostKeyChecking=no git@gist.github.com
git clone git@gist.github.com:<some gist number>
.git .

The first command disables host checking on the slave and the second command will clone the repo to the local workspace.

So why do I disable the host check?  Since my jenkins slave is dynamically provision, I don't maintain a known hosts file.  Plus, when the job is done, the server is destroyed.

Comments are closed.

    RSS Feed

    Categories

    All
    Advice
    Android
    Automation
    C9D9
    Capybara
    Career
    Continuous Delivery
    Continuous Integration
    Cucumber
    Database
    Firefox
    Fiverr
    GIT
    Interview
    Jenkins
    JIRA
    Jmeter
    Jobs
    Meetup
    Melvinisms
    Metaprogramming
    Mobile
    Ruby
    Training

© COPYRIGHT 2017. ALL RIGHTS RESERVED.
  • HOME
  • Projects
  • About Me