...
 
Commits (1)
data/
logs/
site/
__pycache__/
......@@ -20,8 +20,8 @@ import jinja2
import sbodash
page_datetime = datetime.datetime.now(datetime.timezone.utc)
index_path = sbodash.sitedir+"/index.html"
page_datetime = datetime.datetime.fromtimestamp(sbodash.updated,datetime.timezone.utc)
page_path = os.path.join(sbodash.sitedir,"index.html")
#-----------------------------------------------------------------------
......@@ -29,20 +29,19 @@ jenv = jinja2.Environment(loader=jinja2.FileSystemLoader(sbodash.templatesdir),a
mytemplate = jenv.get_template(os.path.basename(__file__).replace("render_","",1)+'.jinja2')
try:
os.makedirs(os.path.dirname(index_path))
os.makedirs(os.path.dirname(page_path))
except FileExistsError:
pass
with open(index_path,"w",encoding="utf-8") as index_file:
with open(page_path,"w",encoding="utf-8") as page_file:
print(
mytemplate.render(
siteurl=sbodash.siteurl,
page_title="SBo Dashboard",
page_datetime=page_datetime.strftime("%Y-%m-%d %T %Z"),
),
file=index_file
file=page_file
)
#-----------------------------------------------------------------------
# Finished!
......@@ -11,3 +11,5 @@ set -eu
rsync -a --delete "$DASHDIR"/support/ "$SITEDIR"/support/
exit 0
#-----------------------------------------------------------------------
......@@ -8,6 +8,7 @@
set -eu
export UPDATED=${UPDATED:-$(date "+%s")}
export PYTHONDONTWRITEBYTECODE="kthxbye"
CONFIG=${CONFIG:-$(pwd)/sbo-dashboard.conf}
......@@ -15,8 +16,9 @@ CONFIG=${CONFIG:-$(pwd)/sbo-dashboard.conf}
mkdir -p "$DATADIR" "$SBDIR" "$LOGSDIR" "$SITEDIR"
LOGFILE="$LOGSDIR"/runall_$(date "+%F").log
LOGFILE="$LOGSDIR"/runall_$(date -d "@${UPDATED}" "+%F").log
echo "$(date "+%F %T") $(basename "$0") started timestamp=${UPDATED}" >>"$LOGFILE"
for run in \
update_slackbuilds \
update_maintainers \
......@@ -39,5 +41,8 @@ for run in \
echo "$(date "+%F %T") ${run} skipped" >>"$LOGFILE"
fi
done
echo "$(date "+%F %T") $(basename "$0") finished" >>"$LOGFILE"
exit 0
#-----------------------------------------------------------------------
......@@ -22,3 +22,8 @@ export SITEDIR="$DASHDIR"/site
# The rendered site is served at this URL
export SITEURL="http://localhost/sbo-dash"
# Statistics retention period (days)
export KEEPSTATS="7"
#-----------------------------------------------------------------------
......@@ -53,7 +53,7 @@
<div id="sb{{ mdeets['mnum'] }}" class="modal">
<div>
<a href="#close" title="Close" class="closebutton">&otimes;</a>
<p>{{ mname }}</p>
<h3>{{ mname }}</h3>
<p class="t">{{ mdeets["slackbuilds"]|sort|join("<br>") }}</p>
</div>
</div>
......
......@@ -8,6 +8,9 @@
# Usage: update_slackbuilds
# Environment variables:
# SBDIR -- path to SBo git repo -- if unset, just bomb out
#
# Note: execution order is significant -- this must be run before other
# updates that depend on it (i.e., most of them)
#-----------------------------------------------------------------------
set -eu
......@@ -24,3 +27,5 @@ else
fi
exit 0
#-----------------------------------------------------------------------