chore(CI): run build procedure for PR.
This commit is contained in:
parent
97309599f1
commit
da8337a4e9
@ -8,6 +8,9 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- (cd web && npm install && npm run build)
|
- (cd web && npm install && npm run build)
|
||||||
- (cd templates/ && ./translate.py)
|
- (cd templates/ && ./translate.py)
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
- name: deploy-testing
|
- name: deploy-testing
|
||||||
image: debian
|
image: debian
|
||||||
@ -94,10 +97,10 @@ steps:
|
|||||||
- (cd lang/ && ./sync_translation.py --client $TRADUORA_R_CLIENT --secret $TRADUORA_R_SECRET --fetch)
|
- (cd lang/ && ./sync_translation.py --client $TRADUORA_R_CLIENT --secret $TRADUORA_R_SECRET --fetch)
|
||||||
- git add lang/* && git status
|
- git add lang/* && git status
|
||||||
- git config --global user.email "github@azlux.fr" && git config --global user.name "azlux"
|
- git config --global user.email "github@azlux.fr" && git config --global user.name "azlux"
|
||||||
- git commit -a -m 'Bot: update strings'
|
- "git commit -a -m 'Bot: update strings'"
|
||||||
- git remote set-url origin https://azlux:$GITHUB_API@github.com/azlux/botamusique/
|
- git remote set-url origin https://azlux:$GITHUB_API@github.com/azlux/botamusique/
|
||||||
- git push --set-upstream origin new-translations && git push
|
- git push --set-upstream origin new-translations && git push
|
||||||
- GITHUB_USER="azlux" GITHUB_TOKEN="$GITHUB_API" hub pull-request -m "Bot: TRADUORA Update"
|
- "GITHUB_USER=\"azlux\" GITHUB_TOKEN=\"$GITHUB_API\" hub pull-request -m \"Bot: TRADUORA Update\""
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- cron
|
- cron
|
||||||
|
@ -10,7 +10,7 @@ lang_dict = {}
|
|||||||
|
|
||||||
|
|
||||||
def load_lang(lang):
|
def load_lang(lang):
|
||||||
with open(f"../lang/{lang}.json", "r") as f:
|
with open("../lang/" + lang + ".json", "r") as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
|
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ if __name__ == "__main__":
|
|||||||
if match is None:
|
if match is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
print(f"Populating {html_file} with translations...")
|
print("Populating " + html_file + " with translations...")
|
||||||
basename = match[1]
|
basename = match[1]
|
||||||
with open(html_file, "r") as f:
|
with open(html_file, "r") as f:
|
||||||
html = f.read()
|
html = f.read()
|
||||||
@ -50,9 +50,9 @@ if __name__ == "__main__":
|
|||||||
template = jinja2.Template(html)
|
template = jinja2.Template(html)
|
||||||
|
|
||||||
for lang in lang_list:
|
for lang in lang_list:
|
||||||
print(f" - Populating {lang}...")
|
print(" - Populating " + lang + "...")
|
||||||
lang_dict = load_lang(lang)
|
lang_dict = load_lang(lang)
|
||||||
|
|
||||||
with open(f"{basename}.{lang}.html", "w") as f:
|
with open(basename + "." + lang + ".html", "w") as f:
|
||||||
f.write(template.render(tr=tr))
|
f.write(template.render(tr=tr))
|
||||||
print("Done.")
|
print("Done.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user