82 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			82 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
| void checkout_project() {
 | |
|     checkout([
 | |
|         $class: 'GitSCM',
 | |
|         branches: [
 | |
|             [name: '*/main']
 | |
|         ],
 | |
|         extensions: [
 | |
|             [$class: 'CleanBeforeCheckout'],
 | |
|             [$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false]
 | |
|         ],
 | |
|         submoduleCfg: [],
 | |
|         userRemoteConfigs: [
 | |
|             [credentialsId: 'gitea-jenkins', url: 'https://git.minres.com/Firmware/Firmwares.git']
 | |
|         ]
 | |
|     ])
 | |
| }
 | |
| 
 | |
| void checkout_develop() {
 | |
|     dir("bare-metal-bsp") {
 | |
|         withCredentials([usernamePassword(credentialsId: 'gitea-jenkins', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD')]) {
 | |
|             sh ("git pull origin develop")
 | |
|         }
 | |
|     }
 | |
|     //sh("cd bare-metal-bsp && git checkout develop")
 | |
| }
 | |
| 
 | |
| void make_hello(board) {
 | |
|     sh("make -C hello-world/ BOARD=${board}")
 | |
|     sh("make -C hello-world/ clean")
 | |
| }
 | |
| 
 | |
| pipeline {
 | |
|     agent { docker { 
 | |
|         image 'ubuntu-riscv'
 | |
|         args '-v $HOME/.m2:/root/.m2'
 | |
|     }}
 | |
|     options {
 | |
|         // using the Timestamper plugin we can add timestamps to the console log
 | |
|         timestamps()
 | |
|         skipStagesAfterUnstable()
 | |
|     }
 | |
|     stages {
 | |
|         /*stage('checkout repo') { steps{ checkout_project()}}
 | |
|         stage('checkout develop') { steps{ checkout_develop()}}
 | |
|         stage('make iss') {steps { make_hello("iss")}}
 | |
|         stage('make hifive1') {steps { make_hello("hifive1")}}
 | |
|         stage('make TGC5L') {steps { make_hello("TGC5L")}}
 | |
|         stage('make rtl') {steps { make_hello("rtl")}}
 | |
|         stage('make ehrenberg') {steps { make_hello("ehrenberg")}}
 | |
|         stage('make tgc_vp') {steps { make_hello("tgc_vp")}}*/
 | |
|         stage('make hello-world') {
 | |
|             matrix {
 | |
|                 axes {
 | |
|                     axis{
 | |
|                         name 'BOARD'
 | |
|                         values 'iss', 'hifive1', 'TGCP', 'ehrenberg', 'rtl', 'tgc_vp'
 | |
|                     }
 | |
|                 }
 | |
|                 stages {
 | |
|                     stage('Force sequential') {
 | |
|                         options {
 | |
|                             lock("One Board at a time")
 | |
|                         }
 | |
|                         stages {
 | |
|                             stage("make") {
 | |
|                                 steps {
 | |
|                                     make_hello("${BOARD}")
 | |
|                                 }
 | |
|                             }
 | |
|                         }
 | |
|                     }
 | |
|                 }
 | |
|             } 
 | |
|         }
 | |
|     }
 | |
|     post {
 | |
|         failure {
 | |
|             sh("make -C hello-world/ clean")       
 | |
|         }
 | |
|     }
 | |
| }
 |