Guest User

Untitled

a guest
Mar 31st, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. node('ec2-build-slave') {
  2. stage('Docker Build') {
  3. /* This builds the actual image; synonymous to
  4. * docker build on the command line */
  5.  
  6. sh("docker network create aa_backend_network")
  7. sh("docker-compose up -d --build")
  8. //docker.build("$IMAGE")
  9. }
  10. stage ('Docker Push'){
  11. // /* This pushes the previously built image to the Amazon
  12. // * ECS Container Registry */
  13. sh("eval $(aws ecr get-login --region us-west-2 --no-include-email | sed 's|https://||')")
  14. // docker.withRegistry(ECR_URL, ECR_CRED) {
  15. // docker.image(IMAGE).push()
  16. // }
  17.  
  18.  
  19. sh("docker-compose build")
  20. sh("docker-compose push")
  21. }
  22. }
  23. catch (exc) {
  24. currentBuild.result = "FAILED"
  25. throw exc
  26. }
  27. finally {
  28. // Success or failure, always send notifications
  29. notifyBuild(currentBuild.result)
  30. sh("docker-compose down -v")
  31. sh("docker network prune -f")
  32. }
  33. }
  34. }
  35.  
  36. version: "2"
  37. services:
  38. db_setup:
  39. networks:
  40. - default
  41. build: .
  42. depends_on:
  43. - db
  44. container_name: db_setup
  45. image: db_setup
  46. command: python asteri_analytics_db.py
  47. working_dir: /asteri_analytics_db/asteri_analytics_db
  48. db:
  49. networks:
  50. - default
  51. - outside
  52. image: mongo:3.6.3
  53. container_name: mongo_db
  54. restart: always
  55. environment:
  56. MONGO_DATA_DIR: /data/db
  57. MONGO_LOG_DIR: /dev/null
  58. MONGO_INITDB_ROOT_USERNAME: ###edited####
  59. MONGO_INITDB_ROOT_PASSWORD: ###edited####
  60. ports:
  61. - 27017:27017
  62.  
  63. networks:
  64. outside:
  65. external:
  66. name: aa_backend_network
Add Comment
Please, Sign In to add comment