Skip to content
Snippets Groups Projects
Commit 7efc4114 authored by calrama's avatar calrama
Browse files

update ci

parent 3c89cf0f
No related branches found
No related tags found
No related merge requests found
Pipeline #29424 passed
Pipeline: biotracker

#29430

    #! /usr/bin/env python3
    from os import environ as env
    from platform import system
    from subprocess import check_call, check_output
    from argparse import ArgumentParser
    def define(key: str, value: str):
    return ['-D', f'{key}={value}']
    def define_env(name: str):
    return define(name, env[name]) if name in env else []
    if system() == 'Windows':
    def setup_msvc():
    msvc_path = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/Common7/Tools'
    lines = check_output(
    [
    'cmd',
    '/c',
    'VsDevCmd.bat',
    '-arch=amd64',
    f'-vcvars_ver={env["VCVARS_VER"]}',
    '&',
    'set'
    ],
    cwd=msvc_path
    ).decode('utf-8').splitlines()
    for line in lines:
    split = line.split('=')
    if len(split) != 2:
    continue
    key, value = split
    if key in env and env[key] == value:
    continue
    env[key] = value
    def build(args):
    if system() == 'Windows':
    setup_msvc()
    command = ['cmake']
    command += ['-S', '.']
    command += ['-B', 'build']
    command += ['-G', 'Ninja']
    command += define_env('CMAKE_BUILD_TYPE')
    command += define('CMAKE_SUPPRESS_REGENERATION', 'ON')
    command += define('CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY', 'ON')
    if system() == 'Windows':
    command += define(
    'CMAKE_TOOLCHAIN_FILE',
    env['VCPKG_DIR'] + '/scripts/buildsystems/vcpkg.cmake'
    )
    command += define('VCPKG_TARGET_TRIPLET', env['VCPKG_TRIPLET'])
    check_call(command)
    command = ['ninja', '-C', 'build']
    check_call(command)
    def package(args):
    command = ['ninja', '-C', 'build', 'package']
    check_call(command)
    if __name__ == '__main__':
    parser = ArgumentParser()
    subparsers = parser.add_subparsers()
    build_parser = subparsers.add_parser('build')
    build_parser.set_defaults(task=build)
    package_parser = subparsers.add_parser('package')
    package_parser.set_defaults(task=package)
    args = parser.parse_args()
    args.task(args)
    stages:
    - build
    - package
    - deploy
    - trigger
    .centos-7:
    .centos:
    tags: [ linux, docker ]
    image: git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:centos-7
    image: git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:centos
    .windows-1809:
    tags: [ windows-1809, docker ]
    image: git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:devel-windows-1809
    .windows:
    tags: [ windows, docker ]
    image: git.imp.fu-berlin.de:5000/bioroboticslab/robofish/docker:devel-windows
    before_script:
    - . $Profile.AllUsersAllHosts
    .gcc8: &gcc8
    CC: gcc-8
    CXX: g++-8
    .msvc15.9: &msvc15_9
    VCVARS_VER: '14.16'
    .release: &release
    CMAKE_BUILD_TYPE: Release
    .debug: &debug
    CMAKE_BUILD_TYPE: Debug
    .build: &build
    stage: build
    ......@@ -32,26 +24,9 @@ stages:
    paths:
    - build
    expire_in: 1 day
    script: ./.gitlab-ci.py build
    build centos-7:
    extends: .centos-7
    <<: *build
    variables:
    <<: [ *release ]
    build windows-1809:
    extends: .windows-1809
    <<: *build
    variables:
    <<: [ *msvc15_9, *release ]
    build windows-1809[debug]:
    extends: .windows-1809
    <<: *build
    variables:
    <<: [ *msvc15_9, *debug ]
    script:
    - ./ci/configure.py
    - ./ci/compile.py
    .package: &package
    stage: package
    ......@@ -59,33 +34,46 @@ build windows-1809[debug]:
    paths:
    - build/*.tar.xz
    expire_in: 1 week
    script: ./.gitlab-ci.py package
    script:
    - ./ci/package.py
    build centos:
    extends: .centos
    <<: *build
    variables:
    <<: [ *release ]
    build windows:
    extends: .windows
    <<: *build
    variables:
    <<: [ *release ]
    package centos-7:
    extends: .centos-7
    dependencies:
    - build centos-7
    <<: *package
    package windows-1809:
    extends: .windows-1809
    package centos:
    extends: .centos
    dependencies:
    - build windows-1809
    - build centos
    <<: *package
    package windows-1809[debug]:
    extends: .windows-1809
    package windows:
    extends: .windows
    dependencies:
    - build windows-1809[debug]
    - build windows
    <<: *package
    trigger robofish/robotracker:
    stage: deploy
    stage: trigger
    only:
    - master
    trigger:
    project: bioroboticslab/robofish/robotracker
    trigger biotracker/biotracker:
    stage: deploy
    stage: trigger
    only:
    - master
    trigger:
    project: bioroboticslab/biotracker/biotracker
    #! /usr/bin/env python3
    from subprocess import check_call
    if __name__ == "__main__":
    command = ["ninja", "-C", "build"]
    check_call(command)
    #! /usr/bin/env python3
    from os import environ as env
    from subprocess import check_call
    from pathlib import Path
    def define(key: str, value: str):
    return ["-D", f"{key}={value}"]
    def define_env(name: str):
    return define(name, env[name]) if name in env else []
    if __name__ == "__main__":
    command = ["cmake"]
    command += ["-S", "."]
    command += ["-B", "build"]
    command += ["-G", "Ninja"]
    command += define('CMAKE_PREFIX_PATH', Path('vendor').resolve())
    command += define_env("CMAKE_BUILD_TYPE")
    command += define_env("CMAKE_TOOLCHAIN_FILE")
    command += define("CMAKE_SUPPRESS_REGENERATION", "ON")
    command += define("CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY", "ON")
    command += define_env("VCPKG_TARGET_TRIPLET")
    check_call(command)
    #! /usr/bin/env python3
    from subprocess import check_call
    if __name__ == "__main__":
    command = ["ninja", "-C", "build", "package"]
    check_call(command)
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment