Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow creating Pod templates from yaml
- Loading branch information
Showing
13 changed files
with
547 additions
and
62 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* This pipeline will execute a simple Maven build using a pod template in yaml | ||
*/ | ||
|
||
podTemplate(label: 'maven', yaml: """ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
some-label: some-label-value | ||
spec: | ||
containers: | ||
- name: maven | ||
image: maven:3.3.9-jdk-8-alpine | ||
command: | ||
- cat | ||
tty: true | ||
env: | ||
- name: CONTAINER_ENV_VAR | ||
value: container-env-var-value | ||
""" | ||
) { | ||
|
||
node('maven') { | ||
stage('Build a Maven project') { | ||
git 'https://github.com/jenkinsci/kubernetes-plugin.git' | ||
container('maven') { | ||
sh 'mvn -B clean package' | ||
} | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.