diff --git a/.gitignore b/.gitignore index 055a2d5..c290b8a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,17 @@ app/static/frequency/frequency.p app/static/wordfreqapp.db app/static/donate-the-author.jpg app/static/donate-the-author-hidden.jpg +.idea/.gitignore +.idea/EnglishPal.iml +.idea/inspectionProfiles/ +.idea/misc.xml +.idea/modules.xml +.idea/vcs.xml +app/.idea/.gitignore +app/.idea/app.iml +app/.idea/inspectionProfiles/ +app/.idea/misc.xml +app/.idea/modules.xml +app/.idea/vcs.xml +app/test/.cache/ + diff --git a/Dockerfile b/Dockerfile index fc16a1b..3de5ee8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,3 @@ -FROM tiangolo/uwsgi-nginx-flask:python3.6 +FROM tiangolo/uwsgi-nginx-flask:python3.8 + COPY ./app /app \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 434c00f..cabba9a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,33 +1,35 @@ pipeline { - agent any - - stages { + agent any + parameters { + gitParameter branchFilter: 'origin/(.*)', defaultValue: 'SPM-Spring2021-2597-蓝嘉婕201831990605', name: 'BRANCH', type: 'PT_BRANCH' + } + 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' + 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' + 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 'pytest -v -s --html=EnglishPalTestReport.html ./app/test' + sh 'sudo docker run -d -p 4444:4444 selenium/standalone-chrome' + sh 'pip3 install pytest -U -q' + sh 'pip3 install selenium -U -q' + sh 'pytest -v -s --html=EnglishPalTestReport.html ./app/test' } } stage('DeployIt') { steps { - echo 'Deploying (TBD)' + echo 'Under Construction....' } } } diff --git a/app/main.py b/app/main.py index 6d743bb..6a2757a 100644 --- a/app/main.py +++ b/app/main.py @@ -156,6 +156,7 @@ def get_answer_part(s):