Skip to content

Instantly share code, notes, and snippets.

@recall704
Created July 3, 2016 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save recall704/23fb07b0271376e10f079125a82bbd75 to your computer and use it in GitHub Desktop.
Save recall704/23fb07b0271376e10f079125a82bbd75 to your computer and use it in GitHub Desktop.
#!/bin/bash
docs_dir=/home/recall/docker_data/nginx/scrapy-docs-cn
git=/usr/bin/git
branch=master
cd $docs_dir
$git reset --hard origin/$branch
$git clean -f
$git pull
echo 'ok'
@recall704
Copy link
Author

#coding: utf-8

import os
from flask import Flask
app = Flask(__name__)

@app.route("/", methods=['GET', 'POST'])
def hello():
    os.system('/path/to/deploy.sh')
    return "OK"

if __name__ == "__main__":
    app.run(host="0.0.0.0",port="8081")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment