Skip to content

Instantly share code, notes, and snippets.

@abdennour
Created June 8, 2020 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abdennour/663450d6104596e8d7d73b5aeeeaa251 to your computer and use it in GitHub Desktop.
Save abdennour/663450d6104596e8d7d73b5aeeeaa251 to your computer and use it in GitHub Desktop.
pipeline {
agent any
stages {
stage('Build') {
parallel {
stage("build-ui") {
agent {
kubernetes {
defaultContainer 'jnlp'
yamlFile 'pod.yaml'
}
}
steps {
container('dind') {
sh "docker-build.sh -s=AAA -t=${env.BUILD_NUMBER}-${env.BRANCH_NAME}"
}
}
}
stage("build-form-render") {
agent {
kubernetes {
defaultContainer 'jnlp'
yamlFile 'pod.yaml'
}
}
steps {
container('dind') {
sh "docker-build.sh -s=BBB -t=${env.BUILD_NUMBER}-${env.BRANCH_NAME}"
}
}
}
} // end parallel DSL
}
}
}
apiVersion: v1
kind: Pod
spec:
# dnsConfig:
# options:
# - name: ndots
# value: "1"
#
# The below serviceAccount has been created by:
# eksctl create iamserviceaccount \
# --name pipeline-builder \
# --namespace cicd \
# --cluster innovativeits-cluster \
# --attach-policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess \
# --approve
serviceAccountName: pipeline-builder
containers:
- name: dind
image: abdennour/docker:19.03-dind-compose1.25.1-aws1.17.0
command:
- cat
tty: true
volumeMounts:
- name: dockersock
readOnly: true
mountPath: /var/run/docker.sock
resources:
requests:
cpu: 500m
memory: 768Mi
limits:
cpu: 2000m
memory: 2048Mi
# - name: busybox
# image: busybox
# command:
# - cat
# tty: true
volumes:
- name: dockersock
hostPath:
path: /var/run/docker.sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment