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

circleci小ネタ集 / circleci_tips

circleci小ネタ集 / circleci_tips

コード改善 meetup #1 http://kaizen.connpass.com/event/31378/

Jun Watanabe

May 26, 2016
Tweet

More Decks by Jun Watanabe

Other Decks in Programming

Transcript

  1. ϓϩδΣΫτͷgit഑ஔྫ multi [multi.git] //ࣗࣾϑϨʔϜϫʔΫ !system ɹ"addon ɹ#ɹ!asuka [asuka.git] //ϓϩδΣΫτຖͷಠ࣮ࣗ૷ιʔε ɹ#ɹɹ"master

    [asuka-master.git]ɹ//ΞΠςϜ౳ͷϚελʔઃఆ ɹ#ɹɹ!web [asuka-web.git]ɹ//ը૾΍Ի੠౳ ɹ!lib[lib.git] //ࣗࣾϥΠϒϥϦ
  2. git cloneͯ͠ ࣗ෼Ͱ഑ஔ͠ͳ͓͢ checkout: post: - "git clone -b ${CIRCLE_BRANCH}

    [email protected]:oratta-inc/ multi.git /home/ubuntu/multi" - "git clone -b ${CIRCLE_BRANCH} [email protected]:oratta-inc/ lib.git /home/ubuntu/multi/system/lib" - "mkdir /home/ubuntu/multi/system/addon" test: pre: - "cp -a /home/ubuntu/${CIRCLE_PROJECT_REPONAME}/ /home/ubuntu/ multi/system/addon/${CIRCLE_PROJECT_REPONAME}" - "git clone -b ${CIRCLE_BRANCH} [email protected]:oratta-inc/ asuka-master.git /home/ubuntu/multi/system/addon/asuka/master"
  3. ͜ΜͳγΣϧεϓϦΫτ ࡞Γ·ͨ͠ test: override: - sh test.sh if [[ -v

    RUN_COVERAGE ]] then sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/ xdebug.ini phpunit -c phpunit.xml --coverage-html=${CIRCLE_ARTIFACTS} else phpunit -c phpunit.xml fi circle.yml test.sh
  4. REST APIͰbuild_parameters Λ෇༩ͯ͠Ϗϧυ curl -X POST --header "Content-Type: application/json" -d

    '{"build_parameters": {"RUN_COVERAGE": "true"}}' https:// circleci.com/api/v1/project/username/reponame/tree/branch?circle- token=hogehoge
  5. ͜ΜͳγΣϧεϓϦΫτ ࡞Γ·ͨ͠ test: override: - sh test.sh if [[ -v

    RUN_COVERAGE ]] then sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/ xdebug.ini phpunit -c phpunit.xml --coverage-html=${CIRCLE_ARTIFACTS} else phpunit -c phpunit.xml fi circle.yml test.sh
  6. ࣮͸circle.yml͚ͩͰग़དྷΔ test: override: - | if [[ -v RUN_COVERAGE ]]

    then sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/ conf.d/xdebug.ini phpunit -c /home/ubuntu/multi/system/addon/$ {CIRCLE_PROJECT_REPONAME}/phpunit.xml -d memory_limit=1024M -- coverage-html=${CIRCLE_ARTIFACTS} else phpunit -c /home/ubuntu/multi/system/addon/$ {CIRCLE_PROJECT_REPONAME}/phpunit.xml -d memory_limit=1024M