The procedures in this chapter are for new installations of Jenkins. Jenkins is typically run as a standalone application in its own process with the built-in Java servlet container/application server (Jetty). Jenkins can also be run as a servlet in different Java servlet containers such as Apache Tomcat or GlassFish. However, instructions for setting up these types of installations are beyond the scope of this chapter. Please submit your feedback about this page through this quick form. Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful? See existing feedback here. Bạn cần có setup sẵn 1 máy Windows với OpenJDK hoặc có hỗ trợ Java. Cài OpenJDK
Tạo Node trên Jenkins
Download Jenkins Slave và cài đặt
Chi tiết cấu hình file bạn có thể tham khảo tại đây <service> <id>JenkinsSlave</id> <name>Jenkins agent</name> <description>This service runs an agent for Jenkins automation server.</description> <executable>%JAVA_HOME%\bin\java.exe</executable> <arguments>-Xrs -jar "%BASE%\slave.jar" -jnlpUrl https://[yourjenkins.com]/computer/yournode/jenkins-agent.jnlp -secret 12asddg3s412asddg3s412asddg3s412asddg3s4buhie74 -workDir "C:\jenkins"</arguments> <logmode>rotate</logmode> <onfailure action="restart"> <download from="https://[yourjenkins.com]/jnlpJars/slave.jar" to="%BASE%\slave.jar"> <extensions> <extension className="winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension" enabled="true" id="killOnStartup"> <pidfile>%BASE%\jenkins_agent.pid</pidfile> <stopTimeout>5000</stopTimeout> <stopParentFirst>false</stopParentFirst> </extension> </extensions> </download> </onfailure> </service> Chạy lệnh Khi cài đặt thành công, bạn sẽ nhận được message “Installing the service with id ‘JenkinsSlave’…”. Bạn có thể kiểm tra service bằng cách vào me menu Windows StartRun rồi gõ services.msc Lỗi hay gặpAgent chưa được mở inbound cho phép slave kế nối Jenkins master. Message lỗi sẽ có đoạn Bạn kiểm tra xem Jenkins đã được bật cấu hình cho phép kế slave nối. Hãy vào Jenkins -> Global Security Configuration -> Agents -> Agent protocols -> Inbound TCP Agent Protocol/4 (TLS encryption). Save và thử kiế start slave lại nhé. |