Last active
March 22, 2023 23:31
-
-
Save parjun8840/1a45ff743f2623f2dcebed0cd6b50db2 to your computer and use it in GitHub Desktop.
basic-job-maven
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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