Advertisement
Guest User

Untitled

a guest
Apr 5th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. steps {
  2. // TODO: Simplify this once declarative syntax supports sidecars
  3. script {
  4. def iface = "dummy${env.BUILD_NUMBER}"
  5. def ip = "192.168.123.${env.BUILD_NUMBER.toInteger() % 254}"
  6. sh "sudo ip link add ${iface} type dummy"
  7. sh "sudo ip addr add ${ip}/24 brd + dev ${iface} label ${iface}:0"
  8.  
  9. docker.image('mysql:5.6').withRun("""\
  10. -e MYSQL_USER= \
  11. -e MYSQL_PASSWORD= \
  12. -e MYSQL_ROOT_PASSWORD= \
  13. -v \$(pwd)/resources/docker-compose/schema.sql:/docker-entrypoint-initdb.d/schema.sql \
  14. -p ${ip}:3306:3306 \
  15. """) { mysql ->
  16.  
  17. docker.image('memcached').withRun("""\
  18. -p ${ip}:11211:11211 \
  19. """) { memcached ->
  20.  
  21. docker.image('dwmkerr/dynamodb').withRun("""\
  22. -p ${ip}:8111:8000 \
  23. """) { dynamodb ->
  24.  
  25. docker.withRegistry(
  26. 'https://.dkr.ecr.us-west-2.amazonaws.com',
  27. 'ecr:us-west-2:'
  28. ) {
  29.  
  30. docker.image('mysql:5.6').inside() {
  31. // Wait until mysql is up
  32. sh "while ! mysqladmin -u -p ping -h${ip} --silent; do sleep 1; done"
  33. }
  34.  
  35. docker.image('/go-build').inside("""\
  36. -v /tmp/go/pkg/mod:/home/build/go/pkg/mod \
  37. """) {
  38. sh "sed -i 's/localhost/${ip}/g' resources/config/cloud-stack.yml" // TODO: Handle this in a more sane way
  39. sh "make integration BUILDTAGS=prod"
  40. sh "make BUILDTAGS=prod"
  41. stash name: 'coverage', includes: 'build/test-reports/*.out'
  42. }
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement