Skip to content

Instantly share code, notes, and snippets.

@ciis0
Last active March 5, 2021 21:07
Show Gist options
  • Save ciis0/657191ad1ea917d2d91336087250b2d2 to your computer and use it in GitHub Desktop.
Save ciis0/657191ad1ea917d2d91336087250b2d2 to your computer and use it in GitHub Desktop.
launch jenkins agent w/o jnlp, just via TCP
[Unit]
Description=Jenkins Node
[Service]
ExecStart=/var/lib/jenkins/launch-tcp.sh
User=jenkins
#!/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