From 4ff87fda4b6c6eae03d2bab2ea7cd59a41a42e37 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Mon, 15 Aug 2022 15:36:07 -0400 Subject: [PATCH] [releng] Add Jenkinsfile for CDT 10.7 branch --- .gitattributes | 6 ++ Jenkinsfile | 71 +++++++++++++++++++ .../cdt-full-pod-plus-eclipse-install.yaml | 39 ++++++++++ jenkins/pod-templates/cdt-full-pod-small.yaml | 39 ++++++++++ .../pod-templates/cdt-full-pod-standard.yaml | 39 ++++++++++ 5 files changed, 194 insertions(+) create mode 100644 Jenkinsfile create mode 100644 jenkins/pod-templates/cdt-full-pod-plus-eclipse-install.yaml create mode 100644 jenkins/pod-templates/cdt-full-pod-small.yaml create mode 100644 jenkins/pod-templates/cdt-full-pod-standard.yaml diff --git a/.gitattributes b/.gitattributes index 56063d762bb..c618327289d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -36,6 +36,12 @@ Makefile text # file permission +x *.sh text +# Build files +*.Jenkinsfile text +Jenkinsfile text +*.yaml text +*.yml text + # Qt *.pro text *.qml text diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000000..b74b2c50882 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,71 @@ +pipeline { + agent any + options { + timestamps() + } + stages { + stage('Run Build') { + failFast false + parallel { + stage('Code Formatting Checks') { + agent { + kubernetes { + yamlFile 'jenkins/pod-templates/cdt-full-pod-plus-eclipse-install.yaml' + } + } + steps { + container('cdt') { + timeout(activity: true, time: 30) { + withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) { + sh 'JAVA_HOME=$JAVA11_HOME PATH=$JAVA_HOME/bin:$PATH MVN="/usr/share/maven/bin/mvn -Dmaven.repo.local=/home/jenkins/.m2/repository \ + --settings /home/jenkins/.m2/settings.xml" ./releng/scripts/check_code_cleanliness.sh' + } + } + } + } + post { + always { + container('cdt') { + archiveArtifacts allowEmptyArchive: true, artifacts: '*.log,native/org.eclipse.cdt.native.serial/**,core/org.eclipse.cdt.core.*/**' + } + } + } + } + stage('Build and verify') { + agent { + kubernetes { + yamlFile 'jenkins/pod-templates/cdt-full-pod-standard.yaml' + } + } + steps { + container('cdt') { + timeout(activity: true, time: 20) { + withEnv(['MAVEN_OPTS=-XX:MaxRAMPercentage=60.0']) { + sh 'JAVA_HOME=$JAVA11_HOME PATH=$JAVA_HOME/bin:$PATH /usr/share/maven/bin/mvn \ + clean verify -B -V \ + -Dmaven.test.failure.ignore=true \ + -DexcludedGroups=flakyTest,slowTest \ + -P baseline-compare-and-replace \ + -Ddsf.gdb.tests.timeout.multiplier=50 \ + -Dindexer.timeout=300 \ + -P production \ + -Dmaven.repo.local=/home/jenkins/.m2/repository \ + --settings /home/jenkins/.m2/settings.xml \ + ' + } + } + } + } + post { + always { + container('cdt') { + junit '*/*/target/surefire-reports/*.xml,terminal/plugins/org.eclipse.tm.terminal.test/target/surefire-reports/*.xml' + archiveArtifacts '*/*/target/surefire-reports/**,terminal/plugins/org.eclipse.tm.terminal.test/target/surefire-reports/**,**/target/work/data/.metadata/.log,releng/org.eclipse.cdt.repo/target/org.eclipse.cdt.repo.zip,releng/org.eclipse.cdt.repo/target/repository/**,releng/org.eclipse.cdt.testing.repo/target/org.eclipse.cdt.testing.repo.zip,releng/org.eclipse.cdt.testing.repo/target/repository/**,debug/org.eclipse.cdt.debug.application.product/target/product/*.tar.gz,debug/org.eclipse.cdt.debug.application.product/target/products/*.zip,debug/org.eclipse.cdt.debug.application.product/target/products/*.tar.gz,debug/org.eclipse.cdt.debug.application.product/target/repository/**,lsp4e-cpp/org.eclipse.lsp4e.cpp.site/target/repository/**,lsp4e-cpp/org.eclipse.lsp4e.cpp.site/target/org.eclipse.lsp4e.cpp.repo.zip' + } + } + } + } + } + } + } +} diff --git a/jenkins/pod-templates/cdt-full-pod-plus-eclipse-install.yaml b/jenkins/pod-templates/cdt-full-pod-plus-eclipse-install.yaml new file mode 100644 index 00000000000..f788287b877 --- /dev/null +++ b/jenkins/pod-templates/cdt-full-pod-plus-eclipse-install.yaml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: Pod +spec: + containers: + - name: cdt + image: quay.io/eclipse-cdt/cdt-infra-plus-eclipse-install@sha256:efa01be7dc63af2f239fff3ea929d2d79b07084983e9ab859eb480fcc17b5ba2 + tty: true + args: ["/bin/sh", "-c", "/home/vnc/.vnc/xstartup.sh && cat"] + resources: + requests: + memory: "2662Mi" + cpu: "1" + limits: + memory: "2662Mi" + cpu: "1" + volumeMounts: + - name: settings-xml + mountPath: /home/jenkins/.m2/settings.xml + subPath: settings.xml + readOnly: true + - name: m2-repo + mountPath: /home/jenkins/.m2/repository + - name: jnlp + resources: + requests: + memory: "512Mi" + cpu: "200m" + limits: + memory: "512Mi" + cpu: "500m" + volumes: + - name: settings-xml + secret: + secretName: m2-secret-dir + items: + - key: settings.xml + path: settings.xml + - name: m2-repo + emptyDir: {} diff --git a/jenkins/pod-templates/cdt-full-pod-small.yaml b/jenkins/pod-templates/cdt-full-pod-small.yaml new file mode 100644 index 00000000000..18f6b50c3a8 --- /dev/null +++ b/jenkins/pod-templates/cdt-full-pod-small.yaml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: Pod +spec: + containers: + - name: cdt + image: quay.io/eclipse-cdt/cdt-infra-eclipse-full@sha256:b892f93d8b2a2acbb6045438f8771790d31b4722040ca815d391b532cc796182 + tty: true + args: ["/bin/sh", "-c", "/home/vnc/.vnc/xstartup.sh && cat"] + resources: + requests: + memory: "2Gi" + cpu: "1" + limits: + memory: "2Gi" + cpu: "1" + volumeMounts: + - name: settings-xml + mountPath: /home/jenkins/.m2/settings.xml + subPath: settings.xml + readOnly: true + - name: m2-repo + mountPath: /home/jenkins/.m2/repository + - name: jnlp + resources: + requests: + memory: "512Mi" + cpu: "200m" + limits: + memory: "512Mi" + cpu: "500m" + volumes: + - name: settings-xml + secret: + secretName: m2-secret-dir + items: + - key: settings.xml + path: settings.xml + - name: m2-repo + emptyDir: {} diff --git a/jenkins/pod-templates/cdt-full-pod-standard.yaml b/jenkins/pod-templates/cdt-full-pod-standard.yaml new file mode 100644 index 00000000000..3d901b200c6 --- /dev/null +++ b/jenkins/pod-templates/cdt-full-pod-standard.yaml @@ -0,0 +1,39 @@ +apiVersion: v1 +kind: Pod +spec: + containers: + - name: cdt + image: quay.io/eclipse-cdt/cdt-infra-eclipse-full@sha256:b892f93d8b2a2acbb6045438f8771790d31b4722040ca815d391b532cc796182 + tty: true + args: ["/bin/sh", "-c", "/home/vnc/.vnc/xstartup.sh && cat"] + resources: + requests: + memory: "2662Mi" + cpu: "1" + limits: + memory: "2662Mi" + cpu: "1" + volumeMounts: + - name: settings-xml + mountPath: /home/jenkins/.m2/settings.xml + subPath: settings.xml + readOnly: true + - name: m2-repo + mountPath: /home/jenkins/.m2/repository + - name: jnlp + resources: + requests: + memory: "512Mi" + cpu: "200m" + limits: + memory: "512Mi" + cpu: "500m" + volumes: + - name: settings-xml + secret: + secretName: m2-secret-dir + items: + - key: settings.xml + path: settings.xml + - name: m2-repo + emptyDir: {}