Beispiel #1
0
def deploy_prod_app():
    if not is_staff("cs61a"):
        return login()
    email = get_user()["email"]
    if not is_admin(course="cs61a", email=email):
        abort(401)
    app = request.args["app"]
    deploy_prod_app_sync(target_app=app, noreply=True)
    return html(f"Deploying <code>{app}</code> from master!")
Beispiel #2
0
 def rebuilder():
     now = int(time())
     for app, interval in AUTO_REBUILDS.items():
         with connect_db() as db:
             last_rebuild = db(
                 "SELECT MAX(unix) FROM auto_rebuilds WHERE app=(%s)",
                 [app]).fetchone()
             if (not last_rebuild or not last_rebuild[0]
                     or now - last_rebuild[0] > interval.total_seconds()):
                 db(
                     "INSERT INTO auto_rebuilds (app, unix) VALUES (%s, %s)",
                     [app, now],
                 )
                 deploy_prod_app_sync(target_app=app, noreply=True)