def test_build_rpm(self): basepath = os.path.join(os.path.expanduser('~/')) d = Deployment('testapp', base=basepath, arch=centos) d.root_path = os.path.join(basepath, '.parcel') d.prepare_app() # test build, will not actually call fpm d.build_package() dest_file = os.path.join(os.path.dirname(__file__),"data", "testapp_0.1.1-1.noarch.rpm") print dest_file self.assertTrue(os.path.exists(dest_file)) os.unlink(dest_file)
def test_build_rpm(self): basepath = os.path.join(os.path.expanduser('~/')) d = Deployment('testapp', base=basepath, arch=centos) d.root_path = os.path.join(basepath, '.parcel') d.prepare_app() # test build, will not actually call fpm d.build_package() dest_file = os.path.join(os.path.dirname(__file__), "data", "testapp_0.1.1-1.noarch.rpm") print dest_file self.assertTrue(os.path.exists(dest_file)) os.unlink(dest_file)
def deb(): deploy = Deployment( env.app_name, build_deps=['python-virtualenv', 'python-pip'], base='/opt/webapps/wb/flask-native-package', arch=distro.Ubuntu(), version="0.0.1" ) deploy.add_preinst(['service %s stop' % env.app_name]) deploy.add_postinst(['service %s start' % env.app_name]) deploy.prepare_app() #this should be built into parcel, or needs an Upstart(Depployment) tools.rsync([deploy.path+'/debian/'],deploy.root_path,rsync_ignore='.rsync-ignore') deploy.build_package()
def deb(): deploy = Deployment( env.app_name, build_deps=["python-virtualenv", "python-pip"], base="/opt/pypiserver", arch=distro.Ubuntu(), version="0.0.1", ) deploy.add_postinst(["service %s start" % env.app_name]) deploy.prepare_app() conf = upstart_conf.format(app_name=env.app_name, app_home=deploy.app_path) path = deploy.root_path + "/etc/init/%s.conf" % env.app_name tools.write_contents_to_remote(conf, path) deploy.build_package()
def test_build_deb(self): basepath = os.path.join(os.path.expanduser('~/')) d = Deployment('testapp', base=basepath) d.root_path = os.path.join(basepath, '.parcel') d.prepare_app() # test build, will not actually call fpm d.build_package() dest_file = os.path.join(os.path.dirname(__file__),"data", "testapp_0.1.2_all.deb") self.assertTrue(os.path.exists(dest_file)) os.unlink(dest_file) # now do it without templates to exercise those paths d = Deployment('testapp', base=basepath) d.root_path = os.path.join(basepath, '.parcel_test') d.build_package(templates=False) dest_file = os.path.join(os.path.dirname(__file__),"data", "testapp_0.1.2_all.deb") self.assertTrue(os.path.exists(dest_file)) os.unlink(dest_file) # now set some prerm etc directly and check d = Deployment('testapp', base=basepath) d.root_path = os.path.join(basepath, '.parcel_test') lines = ['test line one', 'test line two'] d.prerm = " ".join(lines) d.postrm = " ".join(lines) d.preinst = " ".join(lines) d.postinst = " ".join(lines) d.build_package() dest_file = os.path.join(os.path.dirname(__file__),"data", "testapp_0.1.2_all.deb") self.assertTrue(os.path.exists(dest_file)) os.unlink(dest_file)
def test_build_deb(self): basepath = os.path.join(os.path.expanduser('~/')) d = Deployment('testapp', base=basepath) d.root_path = os.path.join(basepath, '.parcel') d.prepare_app() # test build, will not actually call fpm d.build_package() dest_file = os.path.join(os.path.dirname(__file__), "data", "testapp_0.1.2_all.deb") self.assertTrue(os.path.exists(dest_file)) os.unlink(dest_file) # now do it without templates to exercise those paths d = Deployment('testapp', base=basepath) d.root_path = os.path.join(basepath, '.parcel_test') d.build_package(templates=False) dest_file = os.path.join(os.path.dirname(__file__), "data", "testapp_0.1.2_all.deb") self.assertTrue(os.path.exists(dest_file)) os.unlink(dest_file) # now set some prerm etc directly and check d = Deployment('testapp', base=basepath) d.root_path = os.path.join(basepath, '.parcel_test') lines = ['test line one', 'test line two'] d.prerm = " ".join(lines) d.postrm = " ".join(lines) d.preinst = " ".join(lines) d.postinst = " ".join(lines) d.build_package() dest_file = os.path.join(os.path.dirname(__file__), "data", "testapp_0.1.2_all.deb") self.assertTrue(os.path.exists(dest_file)) os.unlink(dest_file)