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
Jenkins と cron
Search
Yohei Kawahara
April 29, 2014
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jenkins と cron
Jenkins で cron のジョブを見える化する!
Yohei Kawahara
April 29, 2014
More Decks by Yohei Kawahara
See All by Yohei Kawahara
20191002_CircleCIMeetupFukuoka#2
inokappa
1
950
kix_009_20190429
inokappa
0
950
2019-04-18 CircleCI Meetup Fukuoka #1
inokappa
2
9.5k
開発で使える AWS の API 操作を模倣する (OSS) ツールを探してみた/JAWS-UG Kagoshima Vol.8
inokappa
1
1.4k
隙間時間を使って exercism.io を始め隊 | リモートで勉強会 #2
inokappa
0
570
Congratulations fukuokarb#100
inokappa
0
4.2k
moto を 'もっと' 使おう/PyFukuoka#4
inokappa
0
4.9k
github-enterprise-user-kai-desuyone
inokappa
0
160
Elixir and AWS Tutorial
inokappa
0
650
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
530
We Are The Robots
honzajavorek
0
380
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
The Curse of the Amulet
leimatthew05
3
15k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
How to build a perfect <img>
jonoalderson
1
6k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Prompt Engineering for Job Search
mfonobong
0
450
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Transcript
ςΩετ Jenkins ͱ cron Jenkins Ͱ cron ͷδϣϒΛݟ͑ΔԽ͠Α͏
୭ʁ @inokara
͓͢Δ͜ͱ ͜ΜͳΧΦεݟͨ͜ͱ͋Γ·͢ΑͶʁ cron δϣϒͷ݁Ռݟͯ·͔͢ʁ Jenkins ͬͯʁ Jenkins Ͱ cron ͷδϣϒΛݟ͑ΔԽ͠Α͏
σϞ
ಥવͰ͕͢…
ݟͨ͜ͱ͋Γ·͢ΑͶʁ
Ͳ͕͜ΧΦεʁ ͺͬͱݟͰԿͷδϣϒ͕ղΒͳ͍ ͺͬͱݟ୭͕ઃఆ͔ͨ͠ղΒͳ͍ ίϝϯτΞτͱ͔͞ΕͯΔ͠ ͦͦɺ݁ՌͬͯݟͯΔͷʁ
Ͱɺ݁Ռͬͯݟͯ·͔͢ʁ ͱΓࣦ͋͑ͣഊͨ͠ΒؔऀʹϝʔϧΛૹΔ /tmp/log ʹు͍͍ͯΔ͚ͩ…͔͠ /tmp/ /dev/null ʹϙʔΠ
͖͋·Μ͕ͳ…
ͦ͜Ͱ Jenkins ͷొʂ
None
Jenkins ͬͯʁʢ1ʣ ܧଓతͳΜͪΌΒʢContinuous integrationʣπʔ ϧͷҰͭ ςετͱ͔ύοέʔδϏϧυͱ͔ͰͬͯΔΑͶ όονΛ࣮ߦͯ͘͠ΕΔΑͶ ଞʹ৭ʑग़དྷΔΑʂৄ͘͠άάͬͯͶ
None
͑ɺͦͦ…Jenkins ͱ cron ͬͯ…
࿈ܞͬͯग़དྷΔͷʁ
ग़དྷ·͢ɻ
Jenkins ͬͯʁʢ2ʣ δϣϒͷεςʔλείʔυ 0 ͱͦΕҎ֎Ͱஅͯ͠ ·͢ 0 ͳΒSUCCESS 1 ຢͦΕҎ֎ͳΒ
FAILURE ͦͯ͠…
cron ͷ݁ՌΛόΠφϦΤϯίʔυͯ͠ XML ܗࣜͰεςʔλείʔυͱҰॹʹ POST ͢Δ ͱ݁ՌΛఆͯ͘͠ΕΔʂ
͏Ұ…
ʮ֎෦δϣϒͷࢹʯΛར༻ ݁ՌόΠφϦΤϯίʔυ εςʔλείʔυΛؚΊΔ XML ʹͯ͠ POST ͰϙΠ
<run> <log encoding="hexBinary">$(hexdump -v -e '1/1 "%02x"' $LOG)</log> <result>${RESULT}</result> <duration>${ELAPSED_MS}</duration>
</run>
σϞ
None
None
curl -X POST \ -d '<run><log encoding="hexBinary">4142430A</ log><result>0</result><duration>2000</ duration></run>' \
http://localhost:18080/jenkins/job/test/ postBuildResult
None
None
None
ͰɺԿ͕ΠΠͷʁ cron ͷδϣϒΛҰཡͰཧग़དྷΔ ͦΕͧΕͷδϣϒʹઆ໌͕͚ΒΕΔ ௨Λ Jenkins ʹͤΔ͜ͱ͕ग़དྷΔ ↑ʢͪΐ͍͕ඞཁʣ cron δϣϒͷॴཁ͕࣌ؒղΔ
·ͱΊ cron ͷδϣϒΧΦεʹͳΓ͕ͪ… δϣϒͷ݁Ռແࢹ͞Ε͕ͪ… Jenkins ͷδϣϒʹ݁ՌΛ POST ͢Ε݁ՌΛҰཡ ͰݟΔ͜ͱ͕ग़དྷΔʂ δϣϒͷઆ໌Λॻ͚
cron ʹઆ໌Λ͚Δ͜ͱ͕ग़ དྷΔͷͰ୭͕͍ͭͲͷΑ͏ʹઃఆ͔ͨ͠ղΔʂ
࣭ʂʁ