Last active
March 5, 2021 21:07
-
-
Save ciis0/657191ad1ea917d2d91336087250b2d2 to your computer and use it in GitHub Desktop.
launch jenkins agent w/o jnlp, just via TCP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Jenkins Node | |
[Service] | |
ExecStart=/var/lib/jenkins/launch-tcp.sh | |
User=jenkins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# launch agent w/o jnlp, just via TCP | |
# https://github.com/jenkinsci/remoting/blob/5a08bc5e5e/docs/inbound-agent.md#connect-directly-to-tcp-port | |
# -- ciis0, Apr 09, 2020 | |
cd $(dirname $0) | |
# hudson.remoting.Base64.encode(org.jenkinsci.main.modules.instance_identity.InstanceIdentity.get().getPublic().getEncoded()) | |
instance_id= | |
secret= | |
agent= | |
master=ci.example.com:50000 | |
java -cp agent.jar hudson.remoting.jnlp.Main \ | |
-headless \ | |
-noreconnect \ | |
-workDir $HOME/jenkins \ | |
-direct $master \ | |
-protocols JNLP4-connect \ | |
-instanceIdentity @<(cat <<<$instance_id) \ | |
@<(cat <<<$secret) $agent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment