Skip to content

Commit 4f9a9bf

Browse files
committed
add jenkins pipeline to run build and verify
1 parent 0a9490f commit 4f9a9bf

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

Jenkinsfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
pipeline {
2+
3+
agent {
4+
kubernetes {
5+
yamlFile 'jenkins/agent.yaml'
6+
defaultContainer 'maven'
7+
}
8+
}
9+
10+
options {
11+
disableConcurrentBuilds()
12+
buildDiscarder(logRotator(numToKeepStr: '100'))
13+
timeout(time: 30, unit: 'MINUTES')
14+
}
15+
16+
stages {
17+
stage("Setup") {
18+
steps {
19+
sh '''
20+
apt update
21+
apt install -y binutils cpio libaio1 libaio-dev libnuma-dev rpm2cpio tree xz-utils
22+
printenv | sort
23+
'''
24+
}
25+
}
26+
27+
stage ("Maven") {
28+
steps {
29+
sh '''
30+
mvn verify
31+
'''
32+
}
33+
}
34+
}
35+
36+
post {
37+
always {
38+
archiveArtifacts artifacts: "surefire-reports/",
39+
allowEmptyArchive: true
40+
}
41+
fixed {
42+
slackSend(color: "good", message: "fixed ${RUN_DISPLAY_URL}")
43+
}
44+
failure {
45+
slackSend(color: "danger", message: "failure ${RUN_DISPLAY_URL}")
46+
}
47+
}
48+
}

jenkins/agent.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
namespace: oss-agent
5+
labels:
6+
containers: maven
7+
spec:
8+
nodeSelector:
9+
eks.amazonaws.com/nodegroup: eks-oss-presto-dynamic-managed-ng
10+
serviceAccountName: oss-agent
11+
containers:
12+
- name: maven
13+
image: maven:3.8.6-openjdk-8-slim
14+
tty: true
15+
resources:
16+
requests:
17+
memory: "3Gi"
18+
cpu: "500m"
19+
limits:
20+
memory: "3Gi"
21+
cpu: "500m"
22+
env:
23+
- name: MAVEN_OPTS
24+
value: "-Xmx3g -Xms3g"
25+
command:
26+
- cat

0 commit comments

Comments
 (0)