mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 09:56:13 +01:00
Merge pull request #1029 from dirkmueller/helm
Add osc helm build type support
This commit is contained in:
commit
4aecebc265
20
osc/build.py
20
osc/build.py
@ -420,6 +420,11 @@ def get_built_files(pacdir, buildtype):
|
||||
'-name', '*.iso*'],
|
||||
stdout=subprocess.PIPE).stdout.read().strip()
|
||||
s_built = ''
|
||||
elif buildtype == 'helm':
|
||||
b_built = subprocess.Popen(['find', os.path.join(pacdir, 'HELM'),
|
||||
'-type', 'f'],
|
||||
stdout=subprocess.PIPE).stdout.read().strip()
|
||||
s_built = ''
|
||||
elif buildtype == 'snapcraft':
|
||||
b_built = subprocess.Popen(['find', os.path.join(pacdir, 'OTHER'),
|
||||
'-name', '*.snap'],
|
||||
@ -647,6 +652,8 @@ def main(apiurl, opts, argv):
|
||||
build_type = 'collax'
|
||||
if os.path.basename(build_descr) == 'appimage.yml':
|
||||
build_type = 'appimage'
|
||||
if os.path.basename(build_descr) == 'Chart.yaml':
|
||||
build_type = 'helm'
|
||||
if os.path.basename(build_descr) == 'snapcraft.yaml':
|
||||
build_type = 'snapcraft'
|
||||
if os.path.basename(build_descr) == 'simpleimage':
|
||||
@ -660,14 +667,15 @@ def main(apiurl, opts, argv):
|
||||
if build_descr.endswith('flatpak.yaml') or build_descr.endswith('flatpak.yml') or build_descr.endswith('flatpak.json'):
|
||||
build_type = 'flatpak'
|
||||
if build_type not in ['spec', 'dsc', 'kiwi', 'arch', 'collax', 'livebuild',
|
||||
'simpleimage', 'snapcraft', 'appimage', 'docker',
|
||||
'simpleimage', 'snapcraft', 'appimage', 'docker', 'helm',
|
||||
'podman', 'fissile', 'flatpak', 'preinstallimage']:
|
||||
raise oscerr.WrongArgs(
|
||||
'Unknown build type: \'%s\'. '
|
||||
'Build description should end in .spec, .dsc, .kiwi, or .livebuild. '
|
||||
'Or being named PKGBUILD, build.collax, simpleimage, appimage.yml, '
|
||||
'snapcraft.yaml, flatpak.json, flatpak.yml, flatpak.yaml, preinstallimage '
|
||||
'or Dockerfile' % build_type)
|
||||
'Unknown build type: \'%s\'. '
|
||||
'Build description should end in .spec, .dsc, .kiwi, or .livebuild. '
|
||||
'Or being named PKGBUILD, build.collax, simpleimage, appimage.yml, '
|
||||
'Chart.yaml, snapcraft.yaml, flatpak.json, flatpak.yml, flatpak.yaml, '
|
||||
'preinstallimage or Dockerfile' % build_type)
|
||||
|
||||
if not os.path.isfile(build_descr):
|
||||
raise oscerr.WrongArgs('Error: build description file named \'%s\' does not exist.' % build_descr)
|
||||
|
||||
|
@ -6320,11 +6320,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
for subarch in osc.build.can_also_build.get(mainarch):
|
||||
all_archs.append(subarch)
|
||||
for arg in args:
|
||||
if (arg.endswith('.spec') or arg.endswith('.dsc') or arg.endswith('.kiwi') or
|
||||
arg.endswith('.livebuild') or arg == 'PKGBUILD' or arg == 'build.collax' or
|
||||
arg == 'Dockerfile' or arg == 'fissile.yml' or arg == 'appimage.yml' or
|
||||
arg == '_preinstallimage' or arg.endswith('flatpak.yaml') or
|
||||
arg.endswith('flatpak.yml') or arg.endswith('flatpak.json')):
|
||||
if (arg.endswith('.spec') or arg.endswith('.dsc') or
|
||||
arg.endswith('.kiwi') or arg.endswith('.livebuild') or
|
||||
arg.endswith('flatpak.yaml') or arg.endswith('flatpak.yml') or
|
||||
arg.endswith('flatpak.json') or
|
||||
arg in ('PKGBUILD', 'build.collax', 'Chart.yaml', 'Dockerfile',
|
||||
'fissile.yml', 'appimage.yml', '_preinstallimage')):
|
||||
arg_descr = arg
|
||||
else:
|
||||
if (arg == osc.build.hostarch or arg in all_archs) and arg_arch is None:
|
||||
@ -6386,10 +6387,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
# can be implemented using
|
||||
# reduce(lambda x, y: x + y, (glob.glob(x) for x in ('*.spec', '*.dsc', '*.kiwi')))
|
||||
# but be a bit more readable :)
|
||||
descr = glob.glob('*.spec') + glob.glob('*.dsc') + glob.glob('*.kiwi') + glob.glob('*.livebuild') \
|
||||
+ glob.glob('PKGBUILD') + glob.glob('build.collax') + glob.glob('Dockerfile') + glob.glob('fissile.yml') \
|
||||
+ glob.glob('appimage.yml') \
|
||||
+ glob.glob('*flatpak.yaml') + glob.glob('*flatpak.yml') + glob.glob('*flatpak.json')
|
||||
descr = glob.glob('*.spec') + glob.glob('*.dsc') + glob.glob('*.kiwi') + glob.glob('*.livebuild') + \
|
||||
glob.glob('PKGBUILD') + glob.glob('build.collax') + glob.glob('Dockerfile') + \
|
||||
glob.glob('fissile.yml') + glob.glob('appimage.yml') + glob.glob('Chart.yaml') + \
|
||||
glob.glob('*flatpak.yaml') + glob.glob('*flatpak.yml') + glob.glob('*flatpak.json')
|
||||
|
||||
# FIXME:
|
||||
# * request repos from server and select by build type.
|
||||
|
Loading…
Reference in New Issue
Block a user