Amazon S3 plugin for Jenkins CI again

About once a year I revisit (link) this topic again (usually when the plugin causes trouble). Now I get this signature error

AWS Error Code: SignatureDoesNotMatch, AWS Error Message: The request signature we calculated does not match the signature you provided. Check your key and signing method., S3 Extended Request ID:..

The good news first:
The S3 plugin became mainstream, you can install it from the plugin page under Jenkins Administration | Plugin Manager. You dont need to build the plugin any longer by yourself and can skip the rest of this entry.

S3 Plugin

The long version:
It seems the error is caused by a ‘+’ sign in the access key troubling the encoding function used (see issue). The latest build (Sep 2012) should fix this problem.

If you want to build by yourself, you need to get the sourcecode from git and build the plugin file, beware as it requires Maven 3 now. Below instructions apply fro Ubuntu.

Upload plugin

 

 

Advertisements

Amazon S3 plugin for Jenkins CI

About one year back I found this plugin, that saves your build artifacts to Amazon S3 storage. Unfortunately the plugin does not properly work with the current Jenkins versions and the original plugin is not maintained. Luckily someone forked and updated the plugin at github. You need to build the plugin by yourself with the help of maven, you still can refer to my original post, just one change is required to make it work, the settings for your ~/.m2/settings/xml need to be changed according to the plugin page description. Please be patient, maven is going to download a lot !

<settings>
 <pluginGroups>
 <pluginGroup>org.jenkins-ci.tools</pluginGroup>
 </pluginGroups>

 <profiles>
 <!-- Give access to Jenkins plugins -->
 <profile>
 <id>jenkins</id>
 <activation>
 <activeByDefault>true</activeByDefault> <!-- change this to false, if you don't like to have it on per default -->
 </activation>
 <repositories>
 <repository>
 <id>maven.jenkins-ci.org</id>
 <url>http://maven.jenkins-ci.org/content/groups/artifacts/</url>
 </repository>
 </repositories>
 <pluginRepositories>
 <pluginRepository>
 <id>maven.jenkins-ci.org</id>
 <url>http://maven.jenkins-ci.org/content/groups/artifacts/</url>
 </pluginRepository>
 </pluginRepositories>
 </profile>
 </profiles>
</settings>

Otherwise you get errors like

[INFO] Scanning for projects...
Downloading: http://download.java.net/maven/2/org/jenkins-ci/plugins/plugin/1.434/plugin-1.434.pom
[INFO] Unable to find resource 'org.jenkins-ci.plugins:plugin:pom:1.434' in repository java.net2 (http://download.java.net/maven/2)
Downloading: http://repo1.maven.org/maven2/org/jenkins-ci/plugins/plugin/1.434/plugin-1.434.pom
[INFO] Unable to find resource 'org.jenkins-ci.plugins:plugin:pom:1.434' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Jenkins CI

I migrated (lie the majority if Hudson users) to Jenkins. The migration is easy and simple (backup, add jenkins deb in sources.list, install, the rest if fixed by Jenkins). All info for migrating users here. While Jenkins regained its frequent release cycle, former Hudson is still sitting on version 1.398.

Jenkins CI Book

I want to highlight the first (and only) book about Jenkins CI by John Smart (link): You can download it for free. Thanks !

Hudson Plugin’s of the day

I really enjoy using Hudson as CI platform every day. It is open, it is vastly extensible, has a great community support and not to forget the outstanding job by Kohsuke to create Hudson and lay out the foundation of this ecosystem. There is always more to learn, find new ways to do jobs with Hudson, maybe that is the reason why there is no book yet about Hudson. I just want to highlight 3 very simple plugins that make life easer:

  • Build Timeout (link)
    I have some jobs that take a long time, mainly because they transfer artifacts to S3 and deploy applications to test and demo servers. Once in a while I run into timeouts or hanging batch scripts which will make the complete job haning. If you dont notice you start creating a build queue. This plugin terminates a job if it extends the configurable time limit.

    Build Timeout

  • Time Stamper (link)
    With lon running jobs if would be helpful when which task started and how long it took to finish. The plugin does nothing but putting a timestamp in front of each line of the console output.

    Time Stamper

  • FTP Publisher (link)
    For simple file transfers you might want to try this plugin instead of batch script coding the transfer.

Quick Tutorial: Hudson and Artifacts

I really like using Hudson ! It is amazing what magic you can do with it, even some stuff is simple, like the “Archive the artifacts” feature. Dont you have the same situation: Some build running on some server will create an error that you can’t see in you current codebase. Would be nice to get exact the sourcecode and deployment that belongs to this build ? I keep the workspace (sourcecode excluding the build folder and .svn folder) with the 2 steps below.

Continue reading

Automatic Version Numbering in Web Applications with Hudson (Add-On)

In the 3 parts of the tutorial (part 1, part 2, part3) we setup a Netbeans/Web-Project/Hudson/ZK environment that creates and reads automatically version numbers. Unfortunately while building outside HUDSON, or better with your local Netbeans IDE, ANT can’t read the HUDSON variables, resulting in a Manifest like this:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 14.2-b01 (Sun Microsystems Inc.)
builduser: sven
version: ${env.BUILD_VERSION}
id: ${env.BUILD_ID}
tag: ${env.BUILD_TAG}
server: ${env.BUILD_URL}

And potentially the website will display ${env.BUILD_VERSION} as version. Not very professional. Of course a local build should not find its way to production system, but at least it should state it properly.

Continue reading

Automatic Version Numbering in Web Applications with Hudson (Part 3)

In this third and last part of the tutorial (part 1, part 2) we add the version reading feature to a ZK application, which is actually not a big difference to the regular jsp page that we created earlier.
It is also a good exercise how to add the ZK library to an existing web project.

Requirements:

  • Netbeans 6.8
  • Glassfish V3 Application Server
  • Installed ZK 5.0 Plugin for Netbeans (link)

(Older Versions and non-EE6 work as well)

Continue reading