Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- steps {
- // TODO: Simplify this once declarative syntax supports sidecars
- script {
- def iface = "dummy${env.BUILD_NUMBER}"
- def ip = "192.168.123.${env.BUILD_NUMBER.toInteger() % 254}"
- sh "sudo ip link add ${iface} type dummy"
- sh "sudo ip addr add ${ip}/24 brd + dev ${iface} label ${iface}:0"
- docker.image('mysql:5.6').withRun("""\
- -e MYSQL_USER= \
- -e MYSQL_PASSWORD= \
- -e MYSQL_ROOT_PASSWORD= \
- -v \$(pwd)/resources/docker-compose/schema.sql:/docker-entrypoint-initdb.d/schema.sql \
- -p ${ip}:3306:3306 \
- """) { mysql ->
- docker.image('memcached').withRun("""\
- -p ${ip}:11211:11211 \
- """) { memcached ->
- docker.image('dwmkerr/dynamodb').withRun("""\
- -p ${ip}:8111:8000 \
- """) { dynamodb ->
- docker.withRegistry(
- 'https://.dkr.ecr.us-west-2.amazonaws.com',
- 'ecr:us-west-2:'
- ) {
- docker.image('mysql:5.6').inside() {
- // Wait until mysql is up
- sh "while ! mysqladmin -u -p ping -h${ip} --silent; do sleep 1; done"
- }
- docker.image('/go-build').inside("""\
- -v /tmp/go/pkg/mod:/home/build/go/pkg/mod \
- """) {
- sh "sed -i 's/localhost/${ip}/g' resources/config/cloud-stack.yml" // TODO: Handle this in a more sane way
- sh "make integration BUILDTAGS=prod"
- sh "make BUILDTAGS=prod"
- stash name: 'coverage', includes: 'build/test-reports/*.out'
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement