本文整理汇总了Python中osv.modules.filemap.FileMap.add方法的典型用法代码示例。如果您正苦于以下问题:Python FileMap.add方法的具体用法?Python FileMap.add怎么用?Python FileMap.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osv.modules.filemap.FileMap
的用法示例。
在下文中一共展示了FileMap.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
_module = "${OSV_BASE}/modules/httpserver-jolokia-plugin"
usr_files = FileMap()
usr_files.add(os.path.join(_module, "jolokia.so")).to("/usr/mgmt/plugins/jolokia.so")
usr_files.add(os.path.join(_module, "api-doc/listings/jolokia.json")).to("/usr/mgmt/api/listings/jolokia.json")
usr_files.add("${OSV_BASE}/java/jolokia-agent/target/jolokia-agent.jar").to("/usr/mgmt/jolokia-agent.jar")
示例2: require
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
require('lua')
require('ncurses')
require('libedit')
require_running('httpserver')
usr_files = FileMap()
usr_files.add('${OSV_BASE}/modules/cli').to('/cli') \
.include('cli.so') \
.include('cli.lua') \
.include('lib/**') \
.include('commands/**')
full = api.run('/cli/cli.so')
default = full
示例3: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
from osv.modules import api
from osv.modules.filemap import FileMap
api.require('java')
_jar = '/tests/java/tests.jar'
_isolates_jar = '/tests/java/isolates.jar'
usr_files = FileMap()
usr_files.add('${OSV_BASE}/java/tests/target/runjava-tests.jar').to(_jar)
usr_files.add('${OSV_BASE}/java/tests-isolates/target/tests-isolates-jar-with-dependencies.jar').to(_isolates_jar)
usr_files.add('${OSV_BASE}/java/tests/target/classes/tests/ClassPutInRoot.class').to('/tests/ClassPutInRoot.class')
usr_files.add('${OSV_BASE}/java/tests-jre-extension/target/tests-jre-extension.jar') \
.to('/usr/lib/jvm/java/jre/lib/ext/tests-jre-extension.jar')
default = api.run_java(classpath=[_jar, _isolates_jar],
args=['-Disolates.jar=' + _isolates_jar, 'org.junit.runner.JUnitCore', 'io.osv.AllTests'])
示例4: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
from osv.modules.api import *
from osv.modules.filemap import FileMap
usr_files = FileMap()
usr_files.add('${OSV_BASE}/mgmt/httpserver/httpserver.so').to('/usr/mgmt/httpserver.so')
_web_jar = '/usr/mgmt/web-1.0.0.jar'
_logging_opts = '-Djava.util.logging.config.file=/usr/mgmt/config/logging.properties'
shell = run_java(
jvm_args=[_logging_opts],
classpath=[
'/usr/mgmt/lib/bcprov-jdk15on-147.jar',
'/usr/mgmt/lib/bcpkix-jdk15on-147.jar',
_web_jar,
],
args=[
'-jar', '/usr/mgmt/crash-1.0.0.jar'
])
web = run_java(
jvm_args=[_logging_opts],
args=['-jar', _web_jar, 'app', 'prod'])
full = [
shell,
delayed(web, 3000)
]
示例5: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
_module = '${OSV_BASE}/modules/httpserver'
_exe = '/libhttpserver.so'
usr_files = FileMap()
usr_files.add(os.path.join(_module, 'libhttpserver.so')).to(_exe)
usr_files.add(os.path.join(_module, 'api-doc')).to('/usr/mgmt/api')
usr_files.add(os.path.join(_module, 'swagger-ui', 'dist')).to('/usr/mgmt/swagger-ui/dist')
usr_files.add(os.path.join(_module, 'osv-gui/public')).to('/usr/mgmt/gui')
api.require('openssl')
api.require('libtools')
api.require('libyaml')
# only require next 3 modules if java (jre) is included in the list of modules
api.require_if_other_module_present('josvsym','java')
api.require_if_other_module_present('httpserver-jolokia-plugin','java')
api.require_if_other_module_present('httpserver-jvm-plugin','java')
# httpserver will run regardless of an explicit command line
# passed with "run.py -e".
daemon = api.run_on_init(_exe + ' &!')
fg = api.run(_exe)
fg_ssl = api.run(_exe + ' --ssl')
示例6: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
_module = '${OSV_BASE}/modules/httpserver'
usr_files = FileMap()
usr_files.add(os.path.join(_module, 'libhttpserver.so')).to('/libhttpserver.so')
usr_files.add(os.path.join(_module, 'api-doc')).to('/usr/mgmt/api')
usr_files.add(os.path.join(_module, 'swagger-ui', 'dist')).to('/usr/mgmt/swagger-ui/dist')
#default = api.run('/libhttpserver.so')
# Instead of adding to the command line using api.run(...), put a command in
# /init. This way, httpserver will run regardless of an explicit command line
# passed with "run.py -e".
usr_files.add(os.path.join(_module, 'cmdline')).to('/init/10-httpserver')
示例7: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
from osv.modules import api
from osv.modules.filemap import FileMap
api.require("java")
_jar = "/tests/java/tests.jar"
_isolates_jar = "/tests/java/isolates.jar"
usr_files = FileMap()
usr_files.add("${OSV_BASE}/java/tests/target/runjava-tests.jar").to(_jar)
usr_files.add("${OSV_BASE}/java/tests-isolates/target/tests-isolates-jar-with-dependencies.jar").to(_isolates_jar)
usr_files.add("${OSV_BASE}/java/tests-jre-extension/target/tests-jre-extension.jar").to(
"/usr/lib/jvm/java/jre/lib/ext/tests-jre-extension.jar"
)
default = api.run_java(
classpath=[_jar, _isolates_jar],
args=["-Disolates.jar=" + _isolates_jar, "org.junit.runner.JUnitCore", "io.osv.AllTests"],
)
示例8: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
_module = '${OSV_BASE}/modules/httpserver-api'
_exe = '/libhttpserver-api.so'
usr_files = FileMap()
usr_files.add(os.path.join(_module, 'libhttpserver-api.so')).to(_exe)
usr_files.add(os.path.join(_module, 'api-doc')).to('/usr/mgmt/api')
api.require('openssl')
api.require('libtools')
api.require('libyaml')
# only require next 3 modules if java (jre) is included in the list of modules
api.require_if_other_module_present('josvsym','java')
api.require_if_other_module_present('httpserver-jolokia-plugin','java')
api.require_if_other_module_present('httpserver-jvm-plugin','java')
# httpserver will run regardless of an explicit command line
# passed with "run.py -e".
daemon = api.run_on_init(_exe + ' &!')
fg = api.run(_exe)
fg_ssl = api.run(_exe + ' --ssl')
default = daemon
示例9: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
from osv.modules import api
import os, os.path
usr_files = FileMap()
api.require('fonts')
jdkdir = os.path.basename(os.path.expandvars('${jdkbase}'))
if not os.path.exists('diskimage/usr/lib/jvm'):
os.makedirs('diskimage/usr/lib/jvm')
def symlink_force(dest, name):
if os.path.lexists(name):
os.unlink(name)
os.symlink(dest, name)
symlink_force('java', 'diskimage/usr/lib/jvm/' + jdkdir)
symlink_force('java/jre', 'diskimage/usr/lib/jvm/jre')
usr_files.add('${jdkbase}').to('/usr/lib/jvm/java') \
.include('lib/**') \
.include('jre/**') \
.exclude('jre/lib/security/cacerts') \
.exclude('jre/lib/audio/**')
usr_files.add(os.getcwd() + '/diskimage/usr/lib/jvm/' + jdkdir) \
.to('/usr/lib/jvm/' + jdkdir) \
.allow_symlink()
usr_files.add(os.getcwd() + '/diskimage/usr/lib/jvm/jre') \
.to('/usr/lib/jvm/jre') \
.allow_symlink()
示例10: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
_module = '${OSV_BASE}/modules/jolokia-agent'
usr_files = FileMap()
usr_files.add(os.path.join(_module, 'target/jolokia-agent.jar')).to('/usr/mgmt/jolokia-agent.jar')
示例11: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
import os
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
_app = '${OSV_BASE}/apps/httpserver-html5-cli'
usr_files = FileMap()
usr_files.add(os.path.join(_app, 'osv-html5-terminal/dist')).to('/usr/mgmt/cli')
usr_files.add(os.path.join(_app, 'httpserver.conf')).to('/etc/httpserver.conf')
api.require('httpserver-api')
# httpserver will run regardless of an explicit command line
# passed with "run.py -e".
_exe = '/libhttpserver-api.so --config-file=/etc/httpserver.conf'
daemon = api.run_on_init(_exe + ' &!')
fg = api.run(_exe)
fg_ssl = api.run(_exe + ' --ssl')
fg_cors = api.run(_exe + ' --access-allow=true')
default = daemon
示例12: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
usr_files = FileMap()
usr_files.add('${OSV_BASE}/mgmt/crash/target/dependencies').to('/usr/mgmt/lib')
_crash_jar = '/usr/mgmt/crash-1.0.0.jar'
_cloudius_jar = '/java/cloudius.jar'
_logging_opts = ['-Djava.util.logging.config.file=/usr/mgmt/config/logging.properties']
shell = run_java(
classpath=[
_cloudius_jar,
_crash_jar,
'/usr/mgmt/lib/*'
],
args=_logging_opts + [
'-jar', _crash_jar
])
# Some CLI commands depend on httpserver presence
_httpserver_module = require('httpserver')
httpserver = _httpserver_module.default
_osvinit_module = require('osvinit')
osvinit = _osvinit_module.default
full = [
shell,
httpserver,
示例13: Copyright
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
#
# Copyright (C) 2014 Cloudius Systems, Ltd.
#
# This work is open source software, licensed under the terms of the
# BSD license as described in the LICENSE file in the top-level directory.
#
from osv.modules.filemap import FileMap
from osv.modules import api
import os, os.path
provides = ['java']
non_isolated_jvm = True
api.require('fonts')
api.require('ca-certificates')
api.require('libz')
api.require('josvsym')
usr_files = FileMap()
usr_files.add('${OSV_BASE}/apps/openjdk9-ea-java-base/install').to('/').allow_symlink()
usr_files.add('${OSV_BASE}/apps/openjdk9-ea-java-base/install/usr/lib/jvm/java') \
.to('/usr/lib/jvm/java') \
.allow_symlink()
usr_files.link('/usr/lib/jvm/jre').to('/usr/lib/jvm/java/jre')
示例14: Copyright
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
#
# Copyright (C) 2017 Waldemar Kozaczuk
#
# This work is open source software, licensed under the terms of the
# BSD license as described in the LICENSE file in the top-level directory.
#
from osv.modules.filemap import FileMap
from osv.modules import api
api.require('java-cmd')
provides = ['java','java8']
usr_files = FileMap()
usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-full/install').to('/').allow_symlink()
#usr_files.add('${OSV_BASE}/apps/openjdk8-zulu-full/install/usr/lib/jvm/java') \
# .to('/usr/lib/jvm/java') \
# .allow_symlink()
usr_files.link('/usr/lib/jvm/jre').to('/usr/lib/jvm/java/jre')
示例15: FileMap
# 需要导入模块: from osv.modules.filemap import FileMap [as 别名]
# 或者: from osv.modules.filemap.FileMap import add [as 别名]
from osv.modules.api import *
from osv.modules.filemap import FileMap
from osv.modules import api
usr_files = FileMap()
usr_files.add('${OSV_BASE}/mgmt/httpserver/httpserver.so').to('/usr/mgmt/httpserver.so')
usr_files.add('${OSV_BASE}/mgmt/api').to('/usr/mgmt/api')
usr_files.add('${OSV_BASE}/mgmt/swagger-ui/dist').to('/usr/mgmt/swagger-ui/dist')
_cloudius_jar = '/java/cloudius.jar'
_web_jar = '/usr/mgmt/web-1.0.0.jar'
_logging_opts = ['-Djava.util.logging.config.file=/usr/mgmt/config/logging.properties']
shell = run_java(
classpath=[
'/usr/mgmt/lib/bcprov-jdk15on-147.jar',
'/usr/mgmt/lib/bcpkix-jdk15on-147.jar',
_cloudius_jar,
_web_jar,
],
args=_logging_opts + [
'-jar', '/usr/mgmt/crash-1.0.0.jar'
])
httpserver = api.run('/usr/mgmt/httpserver.so')
full = [
shell,
httpserver,
]