Jenkins CI #2
30
Jenkinsfile
vendored
Normal file
30
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'rust:1.48'
|
||||||
|
args '-v "$PWD":/usr/src/image-api'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('build') {
|
||||||
|
steps {
|
||||||
|
sh 'cargo build --release'
|
||||||
|
archiveArtifacts artifacts: '**/target/release/image-api', fingerprint: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('test') {
|
||||||
|
steps {
|
||||||
|
sh 'echo "BASE_PATH=$PWD" > .env'
|
||||||
|
sh 'cargo test'
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
sh 'rm -f .env'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user