Kubernetes Docker image providing Jenkins Slave JNLP with PHP and Composer.
tool | version |
---|---|
composer | 1.6.3 |
php | 7.0.25 |
git | apt-get |
curl, wget | apt-get |
zip, bzip2 | apt-get |
jq | apt-get |
Use with Kubernetes Jenkins Plugin like so:
podTemplate(
name: 'php-v3',
label: 'k8s-jenkins-slave-php-v3',
cloud: 'mycloud',
nodeSelector: 'failure-domain.beta.kubernetes.io/zone=eu-west-1a',
containers: [
containerTemplate(
name: 'jnlp',
image: 'cloutainer/k8s-jenkins-slave-php:v3',
privileged: false,
command: '/opt/docker-entrypoint.sh',
args: '',
alwaysPullImage: false,
workingDir: '/home/jenkins',
resourceRequestCpu: '500m',
resourceLimitCpu: '1',
resourceRequestMemory: '3000Mi',
resourceLimitMemory: '3000Mi'
)
]
) {
node('k8s-jenkins-slave-php-v3') {
stage('build and test') {
sh 'mvn -version'
sh 'git clone https://github.com/clouless/WHATEVERAPP.git'
dir('whateverapp') {
sh 'composer require'
}
}
}
}