Skip to content

Commit

Permalink
Merge pull request #37 from alekhyal/master
Browse files Browse the repository at this point in the history
podTemplate updated in Jenkins file
  • Loading branch information
bgeesaman authored Oct 30, 2019
2 parents 715220b + b552b25 commit 6e17274
Showing 1 changed file with 17 additions and 32 deletions.
49 changes: 17 additions & 32 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,26 @@ limitations under the License.
// Reference: https://github.com/jenkinsci/kubernetes-plugin

// set up pod label and GOOGLE_APPLICATION_CREDENTIALS (for Terraform)
def label = "k8s-infra"
def containerName = "k8s-node"
def containerName = "gke-rbac"
def GOOGLE_APPLICATION_CREDENTIALS = '/home/jenkins/dev/jenkins-deploy-dev-infra.json'
def jenkins_container_version = env.JENKINS_CONTAINER_VERSION

podTemplate(label: label, yaml: """
apiVersion: v1
kind: Pod
metadata:
labels:
jenkins: build-node
spec:
containers:
- name: ${containerName}
image: gcr.io/pso-helmsman-cicd/jenkins-k8s-node:jenkins-cicd_images_builder-185
command: ['cat']
tty: true
volumeMounts:
# Mount the dev service account key
- name: dev-key
mountPath: /home/jenkins/dev
resources:
limits:
cpu: 2
memory: 2Gi
requests:
cpu: 1
memory: 1Gi
volumes:
# Create a volume that contains the dev json key that was saved as a secret
- name: dev-key
secret:
secretName: jenkins-deploy-dev-infra
"""
podTemplate(
containers: [
containerTemplate(name: "${containerName}",
image: "gcr.io/pso-helmsman-cicd/jenkins-k8s-node:${jenkins_container_version}",
command: 'tail -f /dev/null',
resourceRequestCpu: '1000m',
resourceLimitCpu: '2000m',
resourceRequestMemory: '1Gi',
resourceLimitMemory: '2Gi'
)
],
volumes: [secretVolume(mountPath: '/home/jenkins/dev',
secretName: 'jenkins-deploy-dev-infra'
)]
) {
node(label) {
node(POD_LABEL) {
try {
// Options covers all other job properties or wrapper functions that apply to entire Pipeline.
properties([disableConcurrentBuilds()])
Expand Down

0 comments on commit 6e17274

Please sign in to comment.