AppEngine Plugin

13 views
Skip to first unread message

Alexander Bertram

unread,
Feb 3, 2015, 6:39:40 PM2/3/15
to jenkin...@googlegroups.com

Hi there,
I've gotten quite frustrated deploying to AppEngine with shell scripts and duct-taped oauth keys and finally sat down and wrote a proper Jenkins plugin:


The plugin exposes both a free style build step and a workflow step that supports staged releases along the following lines:

def appId = "jenkinsplugintest"

node {
    // checkout the repo locally
    git url: "https://github.com/akbertram/appengine-guestbook-java.git"

    // build, run unit tests, and package
    def mvnHome = tool 'M3'
    sh "${mvnHome}/bin/mvn -B clean install"

    // use our build number as the next version
    def newVersion = "build${env.BUILD_NUMBER}"

    // deploy to AppEngine, but with a new version that is not the default
    // version but still accessible
    appengine action: "update", applicationId: appId, version: newVersion

    def stagingUrl = "https://${newVersion}-dot-${appId}.appspot.com"

    echo "Version ${newVersion} staged at ${stagingUrl}"

    // Test the new version before making live
    // (poor man's integration test - ideally use web driver!)
    sh "curl -s ${stagingUrl} | grep Hello"

    // Once the tests pass, go live!
    appengine action: "set_default_version", applicationId: appId, version: newVersion

}

It's reached a point that it's meeting my immediate needs, but there are a number of gaps that are probably of interest to others. If any one is interested fleshing out support for python and go runtimes, for example, would be happy to merge the code in. 

If there's sufficient interest, it would be great if the plugin could ultimately be added to the update list and all the rest.

Best,
Alex


Reply all
Reply to author
Forward
0 new messages