Reputation: 882
I'm using cyclone to develop an application on OpenShift.
That application uses sqlite3 to connect to .db file and changes it.
script_dir = os.path.dirname(__file__)
rel_path = "database/main.db"
database = sqlite3.connect(os.path.join(script_dir, rel_path), timeout=1)
database.row_factory = sqlite3.Row
db = database.cursor()
def closegame(id):
db.execute("UPDATE games SET Running = 'No' WHERE ID = ?", (id,))
database.commit()
When I download the file with
rhc scp appname download mylocation remotelocation
there's no change.
When I try to git fetch/merge/pull, it's already up to date.
When I restart the application, result is the same and the application is still using the updated version of .db
When I git push, the file is overwriten by my local file
Adding path/database/main.db to .gitignore still overwrites the file
git rm --cached deletes the file completely from remote, so application won't even launch
git update-index --assume-changed has no effect
Ideally I'd love for the file to never be overwriten by push, but to be able to download it by pull. If that's not possible, just being able to pull it would be nice.
Upvotes: 0
Views: 40
Reputation: 882
The problem was my lack of understanding git. Git is supposed to be used for source files, not for actual data. Therefore we should be downloading the database when we need it through scp
In Openshift, the working .db file can be found in app-root/repo/
Therefore the final command in console is
rhc scp appname download localpath app-root/repo/path/to/file
Upvotes: 1