1
0
Fork 0
EnglishPal/Jenkinsfile

42 lines
1.1 KiB
Plaintext
Raw Normal View History

2021-06-08 20:44:58 +08:00
pipeline {
agent any
triggers {
pollSCM('') // Enabling being build on Push
}
2021-06-08 20:44:58 +08:00
stages {
stage('MakeDatabasefile') {
steps {
2024-07-04 10:06:44 +08:00
sh 'touch ./app/wordfreqapp.db && rm -f ./app/wordfreqapp.db'
sh 'cat ./app/static/wordfreqapp.sql | sqlite3 ./app/wordfreqapp.db'
2021-06-08 20:44:58 +08:00
}
}
stage('BuildIt') {
steps {
echo 'Building..'
2021-07-13 12:24:29 +08:00
sh 'sudo docker kill $(sudo docker ps -q)'
2021-06-08 20:44:58 +08:00
sh 'sudo docker build -t englishpal .'
sh 'sudo docker run -d -p 91:80 -v /var/lib/jenkins/workspace/EnglishPal_Pipeline_master/app/static/frequency:/app/static/frequency -t englishpal'
}
}
stage('TestIt') {
steps {
echo 'Testing..'
sh 'sudo docker run -d -p 4444:4444 selenium/standalone-firefox'
2021-06-08 20:44:58 +08:00
sh 'pip3 install pytest -U -q'
sh 'pip3 install pytest-html -U -q'
2021-06-08 20:44:58 +08:00
sh 'pip3 install selenium -U -q'
sh 'pytest -v -s --html=EnglishPalTestReport.html ./app/test'
2021-06-08 20:44:58 +08:00
}
}
stage('DeployIt') {
steps {
echo 'Deploying (TBD)'
2021-06-08 20:44:58 +08:00
}
}
}
}