aboutsummaryrefslogtreecommitdiff
path: root/trigger-private-lt-qcom-ci-job-configs.yaml
blob: ad75b2e45dbfabbd71b656c87469148e322d8c9b (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
- job:
    name: trigger-private-lt-qcom-ci-job-configs
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-discover
            vishal.bhoj@linaro.org:
                - job-build
                - job-read
                - job-extended-read
                - job-configure
                - job-cancel
            linaro-landing-team-qualcomm-personnel:
                - job-read
                - job-extended-read
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 200
    disabled: false
    node: master
    display-name: 'CI job configs deployment for Qualcomm LT Private Jobs'
    triggers:
        - gerrit:
            server-name: 'dev-private-review.linaro.org'
            trigger-on:
                - change-merged-event
            projects:
                - project-compare-type: 'PLAIN'
                  project-pattern: 'landing-teams/working/qualcomm/ci/job/configs'
                  branches:
                    - branch-pattern: 'master'
    wrappers:
        - timestamps
        - credentials-binding:
            - text:
                credential-id: JJB_USER
                variable: JJB_USER
        - credentials-binding:
            - text:
                credential-id: JJB_PASSWORD
                variable: JJB_PASSWORD
        - credentials-binding:
            - text:
                credential-id: LAVA_USER
                variable: LAVA_USER
        - credentials-binding:
            - text:
                credential-id: LAVA_TOKEN
                variable: LAVA_TOKEN
        - credentials-binding:
            - text:
                credential-id: LT_QCOM_KEY
                variable: LT_QCOM_KEY
        - credentials-binding:
            - text:
                credential-id: AUTH_TOKEN
                variable: AUTH_TOKEN
        - ssh-agent-credentials:
                users:
                    - 'LT_QUALCOMM_PRIVATE_KEY_SSH'
    builders:
        - shell: |
            #!/bin/bash -e
            echo "#${BUILD_NUMBER}-${GERRIT_PATCHSET_REVISION:0:8}" > ${WORKSPACE}/version.txt
        - build-name-setter:
            name: 'version.txt'
            file: true
        - shell: |
            #!/bin/bash

            set -ex

            echo ""
            echo "########################################################################"
            echo "    Gerrit Environment"
            env |grep '^GERRIT'
            echo "########################################################################"

            git config --global user.name "Linaro CI"
            git config --global user.email "ci_notify@linaro.org"

            # Add SSH server signatures to known_hosts list.
            bash -c "ssh-keyscan dev-private-git.linaro.org >  ${HOME}/.ssh/known_hosts"
            bash -c "ssh-keyscan dev-private-review.linaro.org >>  ${HOME}/.ssh/known_hosts"
            bash -c "ssh-keyscan  -t rsa -p 29418 dev-private-review.linaro.org >> \
               ${HOME}/.ssh/known_hosts"

            rm -rf ${WORKSPACE}/*

            git clone -b ${GERRIT_BRANCH} --depth 2 ssh://git@dev-private-review.linaro.org/${GERRIT_PROJECT}
            cd *
            git fetch ssh://git@dev-private-review.linaro.org/${GERRIT_PROJECT} ${GERRIT_REFSPEC}
            git checkout -q FETCH_HEAD

            export GIT_PREVIOUS_COMMIT=$(git rev-parse HEAD~1)
            export GIT_COMMIT=${GERRIT_PATCHSET_REVISION}
            jenkins-jobs --version
            wget -q https://git.linaro.org/ci/job/configs.git/plain/run-jjb.py -O run-jjb.py
            python run-jjb.py
    publishers:
        - email:
            recipients: 'nicolas.dechesne@linaro.org luis.machado@linaro.org'