def ops_db_client_build(parameters): src_path = ASSERT.predicate( shipyard2.rules.pythons\ .find_package(parameters, foreman.get_relpath()) / 'scripts' / 'ops-db-client', Path.is_file, ) dst_path = Path('/usr/local/bin/ops-db-client') if dst_path.exists(): LOG.info('skip: install ops-db-client') return LOG.info('install ops-db-client') with scripts.using_sudo(): scripts.cp(src_path, dst_path)
def build(parameters): src_path = parameters['//bases:drydock'] / foreman.get_relpath() src_path /= src_path.name if (src_path / 'capnpc-java').exists(): LOG.info('skip: build capnproto-java') return LOG.info('build capnproto-java') bin_path = _get_var_path('exec_prefix') / 'bin' header_path = _get_var_path('includedir') / 'capnp' with scripts.using_cwd(src_path): scripts.make() with scripts.using_sudo(): scripts.cp('capnpc-java', bin_path) scripts.cp('compiler/src/main/schema/capnp/java.capnp', header_path)
def build(parameters): src_path = _find_project(parameters, foreman.get_relpath()) root_path = _find_root_project(src_path) ASSERT.false(src_path.samefile(root_path)) output_path = src_path / ('build/libs/%s-all.jar' % src_path.name) task = ':'.join(src_path.relative_to(root_path).parts) task = ':%s:shadowJar' % task target_dir_path = parameters[root_project + ':packages'] if (target_dir_path / output_path.name).exists(): LOG.info('skip: run task %s', task) return LOG.info('run task %s', task) with scripts.using_cwd(root_path): scripts.run(['./gradlew', task]) with scripts.using_sudo(): scripts.mkdir(target_dir_path) scripts.cp(output_path, target_dir_path)
def web_server_setup(parameters): del parameters # Unused. with scripts.using_sudo(): scripts.mkdir('/srv/web') scripts.cp(foreman.to_path('web-server/index.html'), '/srv/web')