Beispiel #1
0
 def __init__(self, os_and_version):
     (os, version) = os_and_version.split('.', 1)
     if os.startswith('osx'):
         build_image = TaskEnvironment.by_name('osx10_10.build')
     else:
         build_image = DockerImage.by_name('build')
     if os == 'linux' or os.startswith('osx'):
         h = hashlib.sha1(build_image.hexdigest)
         h.update('v2')
         if os == 'linux':
             description = 'git v{}'.format(version)
         else:
             env = build_image
             description = 'git v{} {} {}'.format(version, env.os, env.cpu)
         Task.__init__(
             self,
             task_env=build_image,
             description=description,
             index='{}.git.v{}'.format(h.hexdigest(), version),
             expireIn='26 weeks',
             command=Task.checkout(
                 'git://git.kernel.org/pub/scm/git/git.git',
                 'v{}'.format(version)) +
             [
                 'make -C repo -j$(nproc) install prefix=/'
                 ' NO_GETTEXT=1 NO_OPENSSL=1 NO_TCLTK=1'
                 ' DESTDIR=$PWD/git',
                 'tar -Jcf $ARTIFACTS/git-{}.tar.xz git'.format(version),
             ],
             artifact='git-{}.tar.xz'.format(version),
         )
     else:
         env = TaskEnvironment.by_name('{}.build'.format(os))
         raw_version = version
         if 'windows' not in version:
             version = {
                 version: version + '.windows.1',
                 '2.17.1': '2.17.1.windows.2',
             }.get(version)
         if version.endswith('.windows.1'):
             min_ver = version[:-len('.windows.1')]
         else:
             min_ver = version.replace('windows.', '')
         Task.__init__(
             self,
             task_env=build_image,
             description='git v{} {} {}'.format(version, env.os, env.cpu),
             index='{}.git.v{}'.format(os, raw_version),
             expireIn='26 weeks',
             command=[
                 'curl -L https://github.com/git-for-windows/git/releases/'
                 'download/v{}/MinGit-{}-{}-bit.zip'
                 ' -o git.zip'.format(version, min_ver, msys.bits(env.cpu)),
                 'unzip -d git git.zip',
                 'tar -jcf $ARTIFACTS/git-{}.tar.bz2 git'.format(
                     raw_version),
             ],
             artifact='git-{}.tar.bz2'.format(raw_version),
         )
Beispiel #2
0
    def __init__(self, cpu):
        assert cpu in CPUS
        _create_command = (
            'curl -L http://repo.msys2.org/distrib/{cpu}'
            '/msys2-base-{cpu}-{version}.tar.xz | xz -cd | bzip2 -c'
            ' > $ARTIFACTS/msys2.tar.bz2'.format(cpu=cpu,
                                                 version=MSYS_VERSION))
        h = hashlib.sha1(_create_command)
        self.hexdigest = h.hexdigest()
        self.cpu = cpu

        Task.__init__(
            self,
            task_env=DockerImage.by_name('base'),
            description='msys2 image: base {}'.format(cpu),
            index=self.index,
            expireIn='26 weeks',
            command=[_create_command],
            artifact='msys2.tar.bz2',
        )
Beispiel #3
0
    def __init__(self, cpu):
        assert cpu in CPUS
        _create_command = (
            'curl -L http://repo.msys2.org/distrib/{cpu}'
            '/msys2-base-{cpu}-{version}.tar.xz | xz -cd | bzip2 -c'
            ' > $ARTIFACTS/msys2.tar.bz2'.format(
                cpu=msys_cpu(cpu), version=MSYS_VERSION)
        )
        h = hashlib.sha1(_create_command.encode())
        self.hexdigest = h.hexdigest()
        self.cpu = cpu

        Task.__init__(
            self,
            task_env=DockerImage.by_name('base'),
            description='msys2 image: base {}'.format(cpu),
            index=self.index,
            expireIn='26 weeks',
            command=[_create_command],
            artifact='msys2.tar.bz2',
        )
Beispiel #4
0
 def __init__(self, os_and_version):
     (os, version) = os_and_version.split('.', 1)
     if os.startswith('osx'):
         build_image = TaskEnvironment.by_name('osx10_10.build')
     else:
         build_image = DockerImage.by_name('build')
     if os == 'linux' or os.startswith('osx'):
         h = hashlib.sha1(build_image.hexdigest.encode())
         h.update(b'v2')
         if os == 'linux':
             description = 'git v{}'.format(version)
         else:
             env = build_image
             description = 'git v{} {} {}'.format(version, env.os, env.cpu)
         Task.__init__(
             self,
             task_env=build_image,
             description=description,
             index='{}.git.v{}'.format(h.hexdigest(), version),
             expireIn='26 weeks',
             command=Task.checkout(
                 'git://git.kernel.org/pub/scm/git/git.git',
                 'v{}'.format(version)
             ) + [
                 'make -C repo -j$({}) install prefix=/ NO_GETTEXT=1'
                 ' NO_OPENSSL=1 NO_TCLTK=1 DESTDIR=$PWD/git'.format(
                     nproc(build_image)),
                 'tar -Jcf $ARTIFACTS/git-{}.tar.xz git'
                 .format(version),
             ],
             artifact='git-{}.tar.xz'.format(version),
         )
     else:
         env = TaskEnvironment.by_name('{}.build'.format(os))
         raw_version = version
         if 'windows' not in version:
             version = {
                 version: version + '.windows.1',
                 '2.17.1': '2.17.1.windows.2',
             }.get(version)
         if version.endswith('.windows.1'):
             min_ver = version[:-len('.windows.1')]
         else:
             min_ver = version.replace('windows.', '')
         Task.__init__(
             self,
             task_env=build_image,
             description='git v{} {} {}'.format(version, env.os, env.cpu),
             index='{}.git.v{}'.format(os, raw_version),
             expireIn='26 weeks',
             command=[
                 'curl -L https://github.com/git-for-windows/git/releases/'
                 'download/v{}/MinGit-{}-{}-bit.zip'
                 ' -o git.zip'.format(version, min_ver, msys.bits(env.cpu)),
                 'unzip -d git git.zip',
                 'curl -L https://github.com/git-for-windows/git/releases/'
                 'download/v{}/Git-{}-{}-bit.tar.bz2 | '
                 'tar -C git -jx {}/libexec/git-core/git-http-backend.exe'
                 .format(version, min_ver, msys.bits(env.cpu),
                         msys.mingw(env.cpu).lower()),
                 'tar -jcf $ARTIFACTS/git-{}.tar.bz2 git'.format(
                     raw_version),
             ],
             artifact='git-{}.tar.bz2'.format(raw_version),
         )