Skip to content

Instantly share code, notes, and snippets.

@ishults
Last active December 16, 2015 20:02
Show Gist options
  • Save ishults/304c0fe992a5c6373821 to your computer and use it in GitHub Desktop.
Save ishults/304c0fe992a5c6373821 to your computer and use it in GitHub Desktop.
Sample Jenkins script to dynamically create a database and then pass it to Grails
# Exports
export GRAILS_HOME=/path/to/grails
export PATH=$PATH:${GRAILS_HOME}/bin
export PSQL_HOME=/Library/PostgreSQL/9.3
export PATH=$PATH:${PSQL_HOME}/bin
export PGPASSWORD=yourPass # Ideally this should live in the .pgpass file
# Create the database
createdb test_db${BUILD_NUMBER} --owner=yourOwner --username=yourUser
# Run the tests
grails clean
grails test-app -integration -Dtest.suffix=${BUILD_NUMBER}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment