Skip to content

Instantly share code, notes, and snippets.

@mdesanti
Created March 27, 2018 16:25
Show Gist options
  • Save mdesanti/c25f2a2059d85eb238ad094bd250d8c7 to your computer and use it in GitHub Desktop.
Save mdesanti/c25f2a2059d85eb238ad094bd250d8c7 to your computer and use it in GitHub Desktop.
# sample Jenkinsfile. Might not compile
node {
checkout scm
withEnv(['MYTOOL_HOME=/usr/local/mytool']) {
docker.image("postgres:9.2").withRun() { db ->
withEnv(['DB_USERNAME=postgres', 'DB_PASSWORD=', "DB_HOST=db", "DB_PORT=5432"]) {
docker.image("redis:X").withRun() { redis ->
withEnv(["REDIS_URL=redis://redis"]) {
docker.build(imageName, "--file .woloxci/Dockerfile .").inside("--link ${db.id}:postgres --link ${redis.id}:redis") {
sh "rake db:create"
sh "rake db:migrate"
sh "bundle exec rspec spec"
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment