你的问题比较简短,通常“远程 Ubuntu Jenkins”指以下几种常见场景之一。我分别说明,你可以按需选择:
8080sudo systemctl status jenkins
curl http://localhost:8080
http://<Ubuntu_IP>:8080
如果无法访问,检查防火墙:
sudo ufw allow 8080
server {
listen 80;
server_name jenkins.example.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
ssh user@ubuntu_ip
进入后操作 Jenkins:
sudo systemctl restart jenkins
sudo tail -f /var/log/jenkins/jenkins.log
Jenkins → 用户 → Configure → API Token
curl -X POST \
http://jenkins_ip:8080/job/my-job/build \
--user admin:API_TOKEN
java -jar agent.jar \
-jnlpUrl http://jenkins_ip:8080/computer/agent-name/slave-agent.jnlp \
-secret xxxxxxxx
如果你指的是:
可以补充一句你的具体场景,我可以给更精确的方案。