aboutsummaryrefslogtreecommitdiff
path: root/tcwg-llvm-build-christophe.yaml
blob: 5fa31999a045f2aea3cc4ef30b14193931086419 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
- job:
    name: tcwg-llvm-build-christophe
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            linaro:
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 10
            num-to-keep: 10
        - heavy-job:
            weight: 3
    parameters:
        - string:
            name: build_container_tag
            default: 'xenial'
            description: 'Type of image to use in the container: trusty, xenial.'
        - string:
            name: weight
            default: '3'
            description: 'Container weight, controls limits on memory, pids, cpu.'
    disabled: true
    node: tcwg-x86_64-build
    retry-count: 3
    concurrent: true
    display-name: 'TCWG DEAD ZZZ LLVM Build Christophe'
    scm:
        - git:
            url: http://git.linaro.org/toolchain/jenkins-scripts.git
            refspec: +refs/heads/master:refs/remotes/origin/master
            name: origin
            branches:
                - refs/heads/master
            skip-tag: true
            shallow-clone: true
            wipe-workspace: true
    execution-strategy:
        sequential: false
    wrappers:
        - timeout:
            timeout: 300
        - timestamps
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
        - build-name:
            name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}'
    builders:
        - shell: |
            #!/bin/bash
            set -ex

            # Start build container
            builder=$(${WORKSPACE}/nodename2hostname.sh $NODE_NAME)
            builder_arch=amd64
            bash ${WORKSPACE}/start-container-docker.sh --arch ${builder_arch} --distro ${build_container_tag} --session-host ${builder} --weight ${weight} > build-container.sh

            # Define CONTAINER, CONTAINER_CLEANUP, session_host and session_port
            . ./build-container.sh
            BUILD_CONTAINER="${CONTAINER}"
            BUILD_CONTAINER_CLEANUP="${CONTAINER_CLEANUP}"

            # Make sure to cleanup build container if something goes
            # wrong when preparing the test environment
            if [ x"${BUILD_CONTAINER_CLEANUP}" != x ]; then
                CONTAINERS_CLEANUP="${BUILD_CONTAINER_CLEANUP}"
                trap "${CONTAINERS_CLEANUP}" EXIT
            fi

            # Setup job parameters and run
            linkjobs=$((weight*7))
            ${BUILD_CONTAINER} "cd ${WORKSPACE} && bash -x ${WORKSPACE}/tcwg-llvm-build.sh \
                --workspace=${WORKSPACE} \
                --buildid=${BUILD_ID} \
                --linkjobs=${linkjobs}"