defaults: &defaults working_directory: /tmp version: 2 jobs: build: machine: true steps: - checkout - add_ssh_keys - run: gem install handsome_fencer-circle_c_i - run: handsome_fencer-circle_c_i expose circleci - run: handsome_fencer-circle_c_i expose development - run: echo 'source docker/env_files/circleci.env' >> $BASH_ENV - run: docker-compose build - run: docker-compose up -d - run: docker-compose exec app bin/rails db:create db:migrate - run: docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASS - run: name: Tag app image command: docker tag $(docker images | grep project_app | awk '{ print $3 }') ${DOCKERHUB_ORG_NAME}/${APP_NAME}_app:$DEPLOY_TAG - run: name: Tag web image command: docker tag $(docker images | grep project_web | awk '{ print $3 }') ${DOCKERHUB_ORG_NAME}/${APP_NAME}_web:$DEPLOY_TAG - run: docker push ${DOCKERHUB_ORG_NAME}/${APP_NAME}_app:$DEPLOY_TAG - run: docker push ${DOCKERHUB_ORG_NAME}/${APP_NAME}_web:$DEPLOY_TAG - run: rake --rakefile .circleci/Rakefile