Last active
February 8, 2020 07:42
-
-
Save SteffenL/c4eafacd313a4325f45216425ac0672d to your computer and use it in GitHub Desktop.
Update AppVeyor Server appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, codecs, json | |
appsettings_path = "/etc/opt/appveyor/server/appsettings.json" | |
with codecs.open(appsettings_path, mode="rb", encoding="utf8") as f: | |
appsettings = json.JSONDecoder().decode(f.read()) | |
# SQLite, SQL Server, PostgreSQL | |
db_provider = os.getenv("APPVEYOR_DATABASE_PROVIDER") | |
appsettings["AppVeyor"]["Database"]["Provider"] = db_provider | |
appsettings["AppVeyor"]["Database"][db_provider + "ConnectionString"] = os.getenv("APPVEYOR_DATABASE_CONNECTION_STRING") | |
appsettings["AppVeyor"]["Security"]["MasterKey"] = os.getenv("APPVEYOR_MASTER_KEY") | |
appsettings["AppVeyor"]["Security"]["MasterKeySalt"] = os.getenv("APPVEYOR_MASTER_KEY_SALT") | |
with codecs.open(appsettings_path, mode="wb", encoding="utf8") as f: | |
f.write(json.JSONEncoder().encode(appsettings)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment