Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- node('ec2-build-slave') {
- stage('Docker Build') {
- /* This builds the actual image; synonymous to
- * docker build on the command line */
- sh("docker network create aa_backend_network")
- sh("docker-compose up -d --build")
- //docker.build("$IMAGE")
- }
- stage ('Docker Push'){
- // /* This pushes the previously built image to the Amazon
- // * ECS Container Registry */
- sh("eval $(aws ecr get-login --region us-west-2 --no-include-email | sed 's|https://||')")
- // docker.withRegistry(ECR_URL, ECR_CRED) {
- // docker.image(IMAGE).push()
- // }
- sh("docker-compose build")
- sh("docker-compose push")
- }
- }
- catch (exc) {
- currentBuild.result = "FAILED"
- throw exc
- }
- finally {
- // Success or failure, always send notifications
- notifyBuild(currentBuild.result)
- sh("docker-compose down -v")
- sh("docker network prune -f")
- }
- }
- }
- version: "2"
- services:
- db_setup:
- networks:
- - default
- build: .
- depends_on:
- - db
- container_name: db_setup
- image: db_setup
- command: python asteri_analytics_db.py
- working_dir: /asteri_analytics_db/asteri_analytics_db
- db:
- networks:
- - default
- - outside
- image: mongo:3.6.3
- container_name: mongo_db
- restart: always
- environment:
- MONGO_DATA_DIR: /data/db
- MONGO_LOG_DIR: /dev/null
- MONGO_INITDB_ROOT_USERNAME: ###edited####
- MONGO_INITDB_ROOT_PASSWORD: ###edited####
- ports:
- - 27017:27017
- networks:
- outside:
- external:
- name: aa_backend_network
Add Comment
Please, Sign In to add comment