Skip to content

piersstorey/hello-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hello-flask

Sample app to test out Jenkins

Simple CLI stuff

  • pep8 app.py : run pep8 against .py
  • pep8 app.py > pep8_report.txt: run pep8 with output to text file
  • py.test --cov : run pytest including coverage
  • py.test --junitxml=output.xml : run pytest with XML output
  • pylint app.py : run pylint against .py
  • ssh-copy-id user@123.45.56.78 : Copy public ssh key to allowed_host in target deployment web server

Ubuntu 14:04 venv install

To use python3 virtualenvironment

sudo apt-get install python3.4-venv
python3 -m venv myvenv

Deployment

  • sudo apt-get install git
  • sudo apt-get install python3
  • sudo apt-get install python3.4-venv
  • sudo apt-get install supervisor
  • mkdir /var/www
  • sudo chown -R www-data:www-data /var/www
  • sudo chmod 775 /var/www
  • cd /var/www
  • git clone git@github.com:piersstorey/hello-flask.git
  • cd hello-flask
  • python3 -m venv myvenv
  • pip install -r requirements.txt
  • cp /var/www/hello-flask/scripts/hello-flask-gunicorn /bin/
  • sudo chmod u+x /bin/hello-flask-gunicorn
  • cp /var/www/hello-flask/scripts/hello-flask-gunicorn.conf /etc/supervisor/conf.d/
  • supervisorctl reread
  • supervisorctl update
  • supervisorctl start hello-flask-gunicorn
  • cp /var/www/hello-flask/scripts/hello-flask-nginx.conf /etc/nginx/conf.d/
  • /etc/init.d/nginx reload

About

Sample app to test out Jenkins

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published