mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
deploy: convert .gitlab-ci.yml generation to dict + yaml.dump()
This commit is contained in:
parent
f24613b701
commit
cdce0958f8
1 changed files with 16 additions and 10 deletions
|
@ -25,6 +25,7 @@ import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import urllib
|
import urllib
|
||||||
|
import yaml
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
import logging
|
import logging
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -445,16 +446,21 @@ def update_servergitmirrors(servergitmirrors, repo_section):
|
||||||
continue
|
continue
|
||||||
if remote.name == 'gitlab':
|
if remote.name == 'gitlab':
|
||||||
logging.debug('Writing .gitlab-ci.yml to deploy to GitLab Pages')
|
logging.debug('Writing .gitlab-ci.yml to deploy to GitLab Pages')
|
||||||
with open(os.path.join(git_mirror_path, ".gitlab-ci.yml"), "wt") as out_file:
|
with open(os.path.join(git_mirror_path, ".gitlab-ci.yml"), "wt") as fp:
|
||||||
out_file.write("""pages:
|
yaml.dump(
|
||||||
script:
|
{
|
||||||
- mkdir .public
|
'pages': {
|
||||||
- cp -r * .public/
|
'script': [
|
||||||
- mv .public public
|
'mkdir .public',
|
||||||
artifacts:
|
'cp -r * .public/',
|
||||||
paths:
|
'mv .public public',
|
||||||
- public
|
],
|
||||||
""")
|
'artifacts': {'paths': ['public']},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fp,
|
||||||
|
default_flow_style=False,
|
||||||
|
)
|
||||||
|
|
||||||
repo.git.add(all=True)
|
repo.git.add(all=True)
|
||||||
repo.index.commit("fdroidserver git-mirror: Deploy to GitLab Pages")
|
repo.index.commit("fdroidserver git-mirror: Deploy to GitLab Pages")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue