Spoof out second version

This commit is contained in:
Luke Murphy 2020-07-01 20:02:19 +02:00
parent cae337094f
commit 79272b55bb
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 47 additions and 8 deletions

View File

@ -2,15 +2,26 @@
A swarm of dreams. A swarm of dreams.
## Proof Of Concept ## first.py
- [x] List apps from an `app.json` (points to https://git.autonomic.zone/compose-stacks) Ideas contained within...
- [x] Clone selected app template and parse configuration for inputs (env vars and secrets)
- [ ] Generate a form so those values can be filled out and allow it to be saved - List apps from an `app.json` (points to https://git.autonomic.zone/compose-stacks)
- [ ] Save the form inputs to a `db.json` - Clone selected app template and parse configuration for inputs (env vars and secrets)
- [ ] Deploy an applicaiton to a local swarm (assumes access to local docker socket) - Generate a form so those values can be filled out and allow it to be saved
- [ ] Create an "edit app" page where the `db.json` is re-called and can be updated - Save the form inputs to a `db.json` (as a start)
- [ ] Make sure re-deploy works (taking care of updating secret and app versions) - Deploy an applicaiton to a local swarm (assumes access to local docker socket)
- Create an "edit app" page where the `db.json` is re-called and can be updated
- Make sure re-deploy works (taking care of updating secret and app versions)
## second.py
More ideas...
- Don't try to be smart with the auto-generation, hard-code everything. We
maintain the app template (`compose.yml`) and this code anyway, so we just
need to be aware of each other and keep in sync. This would optimise for
trust and collaboration and not "smart" code.
### Development ### Development

28
second.py Normal file
View File

@ -0,0 +1,28 @@
"""Less flashy version. Mord hard-coding."""
from pathlib import Path
from flask import Flask, render_template
from ruamel.yaml import YAML
app = Flask(__name__)
# Note(decentral1se): load from env vars at some point
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
yaml = YAML()
# Note(decentral1se): paths needs to change dependening
# on deployment mode ./data in dev, /data in production
DATA_DIR = Path("./data")
STATIC_DIR = Path(app.root_path).absolute() / "static"
@app.route("/")
def home():
pass
if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0")