mirror of
https://github.com/QuasarApp/QuasarAppCI.git
synced 2025-04-27 14:24:32 +00:00
remove all rudiments
This commit is contained in:
parent
c3a5f8c4d4
commit
bae3d674c1
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ gitpoller-workdir/
|
||||
|
||||
*.pyproject.user.*
|
||||
*~
|
||||
*.autosave
|
||||
|
@ -20,9 +20,7 @@
|
||||
"buildBotChangeSource.py",
|
||||
"qtUpdater.py",
|
||||
"secretManager.py",
|
||||
"NPM.py",
|
||||
"git/gitBin.sh",
|
||||
"asssetsinstaller.py",
|
||||
"qifRepogen.py",
|
||||
"docs.py"
|
||||
]
|
||||
|
@ -1,9 +0,0 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
|
||||
from BuildBotLib.basemodule import BaseModule
|
||||
|
||||
|
||||
class NPM(BaseModule):
|
||||
|
||||
def __init__(self):
|
||||
BaseModule.__init__(self)
|
@ -1,150 +0,0 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
|
||||
from BuildBotLib.basemodule import BaseModule
|
||||
from buildbot.plugins import util, steps
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class AsssetsInstaller(BaseModule):
|
||||
def __init__(self):
|
||||
BaseModule.__init__(self)
|
||||
|
||||
format = ""
|
||||
|
||||
AndroidBaseDir = str(Path.home()) + "/Android"
|
||||
|
||||
def isInit(self, step):
|
||||
return step.getProperty('module') == 'init'
|
||||
|
||||
def RemoveOldData(self, props):
|
||||
|
||||
cmd = "mkdir -p " + self.AndroidBaseDir
|
||||
|
||||
if os.path.exists(self.AndroidBaseDir):
|
||||
cmd = "rm -rdf " + self.AndroidBaseDir + " ; " + cmd
|
||||
|
||||
return self.generateCmd(cmd)
|
||||
|
||||
def NDKDownloadCMD(self, props):
|
||||
link = props.getProperty("link")
|
||||
|
||||
self.format = link[link.rfind('.'):].lower()
|
||||
|
||||
return ["curl",
|
||||
link,
|
||||
"--output",
|
||||
self.AndroidBaseDir + "/temp" + self.format]
|
||||
|
||||
def ExtractCMD(self, props):
|
||||
|
||||
res = ["echo", "format '" + self.format + "' not supported"]
|
||||
|
||||
if self.format == ".zip":
|
||||
res = ["unzip", self.AndroidBaseDir + "/temp" + self.format,
|
||||
"-d", self.AndroidBaseDir]
|
||||
|
||||
return res
|
||||
|
||||
def InstallCMD(self, props):
|
||||
|
||||
module = props.getProperty("module")
|
||||
version = props.getProperty("version")
|
||||
|
||||
unit_to_multiplier = {
|
||||
'SDK': ["platform-tools", "tools", "platforms;android-"+version],
|
||||
'NDK': ['ndk-bundle']
|
||||
}
|
||||
|
||||
return ["sdkmanager"] + unit_to_multiplier.get(module, "--list")
|
||||
|
||||
def ConfigureCMD(self, props):
|
||||
|
||||
res = ["echo", "Configure failed"]
|
||||
|
||||
if self.format == ".zip":
|
||||
|
||||
all_subdirs = self.allSubdirsOf(self.AndroidBaseDir)
|
||||
latest_subdir = max(all_subdirs, key=os.path.getmtime)
|
||||
res = "mv " + latest_subdir + " " + self.AndroidBaseDir + "/tools"
|
||||
res += " ; ln -sf "
|
||||
res += self.AndroidBaseDir + "/tools/bin/sdkmanager "
|
||||
res += self.home + "/.local/bin/sdkmanager"
|
||||
res += " ; yes | sdkmanager --licenses"
|
||||
|
||||
return self.generateCmd(res)
|
||||
|
||||
def getFactory(self):
|
||||
factory = super().getFactory()
|
||||
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=self.getWraper(self.RemoveOldData),
|
||||
name='rm old item',
|
||||
doStepIf=self.getWraper(self.isInit),
|
||||
description='rm old',
|
||||
haltOnFailure=True,
|
||||
)
|
||||
)
|
||||
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=self.getWraper(self.NDKDownloadCMD),
|
||||
name='download new item',
|
||||
doStepIf=self.getWraper(self.isInit),
|
||||
description='download new item',
|
||||
haltOnFailure=True,
|
||||
)
|
||||
)
|
||||
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=self.getWraper(self.ExtractCMD),
|
||||
name='extract new item',
|
||||
doStepIf=self.getWraper(self.isInit),
|
||||
description='extract new item',
|
||||
haltOnFailure=True,
|
||||
)
|
||||
)
|
||||
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=self.getWraper(self.ConfigureCMD),
|
||||
name='configure new item',
|
||||
doStepIf=self.getWraper(self.isInit),
|
||||
description='configure new item',
|
||||
haltOnFailure=True,
|
||||
)
|
||||
)
|
||||
|
||||
factory.addStep(
|
||||
steps.ShellCommand(
|
||||
command=self.getWraper(self.InstallCMD),
|
||||
name='install module',
|
||||
doStepIf=lambda step: not self.isInit(step),
|
||||
description='configure new item',
|
||||
haltOnFailure=True,
|
||||
)
|
||||
)
|
||||
|
||||
return factory
|
||||
|
||||
def getPropertyes(self):
|
||||
return [
|
||||
util.ChoiceStringParameter(
|
||||
name='module',
|
||||
choices=["init", "SDK", "NDK"],
|
||||
default="init"
|
||||
),
|
||||
|
||||
util.StringParameter(
|
||||
name='link',
|
||||
label="url to download item",
|
||||
default=""
|
||||
),
|
||||
util.StringParameter(
|
||||
name='version',
|
||||
label="Version",
|
||||
default=""
|
||||
),
|
||||
]
|
@ -1,13 +1,14 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
from BuildBotLib.buildBotModule import BuildBotModule
|
||||
from BuildBotLib.secretManager import SecretManager
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class BuildBotChangeSource(BuildBotModule):
|
||||
def __init__(self, masterConf):
|
||||
BuildBotModule.__init__(self, masterConf)
|
||||
|
||||
secret = SecretManager("/home/andrei/buildBotSecret/secret.json")
|
||||
secret = SecretManager(str(Path.home()) + "/buildBotSecret/secret.json")
|
||||
|
||||
self.masterConf['www']['change_hook_dialects'] = {
|
||||
'github':
|
||||
|
Loading…
x
Reference in New Issue
Block a user