From ad1d46cc2c46a4bbdba0d66e8c8bd0e620be01af Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Tue, 30 Jun 2020 20:35:01 +0200 Subject: [PATCH] Add /apps setup and spec out more targets --- Makefile | 11 +++++++---- README.md | 6 +++--- magic_app/app.py | 7 ++++++- magic_app/static/apps.json | 3 +++ 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 magic_app/static/apps.json diff --git a/Makefile b/Makefile index 7ad377b..17e159a 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ -build: +python-run: + @python magic_app/app.py + +docker-build: @docker build -t autonomic/magicapp . -run: +docker-run: @docker run --rm -p 5000:5000 autonomic/magicapp -publish: +docker-publish: @docker push autonomic/magicapp:v0.1.0 -.PHONY: build run +.PHONY: python-run docker-build docker-run docker-publish diff --git a/README.md b/README.md index 16de6e4..1a87114 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ A swarm of dreams. ```bash $ python3 -m venv .venv && source .venv/bin/activate $ pip install -r requirements.txt -$ python run.py +$ make python-run ``` ## Go Go Go Yes Docker ```bash -$ make build -$ make run +$ make docker-build +$ make docker-run ``` diff --git a/magic_app/app.py b/magic_app/app.py index c0712e9..0fe5add 100644 --- a/magic_app/app.py +++ b/magic_app/app.py @@ -1,6 +1,6 @@ """The Magic App.""" -from flask import Flask, render_template +from flask import Flask, render_template, send_from_directory app = Flask(__name__) @@ -10,5 +10,10 @@ def home(): return render_template("index.html") +@app.route("/apps") +def apps(): + return send_from_directory("static", "apps.json") + + if __name__ == "__main__": app.run(host="0.0.0.0") diff --git a/magic_app/static/apps.json b/magic_app/static/apps.json new file mode 100644 index 0000000..8d48edc --- /dev/null +++ b/magic_app/static/apps.json @@ -0,0 +1,3 @@ +{ + "gitea": "https://git.autonomic.zone/compose-stacks/gitea" +}