Jenkins build file
This commit is contained in:
		
							
								
								
									
										43
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								Jenkinsfile
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
pipeline {
 | 
			
		||||
    agent {
 | 
			
		||||
        docker {
 | 
			
		||||
            image 'debian:stretch-slim' 
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    stages {
 | 
			
		||||
        stage('Requirements') { 
 | 
			
		||||
            steps {
 | 
			
		||||
                sh 'apt-get -y update && apt-get -y install python-pip cloc && pip install platformio' 
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        stage('Build') {
 | 
			
		||||
            steps {
 | 
			
		||||
                sh 'pio run'
 | 
			
		||||
            }
 | 
			
		||||
            post {
 | 
			
		||||
                always {
 | 
			
		||||
                    archiveArtifacts '.pioenvs/nodemcu/firmware.bin, .pioenvs/nodemcu/firmware.elf'
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        stage('Coverage') {
 | 
			
		||||
            steps {
 | 
			
		||||
                sh 'cloc --by-file --xml --out=.test/cloc.xml src include'
 | 
			
		||||
            }
 | 
			
		||||
            post {
 | 
			
		||||
                always {
 | 
			
		||||
                    recordIssues(tools: [taskScanner(ignoreCase: true, includePattern: 'src/*.*', normalTags: 'TODO')])
 | 
			
		||||
                    sloccountPublish encoding: '', pattern: '.test/cloc.xml'
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        stage('Upload') {
 | 
			
		||||
            steps {
 | 
			
		||||
                sh 'cd .piolibdeps\Homie\scripts\ota_updater'
 | 
			
		||||
                sh 'pip install -r requirements.txt'
 | 
			
		||||
                sh 'ota_updater.py -l mqtt.jcktrue.dk -i "..\..\..\.pioenvs\nodemcu\firmware.elf"
 | 
			
		||||
            }
 | 
			
		||||
        }		
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user