Delt06 / devops

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DevOps Labs

IMPORTANT NOTE: future lab development is going to happen at the new repo. This repo has issues with GitHub Actions (can be viewed at Actions history)

Test

Table of Contents

  1. Python App
    1. Getting started
    2. Usage example
  2. Docker
    1. Building an image
    2. Launching the prebuilt image
  3. Unit Tests
  4. Acknowledgements

Python App

A Flask app displaying current time in Moscow.

Getting started

To get a local copy up and running follow these simple steps.

Prerequisites

  • python3

Installation

  • Clone the repo
git clone https://github.com/Delt06/devops
  • Go to the app_python directory
cd ./devops/app_python
  • Install pip requirements
pip install -r /path/to/requirements.txt

Usage example

  • Launch the app
flask run
  • Open the app by the suggested link

Docker

A docker image for the Python App.

Building an image

cd ./devops/app_python
  • Launch the build
docker build -t deltation/devops-app-python .

Launching the prebuilt image

docker run -p 5000:5000 deltation/devops-app-python

Unit Tests

The project contains a test suite for the Python App. The suite relies on the unittest module.

To run tests locally, executes the following command from the app_python folder:

python test.py

Github Actions

The project contains a Test workflow, which is trigger on every push and pull request. The tests are run inside a Docker container. The status of tests is reflected by the badge at the top of this README file.

Acknowledgements

About


Languages

Language:Python 79.3%Language:Dockerfile 20.7%