playground/vagrant/Jenkinsfile
2021-08-29 08:11:32 +00:00

55 lines
1.0 KiB
Groovy

pipeline {
//agent none
//agent any
agent { label 'vagrant' }
//environment {
// CC = 'gcc'
// BUILD_TYPE = 'xxxx'
//}
stages {
stage('Build') {
steps {
echo "Building a virtual machine - ${env.BUILD_ID} on ${env.JENKINS_URL}"
sh "make up"
}
}
stage('Test') {
steps {
echo "Testing the virtual machine built"
// TODO run the internal test script to check the internal aspect of the machine
// TODO run the external test scripts to test the machine over the network
}
}
stage('Deploy') {
when {
expression {
currentBuild.result == null || currentBuild.result == 'SUCCESS'
}
}
steps {
echo "Publishing the virtual machine built"
// TODO clean up before packaging
// remove stale log files, temporary files
// remove unneeded packages
// remove the default vagrant user and sshkey?
sh "make package"
// TODO copy the final artifacts to an artifact repository
// sh "make clean"
}
}
}
post {
success {
echo "SUCCESS!!!"
}
}
}