deployment
Inex Code 2022-04-28 13:54:48 +03:00
parent 280b468025
commit 4b7469355d
2 changed files with 5 additions and 3 deletions

6
app.py
View File

@ -25,9 +25,10 @@ class Channel(Resource):
args = parser.parse_args()
channel = args['channel']
# Save the new channel to file
with open("channel_url.txt", "w") as f:
with open("/var/channel_url.txt", "w") as f:
f.write(channel)
# Update the current channel
global current_channel
current_channel = channel
return jsonify({"message": "Channel updated"})
@ -36,9 +37,10 @@ class GetNewChannel(Resource):
r = requests.get("https://nixos.org/channels/nixos-21.11")
channel = r.url
# Save the new channel to file
with open("channel_url.txt", "w") as f:
with open("/var/channel_url.txt", "w") as f:
f.write(channel)
# Update the current channel
global current_channel
current_channel = channel
return jsonify({"message": "Channel updated", "channel": channel})

View File

@ -1 +1 @@
https://nixos.org/channels/nixos-21.05
https://nixos.org/channels/nixos-21.11