Reputation: 1012
I've got a simple Flask blogging app (let's call it flask-app.git) that uses Frozen-Flask to generate a build folder inside my project.
The build folder is just statically compiled versions of all my html/css.
I'm trying to deploy these static files to my production site using Git. I used this tutorial, which involves creating a 'primary' and a bare repository in production. The bare repo, called 'hub', is a remote for the primary repo, which is the site's public root folder. The last step in the tutorial involves cloning the remote hub repo onto your development machine. The idea is that this clone becomes your local working development copy. Any time you push to remote from the clone, the 'primary' repo pulls from the hub repo and updates the site.
My problem is that Frozen-Flask generates the build/ folder INSIDE my flask-app.git repo, which contains my Flask application code and inherits the flask-app.git metadata. The aforementioned clone of my remote 'hub' repository conflicts with this metadata. I can't use flask-app.git as the remote primary repo either, because the build/ sub-files and folders need to be in the site root. Essentially, I want two repositories for the project: one for the application (python) source files, and another for deploying the generated html/css.
Ideally, I would like Frozen-Flask to compile the build files directly into the 'hub' clone on my development machine. I'm not sure how to do this.
I've tried creating a symbolic link from the flask-app.git/build folder to another directory outside the project, but it inherits the git metadata from flask-app.git. So, I can either symbolic link flask-app.git/build OR clone my remote 'hub' repo, but not both in one directory. I also tried creating a separate sub-repository inside flask-app.git, using this tutorial, with no success. Is this the right approach?
At this point I'm thinking the best solution would be to write a python script to copy the generated build/ files into another folder outside the project. The Frozen-Flask API doesn't seem to support changing the target build path. I'm hoping there is an easier solution.
Upvotes: 1
Views: 535
Reputation: 76802
There is a configuration value, FREEZER_DESTINATION
, that lets you set the output directory.
FREEZER_DESTINATION Path to the directory where to put the generated static site. If relative, interpreted as relative to the application root, next to the static and templates directories. Defaults to build.
Upvotes: 3