This is a demo for Jenkins CI/CD pipeline for CSC11007 - Introduction to DevOps.
- Tạo job mới để chạy bài tập: "demo test ci-main" bằng script (ko dùng jenkinsfile)
- point to github (5 phút quét)
- script: chèn trực tiếp trong job
Set Poll SCM:
H/5 * * * *để Jenkins tự động quét repo sau mỗi 5 phút.
- Tạo job mới để chạy bài tập: "demo test ci-main" bằng Jenkinsfile
- point to github (5 phút quét)
- link tới jenkinsfile trong repo
Để Jenkinsfile trong repo để Jenkins quét
Branch mặc định trên jenkins là
master(nhớ sửa)
- Add agent vào Jenkins with label:
for-testing
- Vào Jenkins -> Manage Jenkins -> Nodes -> New Node
Remote root directory:
/home/jenkins
Labels:
for-testing
Launch method: Launch agents via SSH và nhập HOST, CREDENTIALS username/password do thầy cấp (8 đô của thầy :D)
Host key chọn:
Non verifying Verification Strategy
- Update code chạy job trên Agent
- Tạo parameters trong Jenkins để có Option chạy test hay không ?
- Run test => dropdown: Yes/No
- Nếu chọn Yes => chạy stage test, nếu chọn No => ko chạy



