From 6929d5fd0df9f5d138a6975d817ed2a53e66b3cc Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 19 Aug 2020 00:12:20 +0100 Subject: [PATCH] Build lua_api.html in CI pipeline --- .gitlab-ci.yml | 5 +++-- utils/update_lua_api.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be6ed38..244212a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,12 +5,14 @@ variables: LC_ALL: C.UTF-8 before_script: + - apk add python3 py3-markdown - rm Gemfile.lock test: stage: test interruptible: true script: + - python3 utils/update_lua_api.py - bundle exec jekyll build -d test artifacts: paths: @@ -21,9 +23,8 @@ test: pages: stage: deploy interruptible: true - before_script: - - rm Gemfile.lock script: + - python3 utils/update_lua_api.py - bundle exec jekyll build -d public artifacts: paths: diff --git a/utils/update_lua_api.py b/utils/update_lua_api.py index 7144f69..bca2103 100644 --- a/utils/update_lua_api.py +++ b/utils/update_lua_api.py @@ -1,5 +1,6 @@ -import markdown, urllib2, datetime, re, string +import markdown, datetime, re, string from bs4 import BeautifulSoup +from urllib.request import urlopen def get_key(index, li, title): title = title.replace(" ", "-") @@ -28,8 +29,7 @@ def get_key(index, li, title): print("Downloading lua_api.txt...") url = "https://raw.githubusercontent.com/minetest/minetest/master/doc/lua_api.txt" -text = urllib2.urlopen(url).read() -text = unicode(text, "utf-8") +text = urlopen(url).read().decode("utf-8") print("Pre-generation replacements...")