Posts Tagged ‘jenkins’

“Author” and “Committer” fields in git metadata…

Friday, November 18th, 2011

Discovered a nice little git trick today.  I haven’t seen this documented, so I’m not sure if it’s a feature per se, but if you set your user.name via git config like so:

[user]
    name = accountname
    email = email@company.com

and then commit with the --author="Full Name" flag set to another name, this will set git’s commit metadata such that “Author:” is “Full Name” and “Committer:” is “accountname”.

Useful when you want to see the Author in your git logs and the Committer in tools like Hudson or Jenkins.

Doctrine Migrations and Jenkins

Wednesday, November 9th, 2011

If you’re trying to automate Symfony2/Doctrine2 migrations with Jenkins, you may run afoul of the interactive confirmation that the doctrine-migrations package throws out:

$ app/console doctrine:migrations:migrate

Application Migrations

WARNING! You are about to execute a database migration that could result in schema changes and data lost. Are you sure you wish to continue? (y/n)

This will break the Jenkins build. While there is probably a way to get Jenkins to reply to this with a “y”, it’s easier just to use the under documented --no-interaction switch. In a build.xml for example:

<target name="schema" description="Update database">
<exec executable="app/console" failonerror="true">
<arg line="doctrine:migrations:migrate --no-interaction" />
</exec>
</target>

Now if the migrations work, so does the build.