Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
circleci小ネタ集 / circleci_tips
Search
Jun Watanabe
May 26, 2016
Programming
2.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
circleci小ネタ集 / circleci_tips
コード改善 meetup #1
http://kaizen.connpass.com/event/31378/
Jun Watanabe
May 26, 2016
More Decks by Jun Watanabe
See All by Jun Watanabe
Jamf Connect ZTNAとMDMで実現! 金融ベンチャーにおける「デバイストラスト」実例と軌跡 / Kyash Device Trust
rela1470
1
3k
20分1発勝負! 社内Webツールをライブコーディングするぞ! / Live Coding PHPerKaigi 2025
rela1470
0
38
力技で実現するHR Driven Provisioningとアクセス制御の自動化 / kyash-hr-driven-provisioning
rela1470
0
1.5k
10分(25分)でつくる社内Webツール / howto-oidc-webpage
rela1470
0
190
リーグオブ情シス 第二回 / League of Infosys
rela1470
1
1.5k
Kyashでコーポレートエンジニアを初採用して7ヶ月が経ちましたがお元気ですか / ce-night-kyash
rela1470
4
3.4k
じこしょうかい2019 / rela1470-portfolio-2019
rela1470
0
420
255オクテットのドメインはツラみがある! / endless-work
rela1470
1
5.6k
ヤフーの1on1
rela1470
0
570
Other Decks in Programming
See All in Programming
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.6k
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
240
AWSに止められる覚悟してますか?
morizo_1984
2
530
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
sbt 2.0: takeoff
eed3si9n
0
130
setup-vp GitLab対応の裏側
naokihaba
0
160
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
残高管理から台帳サービスへの進化
artoy
0
180
Domain-Driven Transformation
hschwentner
2
2.3k
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
170
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
Featured
See All Featured
Discover your Explorer Soul
emna__ayadi
2
1.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Done Done
chrislema
187
17k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
It's Worth the Effort
3n
188
29k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
350
RailsConf 2023
tenderlove
30
1.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Transcript
circleciখωλू 2016/05/26 ίʔυվળ meetup #1 Jun Watanabe
Jun Watanabe @rela1470 • ͪͺʔ6 • ORATTA, Inc Chief Engineer
• http://rela.red/ ʘWe are hiring!ʗ
ίʔυվળͱ͍͑ CIπʔϧ͔ͳ
ઌ݄ɺ ΦϯϓϨJenkins͔Β circleciʹશҠߦ͠·ͨ͠!
https://speakerdeck.com/ rela1470/jenkins-kill
Βͳ͔ͬͨ͜ͱ + ͦͷޙࠔͬͨ͜ͱ ͬͨ͜ͱ
PHP 5.5 PHPUnit GitHub circleci FREE Plan
෩࿊෦(੍ࣾ) िʹ3࣌ؒձٞࣨʹͬͯ ͻͨ͢Βۀվળɾٕज़ௐࠪ ORATTA Frontier TechͷଏশΒ͍͠
ෳGitͷClone
1ϓϩδΣΫτ 5ͭ͘Β͍ͷgitʹ ͔Ε͍ͯΔ
ϓϩδΣΫτͷgitஔྫ multi [multi.git] //ࣗࣾϑϨʔϜϫʔΫ !system ɹ"addon ɹ#ɹ!asuka [asuka.git] //ϓϩδΣΫτຖͷಠ࣮ࣗιʔε ɹ#ɹɹ"master
[asuka-master.git]ɹ//ΞΠςϜͷϚελʔઃఆ ɹ#ɹɹ!web [asuka-web.git]ɹ//ը૾Ի ɹ!lib[lib.git] //ࣗࣾϥΠϒϥϦ
Jenkins Multiple SCMs Plugin
circleciͰͲ͏͢Δ͔
circle.ymlͰؤுΔ
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"
ݖݶͲ͏ͳͬͯΔͷ?
Deploy keysΛ͏ͱ ֘1ϦϙδτϦͷΈ
user keyʹࠩ͠ସ͑ͯ Ϣʔβʹඥ͍ͨݖݶΛऔಘ
user keyʹࠩ͠ସ͑ͯ Ϣʔβʹඥ͍ͨݖݶΛऔಘ
αϒϞδϡʔϧԽ Ζ͏ͱͯ͠·͢ @ࠓத͘Β͍...
Ϗϧυͷखಈ࣮ߦ
εέδϡʔϧϏϧυ खಈϏϧυ Ͱ͖ͳ͘ͳΔͷ?
͔ͨ͠ʹWebUIͳ͍
RestAPI͕͋Δ!
՝ۚػೳҎ֎શ෦Ͱ͖ΔΑ!
branchΛࢦఆͯ͠ ৽ϏϧυΛߦ͏API curl -X POST https://circleci.com/api/v1/project/:username/:project/ tree/:branch?circle-token=:token
εέδϡʔϧϏϧυ cronͰୟ͘ खಈϏϧυ खͰୟ͘
ΧόϨοδूܭ
ΧόϨοδूܭ͍ͨ͠ දͰݟ͍ͨ
XdebugΛONʹ sed -i 's/^;//' ~/.phpenv/versions/$(phpenv global)/etc/conf.d/ xdebug.ini
--coverage-html Ͱ $CIRCLE_ARTIFACTS ʹग़ྗͨ͠ΒOK
ͻͱ͕ͭ...
None
None
Ϗϧυʹ20
pushͷʹ20ͪ ͕͢͞ʹࠔΔ...
ۚͰԥΔͷ࠷ޙͷखஈ
Ϗϧυ࣌ؒͷॖ
ผʹPush࣌ ຖճΒͳͯ͘ ि1͘Β͍Ͱྑ͍
ҾͰ໌ࣔతʹ ͚ͨ࣌ͩ͠ ΧόϨοδूܭ
͜ΜͳγΣϧεϓϦΫτ ࡞Γ·ͨ͠ 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
XdebugΛONʹ͢Δͱ PHPUnit͕ॏ͘ͳΔ
औಘ͢Δ͚࣌ͩ XdebugΛONʹ͢Δ
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
݄༵ͷேʹ cronͰճͯ͠·͢
γεςϜ؆ུԽ
͜ΜͳγΣϧεϓϦΫτ ࡞Γ·ͨ͠ 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
࣮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
yamlͷϒϩοΫελΠϧ վߦΛอଘ | |+ |- վߦΛ֯εϖʔεʹ > >+ >- Πϯσϯτࢦఆ
|1 >1
circle.yml ͚ͩͰग़དྷΔ
1ϑΝΠϧͰ ग़དྷΔͳΒ ͤ
σάϨΔ͜ͱͳ͘ શҠߦग़དྷ·ͨ͠(^o^)
http://connpass.com/event/32338/
ʘWe are hiring!ʗ http://www.oratta.net/