Skip to content

Commit fffa363

Browse files
committed
Finalize cache update
1 parent 83f60e4 commit fffa363

File tree

6 files changed

+38
-12
lines changed

6 files changed

+38
-12
lines changed

.github/workflows/publish.yml

+8
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,13 @@ jobs:
3434
pip install -r requirements.txt
3535
deactivate
3636
37+
# Update image cache instruction
38+
rm -rf .cron
39+
python3 -m venv .cron
40+
source .cron/bin/activate
41+
pip install --force-reinstall -r scripts/requirements.txt
42+
sh scripts/schedule_cache.sh
43+
deactivate
44+
3745
# Reload supervisor
3846
supervisorctl restart flask_app

.github/workflows/test_publish.yml

+8
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,13 @@ jobs:
3737
pip install -r requirements.txt
3838
deactivate
3939
40+
# Update image cache instruction
41+
rm -rf .cron
42+
python3 -m venv .cron
43+
source .cron/bin/activate
44+
pip install --force-reinstall -r scripts/requirements.txt
45+
sh scripts/schedule_cache.sh
46+
deactivate
47+
4048
# Reload supervisor
4149
supervisorctl start test_flask_app

.github/workflows/test_unpublish.yml

+8
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,13 @@ jobs:
3636
pip install -r requirements.txt
3737
deactivate
3838
39+
# Update image cache instruction
40+
rm -rf .cron
41+
python3 -m venv .cron
42+
source .cron/bin/activate
43+
pip install --force-reinstall -r scripts/requirements.txt
44+
sh scripts/schedule_cache.sh
45+
deactivate
46+
3947
# Stop supervisor
4048
supervisorctl stop test_flask_app

scripts/graphql.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import json
77
import pathlib
8+
import sys
89

910
import requests
1011

@@ -26,8 +27,9 @@
2627
)
2728

2829
json_resp = json.loads(resp.content)["data"]["user"]
29-
resp_dir = pathlib.Path("assets/contrib/")
30-
card_dir = pathlib.Path("flask_app/static/img/gh_cards/")
30+
base_dir = pathlib.Path(sys.argv[1])
31+
resp_dir = base_dir / "assets/contrib/"
32+
card_dir = base_dir / "flask_app/static/img/gh_cards/"
3133
resp_dir.mkdir(exist_ok=True)
3234
card_dir.mkdir(exist_ok=True)
3335

scripts/render_table.sh

-10
This file was deleted.

scripts/schedule_cache.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
# SPDX-FileCopyrightText: 2023 Alec Delaney
3+
# SPDX-License-Identifier: MIT
4+
5+
REPOPATH=$(realpath .)
6+
JOBNAME=$(echo "$REPOPATH" | xargs basename)
7+
STATICPATH="$REPOPATH/flash_app/static"
8+
COMMAND="50 23 * * * python $SCRIPTPATH $REPOPATH"
9+
10+
cronberry enter "Cache cards for $JOBNAME" "$COMMAND" --overwrite

0 commit comments

Comments
 (0)