def packaging(configurator, options,
              buildout_slave_path, environ=()):
    """Final steps for upload after testing of tarball.

    See :func:`postdownload.packaging` for explanation of options.
    """

    archive_name_interp = options['packaging.prefix'] + '-%(buildout-tag)s'
    upload_dir = options['packaging.upload-dir']
    master_dir = os.path.join('/var/www/livraison', upload_dir)
    master_path = os.path.join(master_dir, archive_name_interp + '.tar.bz2')
    base_url = options['packaging.base-url']
    return [
        FileUpload(
            slavesrc=WithProperties(
                '../dist/' + archive_name_interp + '.tar.bz2'),
            masterdest=WithProperties(master_path),
            url='/'.join((base_url, upload_dir)),
            mode=0644,
        ),
        FileUpload(
            slavesrc=WithProperties(
                '../dist/' + archive_name_interp + '.tar.bz2.md5'),
            masterdest=WithProperties(master_path + '.md5'),
            url='/'.join((base_url, upload_dir)),
            mode=0644,
        ),
    ]
Beispiel #2
0
def MakeMacBuilder():
    f = BuildFactory()
    f.addSteps(svn_co)
    f.addStep(
        ShellCommand(
            name='revision',
            command=['bash', 'revision.sh'],
            workdir='build/os/macosx',
            haltOnFailure=True,
            env={'SCHAT_REVISION': Property('got_revision')},
        ))
    f.addStep(
        ShellCommand(
            name='dmg',
            command=['bash', 'deploy.sh'],
            workdir='build/os/macosx',
            haltOnFailure=True,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties(
                'os/macosx/dmg/SimpleChat2-%(version)s.dmg'),
            masterdest=UploadFileName('SimpleChat2-%(version)s%(suffix)s.dmg'),
            url=WithProperties(
                'https://download.schat.me/schat2/snapshots/%(version)s/r%(got_revision)s/SimpleChat2-%(version)s%(suffix)s.dmg'
            ),
        ))
Beispiel #3
0
    def testURL(self):
        s = FileUpload(slavesrc=__file__,
                       masterdest=self.destfile,
                       url="http://server/file")
        s.build = Mock()
        s.build.getProperties.return_value = Properties()
        s.build.getSlaveCommandVersion.return_value = "2.13"

        s.step_status = Mock()
        s.step_status.addURL = Mock()
        s.buildslave = Mock()
        s.remote = Mock()
        s.start()

        for c in s.remote.method_calls:
            name, command, args = c
            commandName = command[3]
            kwargs = command[-1]
            if commandName == 'uploadFile':
                self.assertEquals(kwargs['slavesrc'], __file__)
                writer = kwargs['writer']
                writer.remote_write(open(__file__, "rb").read())
                self.assert_(not os.path.exists(self.destfile))
                writer.remote_close()
                break
        else:
            self.assert_(False, "No uploadFile command found")

        s.step_status.addURL.assert_called_once_with(
            os.path.basename(self.destfile), "http://server/file")
Beispiel #4
0
    def testTimestamp(self):
        s = FileUpload(slavesrc=__file__,
                       masterdest=self.destfile,
                       keepstamp=True)
        s.build = Mock()
        s.build.getProperties.return_value = Properties()
        s.build.getSlaveCommandVersion.return_value = "2.13"

        s.step_status = Mock()
        s.buildslave = Mock()
        s.remote = Mock()
        s.start()
        timestamp = (os.path.getatime(__file__), os.path.getmtime(__file__))

        for c in s.remote.method_calls:
            name, command, args = c
            commandName = command[3]
            kwargs = command[-1]
            if commandName == 'uploadFile':
                self.assertEquals(kwargs['slavesrc'], __file__)
                writer = kwargs['writer']
                writer.remote_write(open(__file__, "rb").read())
                self.assert_(not os.path.exists(self.destfile))
                writer.remote_close()
                writer.remote_utime(timestamp)
                break
        else:
            self.assert_(False, "No uploadFile command found")

        desttimestamp = (os.path.getatime(self.destfile),
                         os.path.getmtime(self.destfile))
        self.assertAlmostEquals(timestamp[0], desttimestamp[0], places=5)
        self.assertAlmostEquals(timestamp[1], desttimestamp[1], places=5)
    def testBasic(self):
        s = FileUpload(slavesrc=__file__, masterdest=self.destfile)
        s.build = Mock()
        s.build.getProperties.return_value = Properties()
        s.build.getSlaveCommandVersion.return_value = 1

        s.step_status = Mock()
        s.buildslave = Mock()
        s.remote = Mock()

        s.start()

        for c in s.remote.method_calls:
            name, command, args = c
            commandName = command[3]
            kwargs = command[-1]
            if commandName == 'uploadFile':
                self.assertEquals(kwargs['slavesrc'], __file__)
                writer = kwargs['writer']
                writer.remote_write(open(__file__, "rb").read())
                self.assert_(not os.path.exists(self.destfile))
                writer.remote_close()
                break
        else:
            self.assert_(False, "No uploadFile command found")

        self.assertEquals(
            open(self.destfile, "rb").read(),
            open(__file__, "rb").read())
Beispiel #6
0
def MakeDebBuilder():
    f = BuildFactory()
    f.addSteps(svn_co)
    f.addStep(
        ShellCommand(
            name='revision',
            command=['bash', 'revision.sh'],
            workdir='build/os/ubuntu',
            haltOnFailure=True,
            env={'SCHAT_REVISION': Property('got_revision')},
        ))
    f.addStep(
        ShellCommand(
            name='deb',
            command=['bash', 'build.sh'],
            workdir='build/os/ubuntu',
            env={'SCHAT_VERSION': SCHAT_VERSION},
            haltOnFailure=True,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties(
                'os/ubuntu/deb/schat2_%(version)s-1~%(codename)s_%(arch)s.deb'
            ),
            masterdest=UploadFileName(
                'schat2_%(version)s-1~%(codename)s%(suffix)s_%(arch)s.deb'),
            url=WithProperties(
                'https://download.schat.me/schat2/snapshots/%(version)s/r%(got_revision)s/schat2_%(version)s-1~%(codename)s%(suffix)s_%(arch)s.deb'
            ),
        ))
Beispiel #7
0
	def initFactory(self,arch):
		f = GNUAutoconf(SVN("http://svn.cri.ensmp.fr/svn/linear/trunk"),
			test=None,
			configureFlags=self.configure_flags)
		if arch == "linux-64":
			f.addStep(FileUpload(slavesrc=os.path.join("BUILD",self.targz),
						masterdest=self.www+self.targz, mode=0644))
		return f
Beispiel #8
0
def get_upload_step(abi, arch, file):
    do_step = True
    if abi in ('cp27-cp27m', 'cp34-cp34m', 'cp35-cp35m'):
        do_step = is_branch('release/1.10.x')

    return FileUpload(
        name="upload " + arch + " " + abi, workersrc=file,
        masterdest=Interpolate("%s/%s", common.upload_dir, file),
        mode=0o664, haltOnFailure=True, doStepIf=do_step)
Beispiel #9
0
	def initFactory(self,arch):
		self.make = "gmake" if arch == "bsd-64" else "make"
		f = GNUAutoconf( SVN("http://svn.cri.ensmp.fr/svn/pips/trunk"),
			configureFlags=self.configure_flags,
			compile=[self.make, "all"],
			test=None,
			install=[self.make, "install"],
			distcheck=None #[self.make, "distcheck"]
			)
		if arch == "linux-64":
			f.addStep(FileUpload(slavesrc=os.path.join("BUILD",self.targz),
						masterdest=self.www+self.targz, mode=0644))
		return f
  def AddUploadPerfExpectations(self, factory_properties=None):
    """Adds a step to the factory to upload perf_expectations.json to the
    master.
    """
    perf_id = factory_properties.get('perf_id')
    if not perf_id:
      logging.error('Error: cannot upload perf expectations: perf_id is unset')
      return
    slavesrc = 'src/tools/perf_expectations/perf_expectations.json'
    masterdest = ('../../scripts/master/log_parser/perf_expectations/%s.json' %
                  perf_id)

    self._factory.addStep(FileUpload(slavesrc=slavesrc,
                                     masterdest=masterdest))
Beispiel #11
0
def run_testament(platform):
    test_url = "test-data/{buildername[0]}/{got_revision[0][nim]}/"
    test_directory = 'public_html/' + test_url

    html_test_results = 'testresults.html'
    html_test_results_dest = gen_dest_filename(html_test_results)
    db_test_results = 'testament.db'
    db_test_results_dest = gen_dest_filename(db_test_results)

    return [
        ShellCommand(command=['koch', 'test'],
                     workdir=str(platform.nim_dir),
                     env=platform.base_env,
                     haltOnFailure=True,
                     timeout=None,
                     **gen_description('Run', 'Running', 'Run', 'Testament')),
        MasterShellCommand(
            command=['mkdir', '-p',
                     FormatInterpolate(test_directory)],
            path="public_html",
            hideStepIf=True),
        FileUpload(
            slavesrc=html_test_results,
            workdir=str(platform.nim_dir),
            url=FormatInterpolate(test_url + html_test_results_dest),
            masterdest=FormatInterpolate(test_directory +
                                         html_test_results_dest),
        ),
        FileUpload(
            slavesrc=db_test_results,
            workdir=str(platform.nim_dir),
            url=FormatInterpolate(test_url + db_test_results_dest),
            masterdest=FormatInterpolate(test_directory +
                                         db_test_results_dest),
        )
    ]
Beispiel #12
0
def MakeWinLegacyBuilder():
    f = BuildFactory()
    f.addSteps(svn_co_legacy)
    f.addStep(
        ShellCommand(
            name='revision',
            command=['cmd', '/c', 'revision.cmd'],
            workdir='build/os/win32',
            env={
                'SCHAT_VERSION': SCHAT_VERSION_LEGACY,
                'SCHAT_REVISION': Property('got_revision')
            },
            haltOnFailure=True,
        ))
    f.addStep(
        ShellCommand(
            name='qmake',
            command=['qmake', '-r'],
            haltOnFailure=True,
        ))
    f.addStep(Compile(
        command=['jom', '-j3', '/NOLOGO'],
        haltOnFailure=True,
    ))
    f.addStep(
        ShellCommand(
            name='nsis',
            command=['cmd', '/c', 'nsis.cmd'],
            workdir='build/os/win32',
            env={
                'SCHAT_SIGN_FILE': schat_passwords.SIGN_FILE,
                'SCHAT_SIGN_PASSWORD': schat_passwords.SIGN_PASSWORD,
                'SCHAT_VERSION': SCHAT_VERSION_LEGACY,
                'SCHAT_REVISION': Property('got_revision')
            },
            haltOnFailure=True,
            logEnviron=False,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties(
                'os/win32/out/schat-%(version_legacy)s.%(got_revision)s.exe'),
            masterdest=UploadFileNameLegacy(
                'schat-%(version_legacy)s.%(got_revision)s.exe'),
        ))
Beispiel #13
0
def MakeMacLegacyBuilder():
    f = BuildFactory()
    f.addSteps(svn_co_legacy)
    f.addStep(
        ShellCommand(
            name='dmg',
            command=['bash', 'deploy.sh'],
            workdir='build/os/macosx',
            haltOnFailure=True,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties(
                'os/macosx/dmg/SimpleChat-%(version_legacy)s.dmg'),
            masterdest=UploadFileNameLegacy(
                'SimpleChat-%(version_legacy)s.dmg'),
        ))
Beispiel #14
0
def MakeWinBuilder():
    f = BuildFactory()
    f.addSteps(svn_co)
    f.addStep(
        ShellCommand(
            name='revision',
            command=['cmd', '/c', 'revision.cmd'],
            workdir='build/os/win32',
            env={'SCHAT_REVISION': Property('got_revision')},
            haltOnFailure=True,
        ))
    f.addStep(
        ShellCommand(
            name='qmake',
            command=['qmake', '-r'],
            haltOnFailure=True,
        ))
    f.addStep(Compile(
        command=['jom', '-j3', '/NOLOGO'],
        haltOnFailure=True,
    ))
    f.addStep(
        ShellCommand(
            name='nsis',
            command=['cmd', '/c', 'nsis.cmd'],
            workdir='build/os/win32',
            env={
                'SCHAT_SIGN_FILE': schat_passwords.SIGN_FILE,
                'SCHAT_SIGN_PASSWORD': schat_passwords.SIGN_PASSWORD,
                'SCHAT_VERSION': SCHAT_VERSION,
                'SCHAT_REVISION': Property('got_revision')
            },
            haltOnFailure=True,
            logEnviron=False,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties('os/win32/out/schat2-%(version)s.exe'),
            masterdest=UploadFileName('schat2-%(version)s%(suffix)s.exe'),
            url=WithProperties(
                'https://download.schat.me/schat2/snapshots/%(version)s/r%(got_revision)s/schat2-%(version)s%(suffix)s.exe'
            ),
        ))
Beispiel #15
0
def gen_x64_full_factory (svnURL):
	x64_full_factory = factory.BuildFactory()
	x64_full_factory.addStep(SVN, workdir=r'build',svnurl=svnURL,username='******',password="******")
	x64_full_factory.addStep(Compile, workdir=r'build\\VS2005',
			   description=['64-bit compile'],
			   descriptionDone=['64-bit compile'],
			   command=['build_x64.bat'])
	x64_full_factory.addStep(ShellCommand,
			   workdir=r'build\\VS2005',
			   name='installer',
			   haltOnFailure=True,
			   description=['building installer'],
			   descriptionDone=['installer'],
			   command=['iscc.exe', '/Fgridlabd_x64-release', 'gridlabd-64.iss'])
	x64_full_factory.addStep(FileUpload(
			   workdir=r'build\\VS2005\\x64\\Release',
			   slavesrc='gridlabd_x64-release.exe',
			   masterdest='gridlabd_x64-release.exe'))
	return x64_full_factory
Beispiel #16
0
def gen_win32_full_factory (svnURL):
	win32_full2_factory = factory.BuildFactory()
	win32_full2_factory.addStep(SVN, workdir=r'build',svnurl=svnURL,username='******',password="******")
	win32_full2_factory.addStep(Compile, workdir=r'build\\VS2005',
			   description=['32-bit compile'],
			   descriptionDone=['32-bit compile'],
			   command=['MSBuild', 'gridlabd.sln', '/t:Rebuild',
						'/p:Platform=Win32;Configuration=Release', '/nologo'])
	win32_full2_factory.addStep(ShellCommand,
			   workdir=r'build\\VS2005',
			   name='installer',
			   haltOnFailure=True,
			   description=['building installer'],
			   descriptionDone=['installer'],
			   command=['iscc.exe', '/Fgridlabd-release', 'gridlabd.iss'])
	win32_full2_factory.addStep(FileUpload(
			   workdir=r'build\\VS2005\\Win32\\Release',
			   slavesrc='gridlabd-release.exe',
			   masterdest='gridlabd-release.exe'))
	return win32_full2_factory
Beispiel #17
0
def upload_release(platform):
    upload_url = "test-data/{buildername[0]}/{got_revision[0][nim]}/"
    test_directory = 'public_html/' + upload_url

    nim_exe_source = str(platform.nim_dir / "bin" / platform.nim_exe)
    nim_exe_dest = gen_dest_filename(platform.nim_exe)

    return [
        MasterShellCommand(
            command=['mkdir', '-p',
                     FormatInterpolate(test_directory)],
            path="public_html",
            hideStepIf=True),
        FileUpload(
            slavesrc=nim_exe_source,
            workdir=str(platform.nim_dir),
            url=FormatInterpolate(upload_url + nim_exe_dest),
            masterdest=FormatInterpolate(test_directory + nim_exe_dest),
        ),
    ]
Beispiel #18
0
def add_broot_steps(factory, arch, branch, env={}):
    factory.addStep(
        ShellCommand(command=["./osbuild", "broot", "clean"],
                     description="cleaning",
                     descriptionDone="clean",
                     haltOnFailure=True,
                     env=env))

    command = ["./osbuild", "broot", "create", "--arch=%s" % arch]
    factory.addStep(
        ShellCommand(command=command,
                     description="creating",
                     descriptionDone="create",
                     haltOnFailure=True,
                     env=env))

    factory.addStep(
        ShellCommand(command=["./osbuild", "broot", "distribute"],
                     description="distributing",
                     descriptionDone="distribute",
                     haltOnFailure=True,
                     env=env))

    broot_dir = "~/public_html/broot/"
    broot_filename = "%(prop:buildername)s-%(prop:buildnumber)s.tar.xz"

    masterdest = Interpolate(os.path.join(broot_dir, broot_filename))
    factory.addStep(
        FileUpload(slavesrc="build/sugar-build-broot.tar.xz",
                   masterdest=masterdest))

    command = Interpolate("%s %s %s %s %s" %
                          (get_command_path("release-broot"), broot_dir,
                           broot_filename, arch, branch))

    factory.addStep(
        MasterShellCommand(command=command,
                           description="releasing",
                           descriptionDone="release"))
Beispiel #19
0
def MakeSrcBuilder():
    f = BuildFactory()
    f.addSteps(svn_co)
    f.addStep(
        ShellCommand(
            name='tarball',
            command=['bash', 'os/source/tarball.sh'],
            env={
                'SCHAT_SOURCE':
                WithProperties('schat2-src-%(version)s%(suffix)s')
            },
            haltOnFailure=True,
        ))
    f.addStep(
        FileUpload(
            mode=0644,
            slavesrc=WithProperties(
                'schat2-src-%(version)s%(suffix)s.tar.bz2'),
            masterdest=UploadFileName(
                'schat2-src-%(version)s%(suffix)s.tar.bz2'),
            url=WithProperties(
                'https://download.schat.me/schat2/snapshots/%(version)s/r%(got_revision)s/schat2-src-%(version)s%(suffix)s.tar.bz2'
            ),
        ))
def launchpad_debbuild(c, package, version, binaries, url, distro, arch, machines, othermirror, keys, trigger_names = None):
    f = BuildFactory()
    # Grab the source package
    f.addStep(
        ShellCommand(
            haltOnFailure = True,
            name = package+'-getsourcedeb',
            command = ['dget', '--allow-unauthenticated', url]
        )
    )
    # download hooks
    f.addStep(
        FileDownload(
            name = package+'-grab-hooks',
            mastersrc = 'hooks/D05deps',
            slavedest = Interpolate('%(prop:workdir)s/hooks/D05deps'),
            hideStepIf = success,
            mode = 0777 # make this executable for the cowbuilder
        )
    )
    # Update the cowbuilder
    f.addStep(
        ShellCommand(
            command = ['cowbuilder-update.py', distro, arch] + keys,
            hideStepIf = success
        )
    )
    # Build it
    f.addStep(
        ShellCommand(
            haltOnFailure = True,
            name = package+'-build',
            command = ['cowbuilder',
                       '--build', package+'_'+version+'.dsc',
                       '--distribution', distro, '--architecture', arch,
                       '--basepath', '/var/cache/pbuilder/base-'+distro+'-'+arch+'.cow',
                       '--buildresult', Interpolate('%(prop:workdir)s'),
                       '--hookdir', Interpolate('%(prop:workdir)s/hooks'),
                       '--othermirror', othermirror,
                       '--override-config'],
            env = {'DIST': distro},
            descriptionDone = ['built binary debs', ]
        )
    )
    # Upload debs
    for deb_arch in binaries.keys():
        for deb_name in binaries[deb_arch]:
            debian_pkg = deb_name+'_'+version+'_'+deb_arch+'.deb'
            f.addStep(
                FileUpload(
                    name = deb_name+'-upload',
                    slavesrc = Interpolate('%(prop:workdir)s/'+debian_pkg),
                    masterdest = Interpolate('binarydebs/'+debian_pkg),
                    hideStepIf = success
                )
            )
            # Add the binarydeb using reprepro updater script on master
            f.addStep(
                MasterShellCommand(
                    name = deb_name+'-include',
                    command = ['reprepro-include.bash', deb_name, Interpolate(debian_pkg), distro, deb_arch],
                    descriptionDone = ['updated in apt', debian_pkg]
                )
            )
    # Trigger if needed
    if trigger_names != None:
        f.addStep( Trigger(schedulerNames = trigger_names, waitForFinish = False) )
    # Add to builders
    c['builders'].append(
        BuilderConfig(
            name = package+'_'+distro+'_'+arch+'_debbuild',
            slavenames = machines,
            factory = f
        )
    )
    # return name of builder created
    return package+'_'+distro+'_'+arch+'_debbuild'
Beispiel #21
0
        command=[
            python_executable, "makepanda/makewheel.py", "--outputdir",
            outputdir, "--version", whl_version, "--platform",
            Interpolate("macosx-%(prop:osxtarget)s-i386"), "--verbose"
        ],
        haltOnFailure=True),
    ShellCommand(
        name="makewheel",
        command=[
            python_executable, "makepanda/makewheel.py", "--outputdir",
            outputdir, "--version", whl_version, "--platform",
            Interpolate("macosx-%(prop:osxtarget)s-x86_64"), "--verbose"
        ],
        haltOnFailure=True),
    FileUpload(slavesrc=whl_filename32,
               masterdest=whl_upload_filename32,
               mode=0o664,
               haltOnFailure=True),
    FileUpload(slavesrc=whl_filename64,
               masterdest=whl_upload_filename64,
               mode=0o664,
               haltOnFailure=True),
]

publish_dmg_steps = [
    FileUpload(slavesrc=dmg_filename,
               masterdest=dmg_upload_filename,
               mode=0o664,
               haltOnFailure=True),
    MakeTorrent(dmg_upload_filename),
    SeedTorrent(dmg_upload_filename),
]
Beispiel #22
0
whl_steps = [
    SetPropertyFromCommand("python-abi", command=[
        python_executable, "-c", "import makewheel;print(makewheel.get_abi_tag())"],
        workdir="build/makepanda", haltOnFailure=True),
] + whl_version_steps

build_steps = [
    # Run makepanda - give it enough timeout (6h) since some steps take ages
    Compile(command=build_cmd, timeout=6*60*60,
           env={"MAKEPANDA_THIRDPARTY": "C:\\thirdparty",
                "MAKEPANDA_SDKS": "C:\\sdks"}, haltOnFailure=True),
]

publish_exe_steps = [
    FileUpload(slavesrc=exe_filename, masterdest=exe_upload_filename,
               mode=0o664, haltOnFailure=True),

    MakeTorrent(exe_upload_filename),
    SeedTorrent(exe_upload_filename),
]

publish_sdk_steps = [
    # Upload the wheel.
    FileUpload(slavesrc=whl_filename, masterdest=whl_upload_filename,
               mode=0o664, haltOnFailure=True),

    # Upload the pdb zip file.
    FileUpload(slavesrc=pdb_filename, masterdest=pdb_upload_filename,
               mode=0o664, haltOnFailure=False),
] + publish_exe_steps
Beispiel #23
0
        haltOnFailure=True),

    # Invoke makepanda.
    Compile(command=build_cmd,
            haltOnFailure=True,
            env={'PYTHONPATH': python_path}),
]

# Define a global lock, since reprepro won't allow simultaneous access to the repo.
repo_lock = MasterLock('reprepro')

# Steps to publish the runtime and SDK.
publish_deb_steps = [
    # Upload the deb package.
    FileUpload(slavesrc=deb_filename,
               masterdest=deb_upload_filename,
               mode=0o664,
               haltOnFailure=True),

    # Create a torrent file and start seeding it.
    MakeTorrent(deb_upload_filename),
    SeedTorrent(deb_upload_filename),

    # Upload it to an apt repository.
    MasterShellCommand(name="reprepro",
                       command=[
                           "reprepro", "-b", deb_archive_dir, "includedeb",
                           deb_archive_suite, deb_upload_filename
                       ],
                       locks=[repo_lock.access('exclusive')]),
]
Beispiel #24
0
def makeHomebrewRecipeCreationFactory():
    """Create the Homebrew recipe from a source distribution.

    This is separate to the recipe testing, to allow it to be done on a
    non-Mac platform.  Once complete, this triggers the Mac testing.
    """
    factory = getFlockerFactory(python="python2.7")
    factory.addSteps(installDependencies())
    factory.addSteps(check_version())

    # Create suitable names for files hosted on Buildbot master.

    sdist_file = Interpolate('Flocker-%(prop:version)s.tar.gz')
    sdist_path = resultPath('python', discriminator=sdist_file)
    sdist_url = resultURL('python', discriminator=sdist_file, isAbsolute=True)

    recipe_file = Interpolate('Flocker%(kw:revision)s.rb',
                              revision=flockerRevision)
    recipe_path = resultPath('homebrew', discriminator=recipe_file)
    recipe_url = resultURL('homebrew', discriminator=recipe_file)

    # Build source distribution
    factory.addStep(
        ShellCommand(name='build-sdist',
                     description=["building", "sdist"],
                     descriptionDone=["build", "sdist"],
                     command=[
                         virtualenvBinary('python'),
                         "setup.py",
                         "sdist",
                     ],
                     haltOnFailure=True))

    # Upload source distribution to master
    factory.addStep(
        FileUpload(
            name='upload-sdist',
            slavesrc=Interpolate('dist/Flocker-%(prop:version)s.tar.gz'),
            masterdest=sdist_path,
            url=sdist_url,
        ))

    # Build Homebrew recipe from source distribution URL
    factory.addStep(
        ShellCommand(
            name='make-homebrew-recipe',
            description=["building", "recipe"],
            descriptionDone=["build", "recipe"],
            command=[
                virtualenvBinary('python'),
                "-m",
                "admin.homebrew",
                # We use the Git commit SHA for the version here, since
                # admin.homebrew doesn't handle the version generated by
                # arbitrary commits.
                "--flocker-version",
                flockerRevision,
                "--sdist",
                sdist_url,
                "--output-file",
                recipe_file
            ],
            haltOnFailure=True))

    # Upload new .rb file to BuildBot master
    factory.addStep(
        FileUpload(
            name='upload-homebrew-recipe',
            slavesrc=recipe_file,
            masterdest=recipe_path,
            url=recipe_url,
        ))

    # Trigger the homebrew-test build
    factory.addStep(
        Trigger(
            name='trigger/created-homebrew',
            schedulerNames=['trigger/created-homebrew'],
            set_properties={
                # lint_revision is the commit that was merged against,
                # if we merged forward, so have the triggered build
                # merge against it as well.
                'merge_target': Property('lint_revision')
            },
            updateSourceStamp=True,
            waitForFinish=False,
        ))

    return factory
    # Build the installer.
    ShellCommand(name="package", command=package_cmd, haltOnFailure=True,
                 doStepIf=lambda step:not step.getProperty("optimize", False)),

    # And the test scripts for deploy-ng.
    #Test(name="build_samples", command=test_deployng_cmd, doStepIf=is_branch("deploy-ng"), haltOnFailure=True),
]

# Define a global lock, since reprepro won't allow simultaneous access to the repo.
repo_lock = MasterLock('reprepro')

# Steps to publish the runtime and SDK.
publish_deb_steps = [
    # Upload the deb package.
    FileUpload(workersrc=deb_filename, masterdest=deb_upload_filename,
               mode=0o664, haltOnFailure=True,
               doStepIf=lambda step:not step.getProperty("optimize", False)),

    # Create a torrent file and start seeding it.
    #MakeTorrent(deb_upload_filename),
    #SeedTorrent(deb_upload_filename),

    # Upload it to an apt repository.
    MasterShellCommand(name="reprepro", command=[
        "reprepro", "-b", deb_archive_dir, "includedeb", deb_archive_suite,
        deb_upload_filename], locks=[repo_lock.access('exclusive')],
        doStepIf=lambda step:not step.getProperty("optimize", False)),
]

# Now make the factories.
deb_factory = BuildFactory()
Beispiel #26
0
    whl_filename = get_whl_filename(abi, 'universal2')

    build_steps_11_0 += [
        get_build_step(abi),
        get_test_step(abi),
        get_makewheel_step(abi, 'universal2'),
        get_upload_step(abi, 'universal2', whl_filename),
        ShellCommand(name="rm "+abi, command=['rm', '-f', whl_filename], haltOnFailure=False),
    ]

# Build and upload the installer.
package_steps = [
    ShellCommand(name="package", command=package_cmd, haltOnFailure=True),

    FileUpload(name="upload dmg", workersrc=get_dmg_filename(),
               masterdest=get_dmg_upload_filename(),
               mode=0o664, haltOnFailure=True),
]
build_steps_10_6 += package_steps
build_steps_10_9 += package_steps


def macosx_builder(osxver):
    if osxver in ('10.6', '10.7', '10.8'):
        workernames = config.macosx_10_6_workers
        buildsteps = build_steps_10_6
    elif osxver.startswith('11.'):
        workernames = config.macosx_11_0_workers
        buildsteps = build_steps_11_0
    else:
        workernames = config.macosx_10_9_workers
Beispiel #27
0
def gen_x64_nightly_factory(svnURL, gridlab_ver): # I hate this hack, it means one more place I have to change the gridlab version  Quick Hack!
	x64_nightly_factory = factory.BuildFactory()
	x64_nightly_factory.addStep(SVN, workdir=r'build',svnurl=svnURL,username='******',password="******")
	x64_nightly_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='update_revision',
			   haltOnFailure=False,
			   description=['update revision'],
			   descriptionDone=['update_revision'],
			   command=['bash', 'utilities/gen_rev'])
	x64_nightly_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='update_version',
			   haltOnFailure=False,
			   description=['update version'],
			   descriptionDone=['update_version'],
			   command=['bash', 'checkpkgs'])
	x64_nightly_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='clean_autotest',
			   haltOnFailure=False,
			   description=['clean autotest'],
			   descriptionDone=['clean_autotest'],
			   command=['bash', 'clean_autotest.sh'])
	x64_nightly_factory.addStep(Compile, workdir=r'build\\VS2005',
			   description=['64-bit compile'],
			   descriptionDone=['64-bit compile'],
			   command=['build_x64.bat'])
	x64_nightly_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='autotest',
			   haltOnFailure=True, 
			   description=['Testing Gridlabd'],
			   descriptionDone=['autotest'],
			   timeout=60*60,
			   command=['python', 'validate.py', '.'])
	x64_nightly_factory.addStep(ShellCommand,
			   workdir=r'build\\VS2005',
			   name='installer',
			   haltOnFailure=True,
			   description=['building installer'],
			   descriptionDone=['installer'],
			   command=['python','build_installer.py', 'gridlabd-x64_'+gridlab_ver,'gridlabd-64.iss'])
	x64_nightly_factory.addStep(ShellCommand,
			   workdir=r'build\\VS2005',
			   name='copy_installer',
			   haltOnFailure=True,
			   description=['copy installer'],
			   descriptionDone=['copy installer'],
			   command=['python','copy_installer.py', 'gridlabd-x64_'+gridlab_ver,'..\\..\\releases'])
	x64_nightly_factory.addStep(ShellCommand,
			   workdir=r'build\\VS2005',
			   name='sf_updater',
			   haltOnFailure=True,
			   description=['updating sourceforge'],
			   descriptionDone=['sf_update'],
			   command=['python','update_sourceforge.py','--prefix=gridlabd-x64-']) # Deletes files older than 5 days.
	x64_nightly_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='upload_installer',
			   haltOnFailure=False,
			   description=['Upload nightly builds to Sourceforge'],
			   descriptionDone=['upload_installer'],
			   command=['rsync_wrapper.bat','../releases/','frs.sourceforge.net','/home/frs/project/g/gr/gridlab-d/gridlab-d/Nightly\ x64'])
	x64_nightly_factory.addStep(FileUpload(
			   blocksize=64*1024,
			   workdir=r'build\\VS2005\\x64\\Release',
			   slavesrc='gridlabd-x64_'+gridlab_ver+'-nightly.exe',
			   masterdest='gridlabd-x64_'+gridlab_ver+'-nightly.exe'))
	return x64_nightly_factory
Beispiel #28
0
def createWindowsDevFactory():
    f = BuildFactory()

    f.addStep(
        Git(
            description="fetching sources",
            descriptionDone="sources",
            haltOnFailure=True,
            repourl=repositoryUri,
            mode='full',
            method='clobber',
        ))

    f.addStep(
        ShellCommand(description="fetching packages",
                     descriptionDone="packages",
                     haltOnFailure=True,
                     command=["paket.exe", "restore"],
                     workdir=workingDirectory))

    f.addStep(
        SetPropertyFromCommand(description="setting version",
                               descriptionDone="version",
                               haltOnFailure=True,
                               command=[
                                   "racket",
                                   "c:\\build-tools\\patch-version.rkt", "-p",
                                   "windows", "-v", "0.1.4", "-b",
                                   Property("buildnumber")
                               ],
                               property="buildPostfix",
                               workdir=workingDirectory))

    f.addStep(
        ShellCommand(description="building",
                     descriptionDone="build",
                     haltOnFailure=True,
                     command=["msbuild", "CorvusAlba.ToyFactory.Windows.sln"],
                     workdir=workingDirectory))

    f.addStep(
        ShellCommand(
            description="archiving",
            descriptionDone="archive",
            haltOnFailure=True,
            command=[
                "tar", "-zcvf",
                Interpolate("toy-factory-%(prop:buildPostfix)s.tar.gz"),
                "../bin"
            ],
            workdir=workingDirectory))

    f.addStep(
        FileUpload(
            description="uploading",
            descriptionDone="upload",
            haltOnFailure=True,
            mode=0644,
            slavesrc=Interpolate("toy-factory-%(prop:buildPostfix)s.tar.gz"),
            masterdest=Interpolate(
                "~/builds/toy-factory-%(prop:buildPostfix)s.tar.gz"),
            workdir=workingDirectory))
Beispiel #29
0
 f.addStep(
     ShellCommand(
         haltOnFailure=True,
         name=package + '-buildsource',
         command=[
             Interpolate('%(prop:workdir)s/build_source_deb.py'),
             rosdistro, package,
             Interpolate('%(prop:release_version)s'),
             Interpolate('%(prop:workdir)s')
         ] + gbp_args,
         descriptionDone=['sourcedeb', package]))
 # Upload sourcedeb to master (currently we are not actually syncing these with a public repo)
 f.addStep(
     FileUpload(
         name=package + '-uploadsource',
         slavesrc=Interpolate('%(prop:workdir)s/' + deb_name + '.dsc'),
         masterdest=Interpolate('sourcedebs/' + deb_name + '.dsc'),
         hideStepIf=success))
 # Stamp the changelog, in a similar fashion to the ROS buildfarm
 f.addStep(
     SetPropertyFromCommand(command="date +%Y%m%d-%H%M-%z",
                            property="datestamp",
                            name=package + '-getstamp',
                            hideStepIf=success))
 f.addStep(
     ShellCommand(
         haltOnFailure=True,
         name=package + '-stampdeb',
         command=[
             'gbp', 'dch', '-a', '--ignore-branch', '--verbose', '-N',
             Interpolate('%(prop:release_version)s-%(prop:datestamp)s' +
Beispiel #30
0
def gen_win32_nightly_factory(svnURL,gridlab_ver): # I hate this hack, it means one more place I have to change the gridlab version  Quick Hack!
	win32_nightly2_factory = factory.BuildFactory()
	win32_nightly2_factory.addStep(SVN, workdir=r'build',svnurl=svnURL,username='******',password="******")
	win32_nightly2_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='update_revision',
			   haltOnFailure=False,
			   description=['update revision'],
			   descriptionDone=['update_revision'],
			   command=['bash', 'utilities/gen_rev'])
	win32_nightly2_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='update_version',
			   haltOnFailure=False,
			   description=['update version'],
			   descriptionDone=['update_version'],
			   command=['bash', 'checkpkgs'])
	# win32_nightly2_factory.addStep(ShellCommand,
			   # workdir=r'build',
			   # name='generate_troubleshooting',
			   # haltOnFailure=False,
			   # description=['generate troubleshooting'],
			   # descriptionDone=['generate_troubleshooting'],
			   # command=['bash', 'generate_troubleshooting.sh'])
	# win32_nightly2_factory.addStep(ShellCommand,
			   # workdir=r'build',
			   # name='copy_troubleshooting',
			   # haltOnFailure=False,
			   # description=['Copy troubleshooting documentation'],
			   # descriptionDone=['copy_troubleshooting'],
			   # command=['rsync_wrapper.bat','../documents/troubleshooting/*','web.sourceforge.net','htdocs/troubleshooting/'+gridlab_ver])
	win32_nightly2_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='clean_autotest',
			   haltOnFailure=False,
			   description=['clean autotest'],
			   descriptionDone=['clean_autotest'],
			   command=['bash', 'clean_autotest.sh'])
	win32_nightly2_factory.addStep(Compile, workdir=r'build\\VS2005',
			   description=['32-bit compile'],
			   descriptionDone=['32-bit compile'],
			   command=['MSBuild', 'gridlabd.sln', '/t:Rebuild',
						'/p:Platform=Win32;Configuration=Release', '/nologo'])
	win32_nightly2_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='autotest',
			   haltOnFailure=True, 
			   description=['Testing Gridlabd'],
			   timeout=60*60,
			   descriptionDone=['autotest'],
			   command=['python', 'validate.py', '.'])
	win32_nightly2_factory.addStep(ShellCommand,
			   workdir=r'build\\VS2005',
			   name='installer',
			   haltOnFailure=True,
			   description=['building installer'],
			   descriptionDone=['installer'],
			   command=['python','build_installer.py', 'gridlabd-win32_'+gridlab_ver])
	win32_nightly2_factory.addStep(ShellCommand,
			   workdir=r'build\\VS2005',
			   name='copy_installer',
			   haltOnFailure=True,
			   description=['copy installer'],
			   descriptionDone=['copy installer'],
			   command=['python','copy_installer.py', 'gridlabd-win32_'+gridlab_ver,'..\\..\\releases'])
	win32_nightly2_factory.addStep(ShellCommand,
			   workdir=r'build\\VS2005',
			   name='sf_updater',
			   haltOnFailure=True,
			   description=['updating sourceforge'],
			   descriptionDone=['sf_update'],
			   command=['python','update_sourceforge.py']) # Deletes files older than 5 days.
	win32_nightly2_factory.addStep(ShellCommand,
			   workdir=r'build',
			   name='upload_installer',
			   haltOnFailure=False,
			   description=['Upload nightly builds to Sourceforge'],
			   descriptionDone=['upload_installer'],
			   command=['rsync_wrapper.bat','../releases/','frs.sourceforge.net','/home/frs/project/g/gr/gridlab-d/gridlab-d/Nightly\ Win32'])
	win32_nightly2_factory.addStep(FileUpload(
			   workdir=r'build\\VS2005\\Win32\\Release',
			   slavesrc='gridlabd-win32_'+ gridlab_ver +'-nightly.exe',
			   masterdest='gridlabd-win32_'+ gridlab_ver +'-nightly.exe'))

	

	return win32_nightly2_factory