From edc7687961e34f7d721c166c1bad878b92ba02a0 Mon Sep 17 00:00:00 2001 From: kev Date: Wed, 10 Mar 2021 12:05:02 +0800 Subject: [PATCH] update jenkins/inbound-agent --- jenkins/agent/README.md | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/jenkins/agent/README.md b/jenkins/agent/README.md index 7cc2b65..cbf673c 100644 --- a/jenkins/agent/README.md +++ b/jenkins/agent/README.md @@ -4,7 +4,10 @@ jenkins/inbound-agent ## how to - Enable TCP port 50000 for inbound agents: http://jenkins:8080/configureSecurity/ -- Create New Node: http://jenkins:8080/computer/ +- Create New Node: http://jenkins:8080/computer/createItem + - Name: docker-inbound-agent-1 + - Remote root directory: /home/jenkins/agent + - Launch method: Launch agent by connecting it to the master - Get Jenkins Secret: http://jenkins:8080/script/ ```groovy @@ -20,3 +23,34 @@ $ mkdir -p data $ chown 1000:1000 data $ docker-compose up -d ``` + +## proxy + +Edit two files in container to support proxy. + +```bash +$ docker-compose exec --user root inbound-agent bash +>>> apt update +>>> apt install ncat vim +>>> exit +$ docker-compose exec inbound-agent bash +>>> mkdir -m 700 ~/.ssh +>>> vim -p ~/.ssh/config ~/.gitconfig +>>> exit +``` + +File: ~/.ssh/config + +``` +Host github.com + Hostname github.com + User git + Proxycommand ncat --proxy x.x.x.x:1080 --proxy-type socks5 %h %p +``` + +File: ~/.gitconfig + +``` +[http "https://github.com"] + proxy = http://x.x.x.x:8123 +```