Created
March 27, 2018 16:25
-
-
Save mdesanti/c25f2a2059d85eb238ad094bd250d8c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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