trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnol...@apache.org
Subject [trafficserver-ci] branch main updated: add initial branch build pipelines
Date Thu, 24 Jun 2021 20:07:29 GMT
This is an automated email from the ASF dual-hosted git repository.

bnolsen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/trafficserver-ci.git


The following commit(s) were added to refs/heads/main by this push:
     new 7d0bf6b  add initial branch build pipelines
     new d53a1b3  Merge pull request #14 from traeak/branch_pipelines
7d0bf6b is described below

commit 7d0bf6ba073f224ece976317fcdd571ac9dff591
Author: Brian Olsen <bnolsen@gmail.com>
AuthorDate: Thu Jun 24 13:01:31 2021 -0700

    add initial branch build pipelines
---
 jenkins/branch/autest.pipeline         |  99 ++++++++++++++++++++
 jenkins/branch/branch_build.pipeline   | 165 +++++++++++++++++++++++++++++++++
 jenkins/branch/clang_analyzer.pipeline |  75 +++++++++++++++
 jenkins/branch/clang_format.pipeline   |  69 ++++++++++++++
 jenkins/branch/distro_builds.pipeline  | 101 ++++++++++++++++++++
 jenkins/branch/in_tree.pipeline        |  71 ++++++++++++++
 jenkins/branch/os_build.pipeline       |  79 ++++++++++++++++
 jenkins/branch/out_of_tree.pipeline    |  71 ++++++++++++++
 jenkins/branch/rat.pipeline            |  70 ++++++++++++++
 9 files changed, 800 insertions(+)

diff --git a/jenkins/branch/autest.pipeline b/jenkins/branch/autest.pipeline
new file mode 100644
index 0000000..2f55e19
--- /dev/null
+++ b/jenkins/branch/autest.pipeline
@@ -0,0 +1,99 @@
+pipeline {
+	agent {
+		docker {
+			registryUrl 'https://controller.trafficserver.org/'
+			image 'controller.trafficserver.org/ats/centos:8'
+			args '--init --cap-add=SYS_PTRACE --network=host -u root -v ${HOME}/ccache:/tmp/ccache:rw'
+			label 'docker'
+		}
+	}
+	environment {
+		CCACHE_DIR = "/tmp/ccache"
+	}
+
+	stages {
+		stage('Initialization') {
+			steps {
+				script {
+					currentBuild.displayName = "#${BUILD_NUMBER} ${GITHUB_BRANCH}"
+					if (env.SHA1) {
+						currentBuild.description = env.SHA1
+					}
+				}
+			}
+		}
+
+		stage('Clone') {
+			options { retry(2) }
+			steps {
+				dir('ci') {
+					git url: 'https://github.com/traeak/trafficserver-ci',
+						branch: 'full_pipeline'
+				}
+				dir('src') {
+					script {
+						String branch = env.SHA1
+						if (! branch) {
+							branch = '*/' + env.GITHUB_BRANCH
+						}
+						checkout([$class: 'GitSCM',
+							branches: [[name: branch]],
+							userRemoteConfigs: [[url: env.GITHUB_URL]]])
+					}
+				}
+
+				echo 'Finished Cloning'
+			}
+		}
+		stage('Build') {
+			steps {
+				echo 'Starting build'
+				dir('src') {
+					sh '''
+					source /opt/rh/gcc-toolset-9/enable
+					update-crypto-policies --set LEGACY
+
+					# Change permissions so that all files are readable
+					# (default user umask may change and make these unreadable)
+					chmod -R o+r .
+					autoreconf -fiv
+					./configure --enable-experimental-plugins --enable-example-plugins --prefix=/tmp/ats
--enable-werror --enable-debug --enable-wccp --enable-luajit --enable-ccache
+					make -j4
+					make install
+					'''
+				}
+			}
+		}
+
+		stage('AuTest') {
+			steps {
+				echo 'Starting AuTest'
+				dir('src/tests') {
+					sh '''
+						set +e
+						mkdir -p ${WORKSPACE}/output/${GITHUB_BRANC}
+						./autest.sh --ats-bin /tmp/ats/bin/ --sandbox /tmp/sandbox || true
+						if [ -n "$(ls -A /tmp/sandbox/)" ]; then
+							cp -rf /tmp/sandbox/ ${WORKSPACE}/output/${GITHUB_BRANC}/
+							chmod -R 777 ${WORKSPACE}
+							exit 1
+						else
+							touch ${WORKSPACE}/output/${GITHUB_BRANC}/No_autest_failures
+							chmod -R 777 ${WORKSPACE}
+							exit 0
+						fi
+						'''
+				}
+			}
+		}
+	}
+
+	post {
+		always {
+			archiveArtifacts artifacts: 'output/**/*', fingerprint: false, allowEmptyArchive: true
+		}
+		cleanup {
+			cleanWs()
+		}
+	}
+}
diff --git a/jenkins/branch/branch_build.pipeline b/jenkins/branch/branch_build.pipeline
new file mode 100644
index 0000000..e4cff67
--- /dev/null
+++ b/jenkins/branch/branch_build.pipeline
@@ -0,0 +1,165 @@
+DUMMY = false
+
+def doParallelBuilds() {
+
+	def jobnames = []
+
+	// Detect buildable os- jobs in branch folder
+	Jenkins.instance.getAllItems(Job.class).each {
+		if (it.class == org.jenkinsci.plugins.workflow.job.WorkflowJob && it.isBuildable())
{
+			def jobname = it.fullName
+			if (0 == jobname.indexOf(env.GITHUB_BRANCH + '/os-')) {
+				jobnames.add(jobname)
+			}
+		}
+	}
+
+	def builders = [:]
+
+	for (jobname in jobnames) {
+		def name = jobname
+		builders[name] = {
+			stage(name) {
+				echo name
+				script {
+					result = buildJob(name, name)
+					if (result == 'FAILURE') {
+						error("${name} build failed")
+					}
+				}
+			}
+		}
+	}
+
+	parallel builders
+}
+
+String buildJob(String ghcontext, String jobName) {
+	echo "Build of: " + jobName
+	if (DUMMY) { jobName = "Branch_Builds/dummy" }
+	def jobBuild = build(job: jobName, propagate: false,
+		parameters: [
+			string(name: 'GITHUB_URL', value: GITHUB_URL),
+			string(name: 'GITHUB_BRANCH', value: GITHUB_BRANCH),
+			string(name: 'SHA1', value: SHA1),
+		]
+	)
+	def result = jobBuild.getResult()
+	echo "Build of " + jobName + " returned result: " + result
+	if ('FAILURE' == result) { error("${jobName} failed") }
+	return result
+}
+
+def shaForBranch(url, branch) {
+	sha1 = sh (
+		script: "set -- `git ls-remote -h $url refs/heads/$branch`; echo \${1}",
+		returnStdout: true
+	).trim()
+	return sha1
+}
+
+pipeline {
+	agent none
+
+	stages {
+		stage('Initialization') {
+			agent { label 'master' }
+			steps {
+				script {
+					if (! env.GITHUB_BRANCH) {
+						def bparts = env.JOB_NAME.split('/')
+						if (2 != bparts.length) {
+							error("Invalid branch name from ${JOB_NAME}")
+						}
+						env.GITHUB_BRANCH = bparts[0]
+					}
+					currentBuild.displayName = "#${BUILD_NUMBER} ${GITHUB_BRANCH}"
+					if (! env.SHA1) {
+						env.SHA1 = shaForBranch(env.GITHUB_URL, env.GITHUB_BRANCH)
+					}
+					currentBuild.displayName = "#${BUILD_NUMBER} ${GITHUB_BRANCH}"
+					currentBuild.description = env.SHA1
+
+					sh 'printenv'
+				}
+			}
+		}
+
+		stage('Validation') {
+			parallel {
+				stage('In Tree') {
+					steps {
+						script {
+							buildJob('in_tree', env.GITHUB_BRANCH + '/in_tree')
+						}
+					}
+				}
+				stage('Out Of Tree') {
+					steps {
+						script {
+							buildJob('out_of_tree', env.GITHUB_BRANCH + '/out_of_tree')
+						}
+					}
+				}
+				stage('RAT') {
+					steps {
+						script {
+							buildJob('rat', env.GITHUB_BRANCH + '/rat')
+						}
+					}
+				}
+				stage('clang format') {
+					steps {
+						script {
+							buildJob('clang_format', env.GITHUB_BRANCH + '/clang_format')
+						}
+					}
+				}
+			}
+		}
+
+		stage('Snapshot') {
+			steps {
+				script {
+					//buildJob('snapshot', env.GITHUB_BRANCH + '/snapshot')
+					echo "Skipping snapshot"
+				}
+			}
+		}
+
+		stage('OS Builds') {
+			steps {
+				script {
+					doParallelBuilds()
+				}
+			}
+		}
+
+		stage('Verification') {
+			parallel {
+				stage('clang analyzer') {
+					steps {
+						script {
+							buildJob('clang-analyzer', env.GITHUB_BRANCH + '/clang_analyzer')
+						}
+					}
+				}
+				stage('autests') {
+					steps {
+						script {
+							buildJob('autest', env.GITHUB_BRANCH + '/autest')
+						}
+					}
+				}
+				stage('cache_tests') {
+					steps {
+						script {
+							//buildJob('cache_tests', env.GITHUB_BRANCH + '/cache-tests')
+							echo "skipping cache-tests"
+						}
+					}
+				}
+			}
+		}
+	}
+}
diff --git a/jenkins/branch/clang_analyzer.pipeline b/jenkins/branch/clang_analyzer.pipeline
new file mode 100644
index 0000000..4359214
--- /dev/null
+++ b/jenkins/branch/clang_analyzer.pipeline
@@ -0,0 +1,75 @@
+pipeline {
+	agent {
+		docker {
+			registryUrl 'https://controller.trafficserver.org/'
+			image 'controller.trafficserver.org/ats/ubuntu:20.04'
+			args '-v /home/jenkins/clang-analyzer:/tmp/clang-analyzer:rw'
+			label 'docker'
+		}			
+	}			
+
+	stages {
+		stage('Initialization') {
+			steps {
+				script {
+					if (! env.GITHUB_BRANCH) {
+						def bparts = env.JOB_NAME.split('/')
+						if (2 != bparts.length) {
+							error("Invalid branch name from ${JOB_NAME}")
+						}
+						env.GITHUB_BRANCH = bparts[0]
+					}
+
+					currentBuild.displayName = "#${BUILD_NUMBER} ${GITHUB_BRANCH}"
+					if (env.SHA1) {
+						currentBuild.description = env.SHA1
+					}
+				}
+			}
+		}
+
+		stage('Clone') {
+			options { retry(2) }
+			steps {
+				dir('ci') {
+					git url: 'https://github.com/traeak/trafficserver-ci',
+						branch: 'full_pipeline'
+				}		
+				dir('src') {
+					script {
+						String branch = env.SHA1
+						if (! branch) {
+							branch = '*/' + env.GITHUB_BRANCH
+						}
+						checkout([$class: 'GitSCM',
+							branches: [[name: branch]],
+							userRemoteConfigs: [[url: env.GITHUB_URL]]])
+					}
+				}
+				echo 'Finished Cloning'
+			}
+		}
+		stage('Build') {
+			steps {
+				echo 'Starting build'
+				dir('src') {
+					sh '''
+					enable_clang=1
+					#source ../ci/jenkins/bin/environment.sh
+					../ci/jenkins/bin/clang-analyzer.sh
+					# $status gets set in the clang-analyzer.sh script
+					#exit $status
+					'''
+				}
+			}
+		}
+	}
+	post {
+		always {
+			archiveArtifacts artifacts: 'output/**/*', fingerprint: true, allowEmptyArchive: true
+		}
+		cleanup {
+			cleanWs()
+		}
+	}
+}
diff --git a/jenkins/branch/clang_format.pipeline b/jenkins/branch/clang_format.pipeline
new file mode 100644
index 0000000..9241851
--- /dev/null
+++ b/jenkins/branch/clang_format.pipeline
@@ -0,0 +1,69 @@
+pipeline {
+	agent {
+		docker {
+			registryUrl 'https://controller.trafficserver.org/'
+			image 'controller.trafficserver.org/ats/docs_build:30'
+			label 'docker'
+			args '--network host'
+		}
+	}
+	stages {
+		stage('Initialization') {
+			steps {
+				script {
+					if (! env.GITHUB_BRANCH) {
+						def bparts = env.JOB_NAME.split('/')
+						if (2 != bparts.length) {
+							error("Invalid branch name from ${JOB_NAME}")
+						}
+						env.GITHUB_BRANCH = bparts[0]
+					}
+
+					currentBuild.displayName = "#${BUILD_NUMBER} ${GITHUB_BRANCH}"
+					if (env.SHA1) {
+						currentBuild.description = env.SHA1
+					}
+				}
+			}
+		}
+
+		stage('Clone') {
+			options { retry(2) }
+			steps {
+				dir('ci') {
+					git url: 'https://github.com/traeak/trafficserver-ci',
+						branch: 'full_pipeline'
+				}
+				dir('src') {
+					script {
+						String branch = env.SHA1
+						if (! branch) {
+							branch = '*/' + env.GITHUB_BRANCH
+						}
+						checkout([$class: 'GitSCM',
+							branches: [[name: branch]],
+							userRemoteConfigs: [[url: env.GITHUB_URL]]])
+					}
+				}
+				echo 'Finished Cloning'
+			}
+		}
+		stage('Build') {
+			steps {
+				echo 'Starting build'
+				dir('src') {
+					sh '''
+					source ../ci/jenkins/bin/environment.sh && ../ci/jenkins/bin/clang-format.sh
+					'''
+					echo "Skipping build"
+				}
+			}
+		}
+	}
+
+	post {
+		cleanup {
+			cleanWs()
+		}
+	}
+}
diff --git a/jenkins/branch/distro_builds.pipeline b/jenkins/branch/distro_builds.pipeline
new file mode 100644
index 0000000..4c6e5c7
--- /dev/null
+++ b/jenkins/branch/distro_builds.pipeline
@@ -0,0 +1,101 @@
+DRY_RUN = false
+
+def doParallelBuilds() {
+	def buildjobs = []
+
+	def types = env.TYPES.split(' ')
+	def compilers = env.COMPILERS.split(' ')
+
+	for (type in types) {
+		for (compiler in compilers) {
+			buildjobs.add([env.DISTRO, compiler, type].join(','))
+		}
+	}
+
+	String jjob = env.GITHUB_BRANCH + '/os_build'
+
+	def builders = [:]
+
+	currentBuild.result = 'SUCCESS'
+
+	for (buildjob in buildjobs) {
+		def params = buildjob.split(',')
+		def distro = params[0]
+		def compiler = params[1]
+		def type = params[2]
+		String jobName = distro + ' ' + compiler + ' ' + type
+		builders[jobName] = {
+			stage(jobName) {
+				script {
+					String name = jobName + ' ' + env.GITHUB_BRANCH
+					echo "Build: " + name
+					if (DRY_RUN) { jjob = "Branch_Builds/dummy" }
+					def buildres = build(job: jjob, propagate: false,
+						parameters: [
+							string(name: 'GITHUB_URL', value: env.GITHUB_URL),
+							string(name: 'GITHUB_BRANCH', value: env.GITHUB_BRANCH),
+							string(name: 'DISTRO', value: distro),
+							string(name: 'COMPILER', value: compiler),
+							string(name: 'TYPE', value: type)
+						])
+					if ('SUCCESS' != buildres.getResult()) {
+						error("${jobName} build failed")
+						currentBuild.result = 'FAILURE'
+					}
+				}
+			}
+		}
+	}
+
+	parallel builders
+
+}
+
+String shaForBranch(url, branch) {
+	sha1 = sh (
+		script: "set -- `git ls-remote -h $url refs/heads/$branch`; echo \${1}",
+		returnStdout: true
+	).trim()
+	return sha1
+}
+
+pipeline {
+	agent none
+
+	stages {
+		stage('Initialization') {
+			agent { label 'master' }
+			steps {
+				script {
+					if (! env.DISTRO) {
+						def dparts = env.JOB_BASE_NAME.split("_|-")
+						if (3 != dparts.length) {
+							error("Invalid job base name " + env.JOB_BASE_NAME)
+						}
+						env.DISTRO = [ dparts[1], dparts[2] ].join(':')
+					}
+					if (! env.GITHUB_BRANCH) {
+						def bparts = env.JOB_NAME.split('/')
+						if (2 != bparts.length) {
+							error("Invalid branch name from " + env.JOB_NAME)
+						}
+						env.GITHUB_BRANCH = bparts[0]
+					}
+
+					currentBuild.displayName = env.GITHUB_BRANCH + " " + env.DISTRO
+					if (! env.SHA1) {
+						env.SHA1 = shaForBranch(env.GITHUB_URL, env.GITHUB_BRANCH)
+					}
+					sh 'printenv'
+				}
+			}
+		}
+		stage('Builds') {
+			steps {
+				script {
+					doParallelBuilds()
+				}
+			}
+		}
+	}
+}
diff --git a/jenkins/branch/in_tree.pipeline b/jenkins/branch/in_tree.pipeline
new file mode 100644
index 0000000..2647f37
--- /dev/null
+++ b/jenkins/branch/in_tree.pipeline
@@ -0,0 +1,71 @@
+pipeline {
+	agent {
+		docker {
+			registryUrl 'https://controller.trafficserver.org/'
+			image 'controller.trafficserver.org/ats/fedora:32'
+			args '-v "${HOME}"/ccache:/tmp/ccache:rw'
+		}
+	}
+	
+	environment {
+		CCACHE_DIR = "/tmp/ccache"
+	}
+
+	stages {
+		stage('Initialization') {
+			steps {
+				script {
+					if (! env.GITHUB_BRANCH) {
+						def bparts = env.JOB_NAME.split('/')
+						if (2 != bparts.length) {
+							error("Invalid branch name from ${JOB_NAME}")
+						}
+						env.GITHUB_BRANCH = bparts[0]
+					}
+					currentBuild.displayName = "#${BUILD_NUMBER} ${GITHUB_BRANCH}"
+					if (env.SHA1) {
+						currentBuild.description = env.SHA1
+					}
+					sh 'printenv'
+				}
+			}
+		}
+		
+		stage('Clone') {
+			options { retry(2) }
+			steps {
+				dir('ci') {
+					git url: 'https://github.com/traeak/trafficserver-ci',
+						branch: 'full_pipeline'
+				}
+				dir('src') {
+					script {
+						String branch = env.SHA1
+						if (! branch) {
+							branch = '*/' + env.GITHUB_BRANCH
+						}
+						checkout([$class: 'GitSCM',
+							branches: [[name: branch]],
+							userRemoteConfigs: [[url: env.GITHUB_URL]]])
+					}
+				}
+			}
+		}
+		
+		stage('Build') {
+			steps {
+				dir('src') {
+					echo "Building"
+					sh '''
+					source ../ci/jenkins/bin/environment.sh && ../ci/jenkins/bin/in_tree.sh
+					'''
+				}
+			}
+		}
+	}
+	post {
+		always {
+			cleanWs()
+		}
+	}
+}
diff --git a/jenkins/branch/os_build.pipeline b/jenkins/branch/os_build.pipeline
new file mode 100644
index 0000000..834e891
--- /dev/null
+++ b/jenkins/branch/os_build.pipeline
@@ -0,0 +1,79 @@
+pipeline {
+	agent {
+		docker {
+			registryUrl 'https://controller.trafficserver.org/'
+			image 'controller.trafficserver.org/ats/${DISTRO}'
+			args '-v /home/jenkins/ccache:/tmp/ccache:rw --network=host'
+			label 'linux'
+		}
+	}
+	environment {
+		CCACHE_DIR = "/tmp/ccache"
+	}
+	stages {
+		stage('Initialization') {
+			steps {
+				script {
+					String newname = "${GITHUB_BRANCH} ${DISTRO} ${COMPILER} ${TYPE}"
+					currentBuild.displayName = "#${BUILD_NUMBER} " + newname
+					if (env.SHA1) {
+						currentBuild.description = env.SHA1
+					}
+					sh 'printenv'
+				}
+			}
+		}
+		stage('Clone') {
+			options { retry(2) }
+			steps {
+				echo 'Starting Clone'
+				dir('ci') {
+					git branch: 'full_pipeline',
+						url: 'https://github.com/traeak/trafficserver-ci'
+				}
+				dir('src') {
+					script {
+						String branch = env.SHA1
+						if (! branch) {
+							branch = '*/' + env.GITHUB_BRANCH
+						}
+						checkout([$class: 'GitSCM',
+							branches: [[name: branch]],
+							userRemoteConfigs: [[url: env.GITHUB_URL]]])
+					}
+				}
+				echo 'Finished Clone'
+			}
+		}
+		stage('Build') {
+			steps {
+				echo 'Starting Build'
+				dir('src') {
+					sh '''
+					source ../ci/jenkins/bin/environment.sh
+					autoreconf -if
+					source ../ci/jenkins/bin/build.sh
+					'''
+				}
+				echo 'Finished Build'
+			}
+		}
+		stage('Tests') {
+			steps {
+				echo 'Starting Tests'
+				dir('src') {
+					sh '''
+					source ../ci/jenkins/bin/environment.sh
+					source ../ci/jenkins/bin/regression.sh
+					'''
+				}
+				echo 'Finished Tests'
+			}
+		}
+	}
+	post {
+		cleanup {
+			cleanWs()
+		}
+	}
+}
diff --git a/jenkins/branch/out_of_tree.pipeline b/jenkins/branch/out_of_tree.pipeline
new file mode 100644
index 0000000..62f8015
--- /dev/null
+++ b/jenkins/branch/out_of_tree.pipeline
@@ -0,0 +1,71 @@
+pipeline {
+	agent {
+		docker {
+			registryUrl 'https://controller.trafficserver.org/'
+			image 'controller.trafficserver.org/ats/fedora:32'
+			args '-v "${HOME}"/ccache:/tmp/ccache:rw'
+		}
+	}
+	
+	environment {
+		CCACHE_DIR = "/tmp/ccache"
+	}
+
+	stages {
+		stage('Initialization') {
+			steps {
+				script {
+					if (! env.GITHUB_BRANCH) {
+						def bparts = env.JOB_NAME.split('/')
+						if (2 != bparts.length) {
+							error("Invalid branch name from ${JOB_NAME}")
+						}
+						env.GITHUB_BRANCH = bparts[0]
+					}
+					currentBuild.displayName = "#${BUILD_NUMBER} ${GITHUB_BRANCH}"
+					if (env.SHA1) {
+						currentBuild.description = env.SHA1
+					}
+					sh 'printenv'
+				}
+			}
+		}
+		
+		stage('Clone') {
+			options { retry(2) }
+			steps {
+				dir('ci') {
+					git url: 'https://github.com/traeak/trafficserver-ci',
+						branch: 'full_pipeline'
+				}
+				dir('src') {
+					script {
+						String branch = env.SHA1
+						if (! branch) {
+							branch = '*/' + env.GITHUB_BRANCH
+						}
+						checkout([$class: 'GitSCM',
+							branches: [[name: branch]],
+							userRemoteConfigs: [[url: env.GITHUB_URL]]])
+					}
+				}
+			}
+		}
+		
+		stage('Build') {
+			steps {
+				dir('src') {
+					echo "Building"
+					sh '''
+					source ../ci/jenkins/bin/environment.sh && ../ci/jenkins/bin/out_of_tree.sh
+					'''
+				}
+			}
+		}
+	}
+	post {
+		always {
+			cleanWs()
+		}
+	}
+}
diff --git a/jenkins/branch/rat.pipeline b/jenkins/branch/rat.pipeline
new file mode 100644
index 0000000..916a1b0
--- /dev/null
+++ b/jenkins/branch/rat.pipeline
@@ -0,0 +1,70 @@
+pipeline {
+	agent {
+		docker {
+			registryUrl 'https://controller.trafficserver.org/'
+			image 'controller.trafficserver.org/ats/docs_build:30'
+			label 'docker'
+			// We need host networking for clang-format to download
+			args '--network host'
+		}
+	}
+
+	stages {
+		stage('Initialization') {
+			steps {
+				script {
+					if (! env.GITHUB_BRANCH) {
+						def bparts = env.JOB_NAME.split('/')
+						if (2 != bparts.length) {
+							error("Invalid branch name from ${JOB_NAME}")
+						}
+						env.GITHUB_BRANCH = bparts[0]
+					}
+
+					currentBuild.displayName = "#${BUILD_NUMBER} ${GITHUB_BRANCH}"
+					if (env.SHA1) {
+						currentBuild.description = env.SHA1
+					}
+					sh 'printenv'
+				}
+			}
+		}
+		stage('Clone') {
+			options { retry(2) }
+			steps {
+				dir('ci') {
+					git url: 'https://github.com/traeak/trafficserver-ci',
+						branch: 'full_pipeline'
+				}
+				dir('src') {
+					script {
+						String branch = env.SHA1
+						if (! branch) {
+							branch = '*/' + env.GITHUB_BRANCH
+						}
+						checkout([$class: 'GitSCM',
+							branches: [[name: branch]],
+							userRemoteConfigs: [[url: env.GITHUB_URL]]])
+					}
+				}
+				echo 'Finished Cloning'
+			}
+		}
+		stage('Build') {
+			steps {
+				echo 'Starting build'
+				dir('src') {
+					sh '''
+					source ../ci/jenkins/bin/environment.sh && ../ci/jenkins/bin/rat.sh
+					'''
+				}
+			}
+		}
+	}
+	
+	post {
+		cleanup {
+			cleanWs()
+		}
+	}
+}

Mime
View raw message