Sample app to test out Jenkins
pep8 app.py
: run pep8 against .pypep8 app.py > pep8_report.txt
: run pep8 with output to text filepy.test --cov
: run pytest including coveragepy.test --junitxml=output.xml
: run pytest with XML outputpylint app.py
: run pylint against .pyssh-copy-id user@123.45.56.78
: Copy public ssh key to allowed_host in target deployment web server
To use python3 virtualenvironment
sudo apt-get install python3.4-venv
python3 -m venv myvenv
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