4
0
mirror of https://github.com/QuasarApp/QuasarAppCI.git synced 2025-04-28 14:44:36 +00:00

72 lines
2.1 KiB
Python
Raw Permalink Normal View History

2020-10-19 20:06:49 +03:00
# This Python file uses the following encoding: utf-8
from BuildBotLib.cmake import CMake
2021-04-11 10:09:18 +03:00
from buildbot.plugins import util
2020-10-19 20:06:49 +03:00
class Docs(CMake):
def __init__(self, platform):
CMake.__init__(self, platform)
def generatePlatformSteps(self, platform):
platformXcmd = {
CMake.P_Linux: self.linuxXmakeCmd,
CMake.P_Windows: self.windowsXmakeCmd,
CMake.P_Android: self.androidXmakeCmd,
CMake.P_Wasm: self.wasmXmakeCmd,
}
res = []
res += [self.generateStep(platformXcmd[platform],
platform,
self.makePrefix() + 'Make',
lambda step: True)]
res += [self.generateStep(self.makeTarget('doc'),
platform,
'Generate docs for the project',
self.isDeploy)]
2020-10-19 21:44:22 +03:00
def move(props):
2022-01-18 18:53:03 +03:00
return 'mv docs/* ' + str(props.getProperty('copyFolder'))
2020-10-19 21:44:22 +03:00
2022-01-19 00:09:30 +03:00
res += [self.generateStep('mkdir -p Distro',
2022-01-21 23:22:00 +03:00
platform,
'make target dir',
self.isDeploy)]
2022-01-19 00:09:30 +03:00
2020-10-19 21:44:22 +03:00
res += [self.generateStep(move,
2021-04-11 10:09:18 +03:00
platform,
'moveDocs',
self.isDeploy)]
2020-10-19 20:06:49 +03:00
return res
2020-10-19 20:48:04 +03:00
def getPropertyes(self):
2020-10-19 21:07:20 +03:00
return [
2020-10-19 20:48:04 +03:00
util.BooleanParameter(
name='deploy',
label='deploy project',
default=True
),
util.StringParameter(
name='copyFolder',
label='Folder with buildet data',
default="Distro"
),
]
2021-04-16 23:45:57 +03:00
def destDirPrivate(self, props):
repo = str(props.getProperty('repository'))
branch = str(props.getProperty('branch'))
name = branch
if branch == "main" or branch == "master":
name = "latest"
return "docs/" + self.getNameProjectFromGitUrl(repo) + "/" + name