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

CircleCI 2.0 をつかってみよう / CircleCI #phpcondo2017

CircleCI 2.0 をつかってみよう / CircleCI #phpcondo2017

TAKAHASHI Kunihiko

November 25, 2017
Tweet

More Decks by TAKAHASHI Kunihiko

Other Decks in Technology

Transcript

  1. DJSDMFZNM machine: timezone: Asia/Tokyo php: version: 7.1.9 services: - mysql

    - redis environment: DEBUG: true DATABASE_SERVER: localhost REDIS_SERVER: localhost dependencies: cache_directories: - ~/.composer/cache pre: - echo "memory_limit = 64M" > /opt/circleci/php/$(phpenv global)/etc/conf.d/memory.ini - composer config -g github-oauth.github.com $GITHUB_ACCESS_TOKEN override: - composer install --prefer-dist --no-interaction test: override: - mkdir -p $CIRCLE_TEST_REPORTS/phpunit - vendor/bin/phpunit --log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml
  2. DJSDMFDJDPOpHZNM version: 2 jobs: build: docker: - image: circleci/php:7.1-apache-browsers working_directory:

    ~/repo steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "composer.json" }} - v1-dependencies- - run: composer install -n --prefer-dist - save_cache: paths: - ./vendor key: v1-dependencies-{{ checksum "composer.json" }} - run: ./vendor/bin/phpunit --log-junit ~/reports/phpunit/junit.xml - store_artifacts: path: ~/reports/ - store_test_results: path: ~/reports/
  3. KPCT ✓δϣϒΛઃఆ͢Δ ✓δϣϒ໊ σϑΥϧτ͸CVJME  ✓ޙ΄Ͳग़ͯ͘ΔXPSLqPXͰ࢖༻͢Δ ✓FYFDVUPSΛઃఆ ✓EPDLFS ✓NBDIJOF ಉ༷ͷ7.؀ڥ

     ✓NBDPT ✓XPSLJOH@EJSFDUPSZ ✓࣮ߦσΟϨΫτϦΛࢦఆ͢Δ ✓TUFQTͰࡉ͔͍࣮ߦ಺༰Λઃఆ͢Δ
  4. DJSDMFDJDPOpHZNM version: 2 jobs: build: docker: - image: circleci/php:7.1-apache-browsers working_directory:

    ~/repo steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "composer.json" }} - v1-dependencies- - run: composer install -n --prefer-dist - save_cache: paths: - ./vendor key: v1-dependencies-{{ checksum "composer.json" }} - run: ./vendor/bin/phpunit --log-junit ~/reports/phpunit/junit.xml - store_artifacts: path: ~/reports/ - store_test_results: path: ~/reports/
  5. DJSDMFDJDPOpHZNM version: 2 jobs: build: docker: - image: circleci/php:7.1-apache-browsers working_directory:

    ~/repo steps: - checkout - restore_cache: keys: - v1-dependencies-{{ checksum "composer.json" }} - v1-dependencies- - run: composer install -n --prefer-dist - save_cache: paths: - ./vendor key: v1-dependencies-{{ checksum "composer.json" }} - run: ./vendor/bin/phpunit --log-junit ~/reports/phpunit/junit.xml - store_artifacts: path: ~/reports/ - store_test_results: path: ~/reports/
  6. SVO ✓ίϚϯυΛ࣮ߦ͢Δ΋ͷͩ ͕ɺ࣮ߦը໘Ͱදࣔ͢Δจࣈ ྻΛઃఆͰ͖Δ - run: ./vendor/bin/phpunit --log-junit ~/reports/phpunit/junit.xml -

    run: name: run tests command: ./vendor/bin/phpunit --log-junit ~/reports/phpunit/junit.xml - run: name: run tests command: | ./vendor/bin/phpunit --log-junit ~/reports/phpunit/junit.xml
  7. 1SJWBUF3FHJTUSZͷ%PDLFSΠϝʔδΛ࢖͏ ✓ೝূ͕ඞཁͳ৔߹͸͍͔ͭ͘ࢦఆํ๏͕͋Δ ✓"84&$3ͷࢦఆํ๏͕ಛघ ✓&$3͕௨ৗͷEPDLFSMPHJOΛ͢ΔܗͰ͸ͳ͍ͨΊ version: 2 jobs: build: docker: -

    image: private/sample:1.0 auth: username: DOCKER_HUB_USERNAME password: DOCKER_HUB_PASSWORD - image: account-id.dkr.ecr.us-east-1.amazonaws.com/org/repo:0.1 aws_auth: aws_access_key_id: ECS_AWS_ACCESS_KEY aws_secret_access_key: ECS_AWS_SECRET_ACCESS_KEY
  8. DJSDMFDJDPOpHZNM version: 2 jobs: தུ workflows: version: 2 phpcs_test_deploy_workflow: jobs:

    - phpcs - test: requires: - phpcs - deploy filters: branches: only: - development requires: - test cron_workflow: triggers: - schedule: cron: “0 18 * * *” filters: branches: only: - master