SlideShare a Scribd company logo
1 of 5
Jenkins CI
What is it?
ก่อนแรกมาทาความรู้จักกับ CI ก่อนนะครับ
 CI (Continuous Integration) คือแนวคิด ทัศนะคติ รวมไป
ถึงวัฒนธรรมของทีมและองค์กร
 สิ่งที่ทีมพัฒนาควรจะตกลงร่วมกันในการพัฒนา
1. เมื่อมีเราทาการดึง code จาก repository ล่าสุดลงมาแล้ว จะต้อง
สามารถ build และทดสอบผ่านทั้งหมดอยู่เสมอ
2. ทุกๆ คนจะต้องทาการ check-in code ไปยัง repository ทุกๆ
ชั่วโมง หรือ ทุกๆ การเปลี่ยนแปลง ยิ่งทาบ่อยยิ่งดี เพราะว่าการ check-in มัน
จะทาให้เกิดการพูดคุยภายในทีมอยู่เสมอ
จากข้อตกลงข้างต้นนั้น
เราจะทาให้มันเกิดขึ้นได้อย่างไรล่ะ?
1. ก่อนที่จะทาการ Check-in code ของคุณไปยัง repository นั้น
จะต้องทาการ build และต้องทดสอบผ่านทั้งหมด
2. แจ้งหรือตะโกนบอกให้ทีมรู้ว่า เราทาการแก้ไข code แล้วนะ เพื่อให้แต่ละคนทาการดึง
code ล่าสุดลงมา เพื่อทาให้มั่นใจว่าการ integrate มันผ่านและทางานได้จริงๆ
นะ
3. ทาการ Check-in code ไปยัง repository
4. จะต้องมีเครื่อง server หรือเครื่องแยกออกมา ทาการดึง code ล่าสุดจาก
repository ลงมา แล้วทาการ build และ ทดสอบทั้งหมดอีกครั้ง เพื่อให้มั่นใจ
ว่าทุกๆ อย่างผ่านนะ และในขั้นตอนนี้จะทาให้ไม่เกิดคาพูดที่ว่า มันสามารถทางานได้บน
เครื่องผม/หนู นะ!! ดังนั้นถ้าเกิดปัญหาหรือข้อผิดพลาดขึ้นมาก็กลับไปแก้ไขใหม่หรือ
rollback กลับไป และกลับไปทาข้อ 1 อีกครั้ง
5. เมื่อข้อ 4 ผ่านแล้ว ให้บอกทุกๆ คนในทีมทาการดึง code ชุดล่าสุดจาก
repository ลงมาอีกครั้งหนึ่ง
แล้วเราจะลดขั้นตอนการทางานได้อย่างไรล่ะ?
 คาถามนี้แหละ เป็นเหตุผลที่ต้องให้ทีมเริ่มมองหาเครื่องมือมาช่วยทาในข้อ 4 เพื่อ
รวบรวมขั้นตอนการทางานจากขั้นตอนการทางานของแต่ละคนในทีม ซึ่งทุกคนจะต้อง
ทางานด้วยขั้นตอนเหมือนกันด้วยนะ
 ตัวอย่างเครื่องมือข้างต้นก็เช่น
 SVN (Subversion)
 CVS (Concurrent Versions System)
 GIT
 และอื่นๆ อีกมากมาย
กับมาที่ Jenkins มันคืออะไร?
 Jenkins ก็คือ open source continuous integration
tools เขียนโดย java และยัง support พวก source code
management อย่าง git, svn, cvs อีกด้วย
 สรุปก็คือ Jenkins จะเข้ามาช่วยทา CI และ Jenkins ยังสามารถเฝ้า
repository ใดๆก็ได้เมื่อเกิดการ commit ขึ้น jenkins จะทาการ
build version นั้นให้ทันที แล้วเราสามารถกาหนดได้ว่า หาก build สาเร็จให้
ลองรัน test case ก็ได้หรือจะให้ทาอะไร อื่นๆ ต่อไปได้
 หลักการของ Jenkins คือเราจะต้องสร้าง Job ขึ้นมาก่อน แล้วกาหนดว่า Job นี้
จะใช้อะไรในการ Build หลังจาก Build สาเร็จแล้วให้ทาอะไร เมื่อได้ Job แล้วเรา
ก็สามารถควบคุม Job นี้อีกทีได้เช่นตั้งเวลาการทางาน หรือจะสั่ง build โดยตรงเลย
ก็ได้

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

TEST-Jenkins ci

  • 2. ก่อนแรกมาทาความรู้จักกับ CI ก่อนนะครับ  CI (Continuous Integration) คือแนวคิด ทัศนะคติ รวมไป ถึงวัฒนธรรมของทีมและองค์กร  สิ่งที่ทีมพัฒนาควรจะตกลงร่วมกันในการพัฒนา 1. เมื่อมีเราทาการดึง code จาก repository ล่าสุดลงมาแล้ว จะต้อง สามารถ build และทดสอบผ่านทั้งหมดอยู่เสมอ 2. ทุกๆ คนจะต้องทาการ check-in code ไปยัง repository ทุกๆ ชั่วโมง หรือ ทุกๆ การเปลี่ยนแปลง ยิ่งทาบ่อยยิ่งดี เพราะว่าการ check-in มัน จะทาให้เกิดการพูดคุยภายในทีมอยู่เสมอ
  • 3. จากข้อตกลงข้างต้นนั้น เราจะทาให้มันเกิดขึ้นได้อย่างไรล่ะ? 1. ก่อนที่จะทาการ Check-in code ของคุณไปยัง repository นั้น จะต้องทาการ build และต้องทดสอบผ่านทั้งหมด 2. แจ้งหรือตะโกนบอกให้ทีมรู้ว่า เราทาการแก้ไข code แล้วนะ เพื่อให้แต่ละคนทาการดึง code ล่าสุดลงมา เพื่อทาให้มั่นใจว่าการ integrate มันผ่านและทางานได้จริงๆ นะ 3. ทาการ Check-in code ไปยัง repository 4. จะต้องมีเครื่อง server หรือเครื่องแยกออกมา ทาการดึง code ล่าสุดจาก repository ลงมา แล้วทาการ build และ ทดสอบทั้งหมดอีกครั้ง เพื่อให้มั่นใจ ว่าทุกๆ อย่างผ่านนะ และในขั้นตอนนี้จะทาให้ไม่เกิดคาพูดที่ว่า มันสามารถทางานได้บน เครื่องผม/หนู นะ!! ดังนั้นถ้าเกิดปัญหาหรือข้อผิดพลาดขึ้นมาก็กลับไปแก้ไขใหม่หรือ rollback กลับไป และกลับไปทาข้อ 1 อีกครั้ง 5. เมื่อข้อ 4 ผ่านแล้ว ให้บอกทุกๆ คนในทีมทาการดึง code ชุดล่าสุดจาก repository ลงมาอีกครั้งหนึ่ง
  • 4. แล้วเราจะลดขั้นตอนการทางานได้อย่างไรล่ะ?  คาถามนี้แหละ เป็นเหตุผลที่ต้องให้ทีมเริ่มมองหาเครื่องมือมาช่วยทาในข้อ 4 เพื่อ รวบรวมขั้นตอนการทางานจากขั้นตอนการทางานของแต่ละคนในทีม ซึ่งทุกคนจะต้อง ทางานด้วยขั้นตอนเหมือนกันด้วยนะ  ตัวอย่างเครื่องมือข้างต้นก็เช่น  SVN (Subversion)  CVS (Concurrent Versions System)  GIT  และอื่นๆ อีกมากมาย
  • 5. กับมาที่ Jenkins มันคืออะไร?  Jenkins ก็คือ open source continuous integration tools เขียนโดย java และยัง support พวก source code management อย่าง git, svn, cvs อีกด้วย  สรุปก็คือ Jenkins จะเข้ามาช่วยทา CI และ Jenkins ยังสามารถเฝ้า repository ใดๆก็ได้เมื่อเกิดการ commit ขึ้น jenkins จะทาการ build version นั้นให้ทันที แล้วเราสามารถกาหนดได้ว่า หาก build สาเร็จให้ ลองรัน test case ก็ได้หรือจะให้ทาอะไร อื่นๆ ต่อไปได้  หลักการของ Jenkins คือเราจะต้องสร้าง Job ขึ้นมาก่อน แล้วกาหนดว่า Job นี้ จะใช้อะไรในการ Build หลังจาก Build สาเร็จแล้วให้ทาอะไร เมื่อได้ Job แล้วเรา ก็สามารถควบคุม Job นี้อีกทีได้เช่นตั้งเวลาการทางาน หรือจะสั่ง build โดยตรงเลย ก็ได้