Skip to content

Commit

Permalink
Merge pull request #863 from ONLYOFFICE/release/v8.2.0
Browse files Browse the repository at this point in the history
Merge branch release/v8.2.0 into develop
  • Loading branch information
K0R0L authored Aug 13, 2024
2 parents 10b7f63 + 63fbbc5 commit 243946a
Show file tree
Hide file tree
Showing 32 changed files with 1,327 additions and 236 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ tests/puppeteer/node_modules
tests/puppeteer/work_directory
tests/puppeteer/package.json
tests/puppeteer/package-lock.json
scripts/sdkjs_common/jsdoc/node_modules
scripts/sdkjs_common/jsdoc/package-lock.json
28 changes: 19 additions & 9 deletions make_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
# parse
parser = argparse.ArgumentParser(description="Build packages.")
parser.add_argument("-P", "--platform", dest="platform", type=str,
action="store", help="Defines platform", required=True)
parser.add_argument("-T", "--targets", dest="targets", type=str, nargs="+",
action="store", help="Defines targets", required=True)
parser.add_argument("-R", "--branding", dest="branding", type=str,
action="store", help="Provides branding path")
action="store", help="Defines platform", required=True)
parser.add_argument("-T", "--targets", dest="targets", type=str, nargs="+",
action="store", help="Defines targets", required=True)
parser.add_argument("-V", "--version", dest="version", type=str,
action="store", help="Defines version")
action="store", help="Defines version")
parser.add_argument("-B", "--build", dest="build", type=str,
action="store", help="Defines build")
action="store", help="Defines build")
parser.add_argument("-H", "--branch", dest="branch", type=str,
action="store", help="Defines branch")
parser.add_argument("-R", "--branding", dest="branding", type=str,
action="store", help="Provides branding path")
args = parser.parse_args()

# vars
Expand All @@ -29,8 +31,16 @@
common.clean = "clean" in args.targets
common.sign = "sign" in args.targets
common.deploy = "deploy" in args.targets
common.version = args.version if args.version else utils.get_env("BUILD_VERSION", "0.0.0")
common.build = args.build if args.build else utils.get_env("BUILD_NUMBER", "0")
if args.version: common.version = args.version
else: common.version = utils.get_env("PRODUCT_VERSION", "0.0.0")
utils.set_env("PRODUCT_VERSION", common.version)
utils.set_env("BUILD_VERSION", common.version)
if args.build: common.build = args.build
else: common.build = utils.get_env("BUILD_NUMBER", "0")
utils.set_env("BUILD_NUMBER", common.build)
if args.branch: common.branch = args.branch
else: common.branch = utils.get_env("BRANCH_NAME", "null")
utils.set_env("BRANCH_NAME", common.branch)
common.branding = args.branding
common.timestamp = utils.get_timestamp()
common.workspace_dir = utils.get_abspath(utils.get_script_dir(__file__) + "/..")
Expand Down
15 changes: 8 additions & 7 deletions scripts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def cmd2(prog, args=[], is_no_errors=False):
sys.exit("Error (" + prog + "): " + str(ret))
return ret

def cmd_exe(prog, args):
def cmd_exe(prog, args, is_no_errors=False):
prog_dir = os.path.dirname(prog)
env_dir = os.environ
if ("linux" == host_platform()):
Expand All @@ -406,7 +406,7 @@ def cmd_exe(prog, args):
command += (" \"" + arg + "\"")
process = subprocess.Popen(command, stderr=subprocess.STDOUT, shell=True, env=env_dir)
ret = process.wait()
if ret != 0:
if ret != 0 and True != is_no_errors:
sys.exit("Error (" + prog + "): " + str(ret))
return ret

Expand All @@ -426,12 +426,13 @@ def cmd_and_return_cwd(prog, args=[], is_no_errors=False):

def run_command(sCommand):
popen = subprocess.Popen(sCommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
result = {'stdout' : '', 'stderr' : ''}
result = {'stdout' : '', 'stderr' : '', 'returncode' : 0}
try:
stdout, stderr = popen.communicate()
popen.wait()
result['stdout'] = stdout.strip().decode('utf-8', errors='ignore')
result['stderr'] = stderr.strip().decode('utf-8', errors='ignore')
result['returncode'] = popen.returncode
finally:
popen.stdout.close()
popen.stderr.close()
Expand Down Expand Up @@ -1046,15 +1047,15 @@ def web_apps_addons_param():
def download(url, dst):
return cmd_exe("curl", ["-L", "-o", dst, url])

def extract(src, dst):
def extract(src, dst, is_no_errors=False):
app = "7za" if ("mac" == host_platform()) else "7z"
return cmd_exe(app, ["x", "-y", src, "-o" + dst])
return cmd_exe(app, ["x", "-y", src, "-o" + dst], is_no_errors)

def extract_unicode(src, dst):
def extract_unicode(src, dst, is_no_errors=False):
if "windows" == host_platform():
run_as_bat_win_isolate([u"chcp 65001", u"call 7z.exe x -y \"" + src + u"\" \"-o" + dst + u"\"", u"exit"])
return
return extract(src, dst)
return extract(src, dst, is_no_errors)

def archive_folder(src, dst):
app = "7za" if ("mac" == host_platform()) else "7z"
Expand Down
16 changes: 13 additions & 3 deletions scripts/build_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,25 @@ def build_sdk_native(directory, minimize=True):
_run_grunt(directory, get_build_param(minimize) + ["--mobile=true"] + addons)
return

def build_js_develop(root_dir):
#_run_npm_cli(root_dir + "/sdkjs/build")

def build_sdkjs_develop(root_dir):
external_folder = config.option("--external-folder")
if (external_folder != ""):
external_folder = "/" + external_folder

_run_npm_ci(root_dir + external_folder + "/sdkjs/build")
_run_grunt(root_dir + external_folder + "/sdkjs/build", get_build_param(False) + base.sdkjs_addons_param())
_run_grunt(root_dir + external_folder + "/sdkjs/build", ["develop"] + base.sdkjs_addons_param())


def build_js_develop(root_dir):
#_run_npm_cli(root_dir + "/sdkjs/build")
external_folder = config.option("--external-folder")
if (external_folder != ""):
external_folder = "/" + external_folder

build_sdkjs_develop(root_dir)

_run_npm(root_dir + external_folder + "/web-apps/build")
_run_npm_ci(root_dir + external_folder + "/web-apps/build/sprites")
_run_grunt(root_dir + external_folder + "/web-apps/build/sprites", [])
Expand Down
7 changes: 2 additions & 5 deletions scripts/deploy_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def make():
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "Fb2File")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "EpubFile")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "DocxRenderer")
base.copy_lib(core_build_dir + "/lib/" + platform_postfix, archive_dir, "hunspell")
base.copy_file(git_dir + "/sdkjs/pdf/src/engine/cmap.bin", archive_dir + "/cmap.bin")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "x2t")

Expand All @@ -61,13 +62,9 @@ def make():
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "ooxml_crypt")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "vboxtester")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "metafiletester")
base.copy_exe(core_build_dir + "/bin/" + platform_postfix, archive_dir, "dictionariestester")

# dictionaries
base.copy_dictionaries(git_dir + "/dictionaries", archive_dir + "/dictionaries", True, False)

if base.is_file(archive_dir + ".7z"):
base.delete_file(archive_dir + ".7z")
base.archive_folder(archive_dir + "/*", archive_dir + ".7z")

return

24 changes: 13 additions & 11 deletions scripts/develop/config_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import os
import json

def get_core_url(arch, branch):
return "http://repo-doc-onlyoffice-com.s3.amazonaws.com/" + base.host_platform() + "/core/" + branch + "/latest/" + arch + "/core.7z"
def get_core_url(platform, branch):
return "http://repo-doc-onlyoffice-com.s3.amazonaws.com/archive/" \
+ branch + "/latest/core-" + platform.replace("_", "-") + ".7z"

def make():
git_dir = base.get_script_dir() + "/../.."
Expand All @@ -20,14 +21,21 @@ def make():

arch = "x64"
arch2 = "_64"
if ("windows" == base.host_platform()) and not base.host_platform_is64():
if base.is_windows() and not base.host_platform_is64():
arch = "x86"
arch2 = "_32"
if base.is_os_arm():
arch2 = "_arm64"
platform = ""
if base.is_windows():
platform = "win" + arch2
else:
platform = base.host_platform() + arch2

url = get_core_url(arch, config.option("branch"))
url = get_core_url(platform, config.option("branch"))
data_url = base.get_file_last_modified_url(url)
if (data_url == "" and config.option("branch") != "develop"):
url = get_core_url(arch, "develop")
url = get_core_url(platform, "develop")
data_url = base.get_file_last_modified_url(url)

old_data_url = base.readFile("./core.7z.data")
Expand All @@ -49,12 +57,6 @@ def make():
base.extract("./core.7z", "./")
base.writeFile("./core.7z.data", data_url)

platform = ""
if ("windows" == base.host_platform()):
platform = "win" + arch2
else:
platform = base.host_platform() + arch2

base.copy_files("./core/*", "./")
else:
print("-----------------------------------------------------------")
Expand Down
22 changes: 13 additions & 9 deletions scripts/develop/run_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@ def run_integration_example():

def start_linux_services():
base.print_info('Restart MySQL Server')



def update_config(args):
platform = base.host_platform()
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']

if ("linux" == platform):
base.cmd_in_dir(base_dir + '/../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0'] + args)
else:
base.cmd_in_dir(base_dir + '/../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0', '--sql-type', 'mysql', '--db-port', '3306', '--db-name', 'onlyoffice', '--db-user', 'root', '--db-pass', 'onlyoffice'] + args)


def make_start():
base.configure_common_apps()

Expand All @@ -64,15 +75,8 @@ def make_start():
start_linux_services()

def make_configure(args):
platform = base.host_platform()
branch = base.run_command('git rev-parse --abbrev-ref HEAD')['stdout']

base.print_info('Build modules')
if ("linux" == platform):
base.cmd_in_dir(base_dir + '/../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0'] + args)
else:
base.cmd_in_dir(base_dir + '/../../', 'python', ['configure.py', '--branch', branch or 'develop', '--develop', '1', '--module', 'server', '--update', '1', '--update-light', '1', '--clean', '0', '--sql-type', 'mysql', '--db-port', '3306', '--db-name', 'onlyoffice', '--db-user', 'root', '--db-pass', 'onlyoffice'] + args)

update_config(args)
base.cmd_in_dir(base_dir + '/../../', 'python', ['make.py'])
def make_install():
platform = base.host_platform()
Expand Down
59 changes: 56 additions & 3 deletions scripts/package_branding.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,59 @@
builder_product_name = "Document Builder"

if utils.is_linux():
desktop_make_targets = ["deb", "rpm", "suse-rpm", "tar"]
builder_make_targets = ["deb", "rpm"] # tar
server_make_targets = ["deb", "rpm", "tar"]
builder_make_targets = [
{
"make": "tar",
"src": "tar/*.tar*",
"dst": "builder/linux/generic/"
},
{
"make": "deb",
"src": "deb/*.deb",
"dst": "builder/linux/debian/"
},
{
"make": "rpm",
"src": "rpm/build/RPMS/*/*.rpm",
"dst": "builder/linux/rhel/"
}
]
desktop_make_targets = [
{
"make": "tar",
"src": "tar/*.tar*",
"dst": "desktop/linux/generic/"
},
{
"make": "deb",
"src": "deb/*.deb",
"dst": "desktop/linux/debian/"
},
{
"make": "rpm",
"src": "rpm/build/RPMS/*/*.rpm",
"dst": "desktop/linux/rhel/"
},
{
"make": "rpm-suse",
"src": "rpm-suse/build/RPMS/*/*.rpm",
"dst": "desktop/linux/suse/"
}
]
server_make_targets = [
{
"make": "deb",
"src": "deb/*.deb",
"dst": "server/linux/debian/"
},
{
"make": "rpm",
"src": "rpm/builddir/RPMS/*/*.rpm",
"dst": "server/linux/rhel/"
},
{
"make": "tar",
"src": "*.tar*",
"dst": "server/linux/snap/"
}
]
Loading

0 comments on commit 243946a

Please sign in to comment.