Giter Club home page Giter Club logo

deploywatcher's Introduction

Deploy Watcher

Flask RESTful API that can be integrated into your deployment pipeline to track deployment times.

Installation

Local

To run locally on your computer, ensure the following requirements are installed:

  1. Python version 3.6+
  2. Packages listed in requirements_local.txt with the command pip install -r requirements_local.txt
  3. Git (to clone the repository). Alternatively, download the .zip from the repository and extract it.

Execute the following steps:

Windows cmd / Powershell:

git clone https://github.com/akelopes/deployWatcher.git
cd deployWatcher
flask run

Linux shell:

git clone https://github.com/akelopes/deployWatcher.git
cd deployWatcher
flask run

Docker

Dev

For deployment in development mode:

  1. Ensure Python 3.6+, Docker, and Git are installed.
  2. Run:
git clone https://github.com/akelopes/deployWatcher.git
cd deployWatcher
docker build . -t deploywatcher
docker run -d -p 5000:5000 deploywatcher

Prod

A demo environment for production with the app, http host (nginx + uwsgi), and MySQL database via Docker.

Prerequisites:

  1. Docker (Linux host preferred)
  2. Docker-compose or Docker-Stack
  3. Git (or download the .zip from the repository).

Run:

git clone https://github.com/akelopes/deployWatcher.git
cd deployWatcher/prod_simulation
docker-compose build
docker-compose up

Usage

To verify successful execution, open https://127.0.0.1:5000/transitions. You should see "API: OK".

Transitions Resource

  • GET:

    • /transitions: Returns a message {"API": "OK"}.
    • /transitions/<id>: Retrieves details of a specific transition by its ID. If it doesn't exist, you'll get a 404 Not Found status with {"message": "Transition not found"}.
  • POST (/transitions): Inserts a new deployment status into the database and returns the ID of the record. Accepts a JSON body with:

    • component: String (Max 140 characters)
    • version: String (e.g., "1.0")
    • author: String
    • status: String
    • sent_timestamp: Optional. Format: "yyyy-mm-dd hh:mm:ss.fff". Defaults to the current time if omitted.

Use curl for an example POST request:

curl --header "Content-Type: application/json" \
     --request POST \
     --data '{"component": "testApp", "version": "1.0", "author": "akelopes", "status": "started", "sent_timestamp": "2020-01-01 10:10:50.555"}' \
     http://127.0.0.1:5000/transitions

Errors, such as "Invalid date format" or "Component too big", return with appropriate messages.

Considerations

  • The system is designed to be agnostic to cloud providers and databases.
  • Adherence to the RESTful standard.
  • Input handling is performed by the original system for flexible data translation.
  • Local and Dev environments are for development, not persistent data.

deploywatcher's People

Contributors

akelopes 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.