Giter Site home page Giter Site logo

vieux448 / flask-deploy-script Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tash-had/flask-deploy-script

0.0 0.0 0.0 57 KB

A script to quickly deploy a Flask REST API to any Ubuntu VM

Home Page: https://medium.com/@tashadsaqif/deploying-a-flask-rest-api-to-azure-9c129b2bafee

Shell 100.00%

flask-deploy-script's Introduction

flask-deploy-script

This script will pull your server code from a GitHub repo and deploy it on any Ubuntu VM.

Usage

usage: deploy [-b branch] [-c access_token] [-t test_folder] [-m module_name] [-v variable_name] [-s subdirectory] [-e deploy_env] [-p deploy_port] [-k kill_port|all] owner repo_name

Selected Examples:

  • sudo bash deploy.sh tash-had my-app
  • sudo bash deploy.sh -s server tash-had my-app (deploy the code in the subdirectory "server" within the repo)
  • sudo bash deploy.sh -p 8000 tash-had my-app (deploy to port 8000)
  • sudo bash deploy.sh -b prod tash-had my-app (deploy branch "prod")
  • sudo bash deploy.sh -k 3000 tash-had my-app (kill deployed instance on port 3000)
  • sudo bash deploy.sh -c GITHUB_ACCESS_TOKEN tash-had my-app (deploy code from private repo "my-app")

Required Arguments

owner a GitHub username or organization name.

repo_name the repo to deploy. should be owned by owner. If the repo is private, the -c argument must be provided.

Optional Arguments

-b branch: the branch you wish to deploy. Defaults to master.

-c credential: an access token with Read access to repo_name. This is only required if your repo is private.

-t test folder: the name of the test folder. Defaults to "tests".

-m module name: the name of the root Flask module file. Defaults to "app.py".

-v variable name: the WSGI callable variable that should be in your root flask module (see -m). For example, if in your root file (app.py), if you have a = Flask(__name__), then your variable name is a. Defaults to app.

-s subdirectory: the folder in your repo that has the server code.

-e environment: the deployment environment (ie. 'development'). This value is used to set the APP_CONFIG environment variable. Defaults to "development".

-p port: the port to deploy on. Defaults to "5000".

-k kill: kills the deployment running on the given port and removes associated project files. If you pass "all" as the argument to this flag, it will kill all deployed instances on the server.

flask-deploy-script's People

Contributors

tash-had 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.