cvakiitho / agentify

Dockerfile to make a jnlp jenkins agent from *any docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Agentify

Create jenkins jnlp agent from *any image.

setup for kubernetes jnlp pod:

Pod Template
 	Name	
<node name>
 	Namespace	
<k8n namespace>
 	Labels	
<node label>
 	Usage	
Only build jobs with label expressions matching this node
 	Pod template to inherit from	
 	Containers	
Container Template
 	Name	
jnlp
 	Docker image	
<this image location>
 	Always pull image	
 	Working directory	
/home/jenkins/agent
 	Command to run	
 	Arguments to pass to the command	
${computer.jnlpmac} ${computer.name} 
 	Allocate pseudo-TTY	
checked

if you want to also use nested nodes ( for example for parallel runs)

you need to set another container with same name as pod template name


Container Template
 	Name	
<node name
 	Docker image	
<image locaiton>
 	Always pull image	
 	Working directory	
/home/jenkins/agent
 	Command to run	
/bin/bash -c
 	Arguments to pass to the command	
cat
 	Allocate pseudo-TTY	
checked

and do this little trick:

    this.steps.functions.node = this.steps.functions.container

About

Dockerfile to make a jnlp jenkins agent from *any docker


Languages

Language:Shell 79.8%Language:Dockerfile 20.2%