and when compiling, I use make -j (multi-processing) command.
So I think creating one pod and multiple containers in Jenkins is not good idea due to heavy CPU and memory needed.
I think Jenkins should be able to create multiple pods. Am I right?
Is it possible ?
In scripted pipeline, I create two container in a one pod successfully. But I don't know create two pods.
podTemplate(
label: 'mypod',
containers: [
containerTemplate(name: 'm1', image: 'maven', ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'm2', image: 'maven', ttyEnabled: true, command: 'cat')
],
volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock'),
]
) {
node('mypod') {
stage('Sync') {
parallel Syncfortype1: {
container(name: 'm1', shell: '/bin/bash') {
sync
}
},
Syncfortype2: {
container(name: 'm2', shell: '/bin/bash') {
sync
}
}
}
}
}
pipeline {
agent none
stages {
stage('Example Build') {
agent { docker 'maven:3-alpine' }
steps {
echo 'Hello, Maven'
sh 'mvn --version'
}
}
stage('Example Test') {
agent { docker 'openjdk:8-jre' }
steps {
echo 'Hello, JDK'
sh 'java -version'
}
}
}
}--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e33ae964-ee84-4dc5-9f85-60335c265f6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c88427d7-2668-4975-b133-a49bd894ca64%40googlegroups.com.