Skip to content

Instantly share code, notes, and snippets.

@parjun8840
Last active March 22, 2023 23:31
Show Gist options
  • Save parjun8840/1a45ff743f2623f2dcebed0cd6b50db2 to your computer and use it in GitHub Desktop.
Save parjun8840/1a45ff743f2623f2dcebed0cd6b50db2 to your computer and use it in GitHub Desktop.
basic-job-maven
pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: maven
image: maven:alpine
command:
- cat
tty: true
'''
}
}
stages {
stage('Run maven') {
steps {
container('maven') {
sh 'mvn -version'
}
}
}
}
}
//Note: We are embedding definetion/YAML of Pod that is going to act as agent for us.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment