Giter Site home page Giter Site logo

exjobb's Introduction

CircleCI

Microblog

Join the chat at https://gitter.im/dbwebb-se/devops

Course material for a devops course, aimed at a Swedish course in computer science on University level new to devops. The students are to further develop this application and integreate it with new tools.

Released as part of a University course: https://dbwebb.se/kurser/devops

The application used in this course is based on The flask mega tutorial.

Dev environment

Here is how you setup the development environment and start the application.

Packages

Create a virtual environment and install packages:

python3 -m venv venv
source venv/bin/activate
make install-dev

If you are on Windows and Cygwin you will probably have troubles installing the pip package cryptography. Common errors are missing python.h, gcc, cffi and openssl.

Database

Setup SQLite database if migrations folder already exist:

flask db upgrade

If you have upgraded the code for any SQLAlchemy models:

flask db migrate -m '<message>'
flask db upgrade

You probably won't need to do this. But if you need to recreate app.db and migrations folder:

flask db init
flask db migrate -m '<message>'
flask db upgrade

If you have the wrong migrations version in the database when you want to upgrade it you can change it with:

flask db stamp head
flask db upgrade

Test application

There are several make commands for testing the application. Use make help to see which. To run all tests and validation use:

make test

FORCE

Run application

Start byt setting the FLASK_APP and FLASK_ENV env vars:

export FLASK_APP=microblog.py
export FLASK_ENV=development

Change to use the DevConfig in microblog.py, uncomment # from app.config import DevConfig and # app = create_app(DevConfig) (comment app = create_app()).

Start the app with the following command and go to localhost:5000 in your browser.

flask run

Production environment

Follow the scripts in scripts/ or Driftsätta en flask app.

License

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

Acknowledgement

This is a co-effort of several people using freely available documentation and tools from the open source community.

For contributors, see commit history and issues.

Feel free to help building up the repository with more content suited for training and education.

exjobb's People

Contributors

andreasarne avatar martinledel avatar mabn17 avatar pereriksson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.