aboutsummaryrefslogtreecommitdiff
path: root/rpb-centos-installer-staging.yaml
blob: cd1c99a14de9b1399c202585d4edc8009db5b585 (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
- job:
    name: 96boards-reference-centos-installer-staging
    project-type: freestyle
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
                - job-workspace
            linaro:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
    disabled: false
    node: docker-centos7-aarch64
    display-name: 'Reference Platform - CentOS Installer (staging)'
    wrappers:
        - timestamps
        - build-name:
            name: '#${BUILD_NUMBER}'
    builders:
        - linaro-publish-token
        - shell: |
            #!/bin/bash

            set -ex

            # Make sure the base image is updated to 7.3.1611
            sudo sed -i 's/\$releasever/7.3.1611/g' /etc/yum.repos.d/CentOS-Base.repo

            sudo yum update -y
            sudo yum install -y cpio lorax python-requests wget xz

            # Call lorax to create the netinstall image
            sudo rm -rf netinstall
            sudo lorax '--product=CentOS Linux' --version=7 --release=7.3.1611 \
              --source=http://mirror.centos.org/altarch/7/os/aarch64/ \
              --source=http://repo.linaro.org/rpm/linaro-overlay/centos-7/repo/ \
              --source=http://repo.linaro.org/rpm/linaro-staging/centos-7/repo/ \
              --source=http://obs.linaro.org/ERP-RPM:/17.08:/staging/ERP-17.08/ \
              --isfinal --nomacboot --noupgrade --buildarch=aarch64 '--volid=CentOS 7 aarch64' netinstall/

            # Modify initrd to include a default kickstart (that includes the external repository)
            cd netinstall/images/pxeboot/
            sudo mkdir initrd; cd initrd
            sudo sh -c 'xzcat ../initrd.img | cpio -d -i -m'
            cat > /tmp/ks.cfg << EOF
            repo --name="linaro-overlay" --baseurl=http://repo.linaro.org/rpm/linaro-overlay/centos-7/repo/
            repo --name="linaro-staging" --baseurl=http://repo.linaro.org/rpm/linaro-staging/centos-7/repo/
            repo --name="ERP-RPM:17.08:staging" --baseurl=http://obs.linaro.org/ERP-RPM:/17.08:/staging/ERP-17.08/
            EOF
            sudo cp /tmp/ks.cfg ks.cfg
            sudo sh -c 'find . | cpio -o -H newc | xz --check=crc32 --lzma2=dict=512KiB > ../initrd.img'
            cd ..; sudo rm -rf initrd
            cd ../../..

            # Final preparation for publishing
            mkdir out
            cp -rf lorax.log netinstall/.discinfo netinstall/.treeinfo netinstall/EFI netinstall/images netinstall/LiveOS out/

            # Create MD5SUMS file
            (cd out && find -type f -exec md5sum {} \; | sed "s/  \.\//  /g" > MD5SUMS.txt)

            # Build information
            KERNEL_VERSION=`cat out/images/pxeboot/vmlinuz | gzip -d - | grep -a "Linux version"`
            cat > out/HEADER.textile << EOF

            h4. Reference Platform - CentOS Installer (staging)

            CentOS Installer (7) produced with the Reference Platform Kernel package.

            Check "https://github.com/Linaro/documentation/blob/master/Reference-Platform/EECommon/Install-CentOS-7.md":https://github.com/Linaro/documentation/blob/master/Reference-Platform/EECommon/Install-CentOS-7.md for the install instructions.

            Build Description:
            * Build URL: "$BUILD_URL":$BUILD_URL
            * Kernel: $KERNEL_VERSION
            EOF

            # Publish
            test -d ${HOME}/bin || mkdir ${HOME}/bin
            wget -q https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py
            time python ${HOME}/bin/linaro-cp.py \
              --server ${PUBLISH_SERVER} \
              --link-latest \
              out 96boards/reference-platform/components/centos-installer-staging/${BUILD_NUMBER}/
    publishers:
        - email:
            recipients: 'fathi.boudra@linaro.org riku.voipio@linaro.org'