-
-
Save IronCore864/40b88278ffe8bc25d685d6922e59aecb to your computer and use it in GitHub Desktop.
Jenkins
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
podTemplate(yaml: ''' | |
apiVersion: v1 | |
kind: Pod | |
spec: | |
containers: | |
- name: maven | |
image: maven:3.8.1-jdk-8 | |
command: | |
- sleep | |
args: | |
- 99d | |
- name: golang | |
image: golang:1.16.5 | |
command: | |
- sleep | |
args: | |
- 99d | |
''') { | |
node(POD_LABEL) { | |
stage('Get a Maven project') { | |
git 'https://github.com/jenkinsci/kubernetes-plugin.git' | |
container('maven') { | |
stage('Build a Maven project') { | |
sh 'mvn -B -ntp clean install' | |
} | |
} | |
} | |
stage('Get a Golang project') { | |
git url: 'https://github.com/hashicorp/terraform-provider-google.git', branch: 'main' | |
container('golang') { | |
stage('Build a Go project') { | |
sh ''' | |
mkdir -p /go/src/github.com/hashicorp | |
ln -s `pwd` /go/src/github.com/hashicorp/terraform | |
cd /go/src/github.com/hashicorp/terraform && make | |
''' | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment