Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CircleCIで docker-compose最強? / docker-compose-up...

CircleCIで docker-compose最強? / docker-compose-up-on-circleci

2019-06-26 五反田.rb #37のLT資料です!
『CircleCIで docker-compose最強?』

https://gotanda-rb.connpass.com/event/135422/

WalkerSumida

June 26, 2019
Tweet

More Decks by WalkerSumida

Other Decks in Technology

Transcript

  1. w େֶߦ͖ͳ͕Β*5ϕϯνϟʔاۀͰ໿೥ؒ༗ঈΠϯλʔϯ w 1)1 .Z42- $BLF1)1 Y 8PSEQSFTT $ "41

    /&5 w ౦ࣳ৘ใγεςϜגࣜձࣾͰ೥ؒϔϧεέΞࣄۀʹैࣄ w 7#/&5 $ 0SBDMF%BUBCBTF w ̍ਓͰىۀ͠Α͏ͱࢼΈΔ͕ࣦഊ w 3VCZPO3BJMT 'VFM1)1 .Z42- "84 "OTJCMF w גࣜձࣾϚπϦΧʹΤϯδχΞೋਓ໨Ͱ+PJO w 4FOTFTͱ/PUJBΛ։ൃӡ༻ w 3VCZPO3BJMT "OHVMBS+4 .Z42- "84 ܦྺ
  2. mysql: image: mysql:5.7 ports: - 3306:3306 volumes: - ./docker/mysql/conf.d:/etc/mysql/conf.d -

    mysql-data:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: root .Z42-ͷىಈ
  3. rails_api: tty: true stdin_open: true build: context: . dockerfile: Dockerfile

    entrypoint: sh /app/docker/bin/wait_for_mysql.sh sh /app/docker/bin/rails_start.sh ports: - 3000:3000 volumes: - .:/app environment: - DB_USERNAME=root - DB_PASSWORD=root - DB_HOST=mysql - DOCKER_HOST=0.0.0.0 depends_on: - mysql - redis - mongodb - dynamodb 3BJMTͷىಈ
  4. - run: name: Install Docker Compose command: | curl -L

    https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > ~/docker-compose chmod +x ~/docker-compose sudo mv ~/docker-compose /usr/local/bin/docker-compose EPDLFSDPNQPTFΛΠϯετʔϧ
  5. - run: name: test command: | mkdir /tmp/test-results TEST_FILES="$(circleci tests

    glob 'spec/**/*_spec.rb' | circleci tests split --split-by=timings)" docker-compose exec rails_api bin/rspec --format progress \ --format RspecJunitFormatter \ --out /tmp/test-results/rspec.xml \ $TEST_FILES ΍ͬͱͰ͖ͯͨ3TQFD