From 1ba4dcd45e69b8d6734317b265945ec93651987d Mon Sep 17 00:00:00 2001 From: ArrayYang <64732862+ArrayYang@users.noreply.github.com> Date: Wed, 16 Jun 2021 16:30:04 +0800 Subject: [PATCH] Create Jenkinsfile Create Jenkinsfile --- Jenkinsfile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..b8c7073 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,34 @@ +pipeline { + agent any + + stages { + stage('MakeDatabasefile') { + steps { + sh 'touch ./app/static/wordfreqapp.db && rm -f ./app/static/wordfreqapp.db' + sh 'cat ./app/static/wordfreqapp.sql | sqlite3 ./app/static/wordfreqapp.db' + } + } + stage('BuildIt') { + steps { + echo 'Building..' + sh 'sudo docker build -t englishpal .' + sh 'sudo docker stop $(docker ps -aq)' + 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-chrome' + sh 'pip3 install pytest -U -q' + sh 'pip3 install selenium -U -q' + sh 'python3 -m pytest -v -s --html=EnglishPalTestReport.html ./app/test' + } + } + stage('DeployIt') { + steps { + echo 'Deploying (TBD)' + } + } + } +}