aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml.in
diff options
context:
space:
mode:
authorGravatar Arnout Vandecappelle <arnout@mind.be>2017-02-14 00:23:03 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-03-05 22:21:50 +0100
commit4f863d77a666f976a1096c9c9f979047d9995f94 (patch)
tree5d9847d55ce07a45a82d597ba4dd0d0837101774 /.gitlab-ci.yml.in
parent6a9c6311f8fd4464b5555773589f587338f694a0 (diff)
downloadbuildroot-4f863d77a666f976a1096c9c9f979047d9995f94.tar.gz
buildroot-4f863d77a666f976a1096c9c9f979047d9995f94.tar.bz2
Add gitlab-CI support
The buildroot repository is now mirrored on https://gitlab.com/buildroot.org/buildroot so we can use Gitlab-CI to test Buildroot. Gitlab-CI is controlled by a .gitlab-ci.yml file that exists in the repository. For now, the only test is building all defconfigs (inspired on https://travis-ci.org/buildroot/buildroot-defconfig-testing/). Since all the defconfigs have to be specified in the .gitlab-ci.yml file, we generate the file based on .gitlab-ci.yml.in. The generated .gitlab-ci.yml file has to be committed into the repository, though, otherwise Gitlab-CI doesn't see it. So there is also a test to verify that .gitlab-ci.yml is up-to-date. Building all the defconfigs takes a long time. Gitlab-CI will do that every time it pulls from git.buildroot.org, which is once per hour. That is way too often. Therefore, the defconfigs are not built on pull, but only on explicit trigger through the API or when a tag is added. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: - fix typo not -> no - add LC_ALL=C when calling 'ls -1' to get a predictable order of the defconfigs - regenerate .gitlab-ci.yml.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to '.gitlab-ci.yml.in')
-rw-r--r--.gitlab-ci.yml.in52
1 files changed, 52 insertions, 0 deletions
diff --git a/.gitlab-ci.yml.in b/.gitlab-ci.yml.in
new file mode 100644
index 0000000000..b4a6a3fb28
--- /dev/null
+++ b/.gitlab-ci.yml.in
@@ -0,0 +1,52 @@
+# Configuration for Gitlab-CI.
+# Builds appear on https://gitlab.com/buildroot.org/buildroot/pipelines
+# The .gitlab-ci.yml file is generated from .gitlab-ci.yml.in.
+# It needs to be regenerated every time a defconfig is added, using
+# "make .gitlab-ci.yml".
+
+image: debian:stable
+
+before_script:
+ - dpkg --add-architecture i386
+ # The container has no package lists, so need to update first
+ - apt-get update -qq
+ - apt-get install -y -qq --no-install-recommends
+ build-essential locales bc ca-certificates file rsync
+ git bzr cvs mercurial subversion libc6:i386 unzip wget cpio
+ # To be able to generate a toolchain with locales, enable one UTF-8 locale
+ - sed -i 's/# \(en_US.UTF-8\)/\1/' /etc/locale.gen
+ - /usr/sbin/locale-gen
+
+.defconfig_script: &defconfig_script
+ - echo 'Configure Buildroot'
+ - make ${CI_BUILD_NAME}
+ - echo 'Build buildroot'
+ - |
+ make > >(tee build.log |grep '>>>') 2>&1 || {
+ echo 'Failed build last output'
+ tail -200 build.log
+ exit 1
+ }
+
+check-gitlab-ci.yml:
+ script:
+ - mv .gitlab-ci.yml .gitlab-ci.yml.orig
+ - make .gitlab-ci.yml
+ - diff -u .gitlab-ci.yml.orig .gitlab-ci.yml
+
+.defconfig: &defconfig
+ # Running the defconfigs for every push is too much, so limit to
+ # explicit triggers through the API.
+ only:
+ - triggers
+ - tags
+ script: *defconfig_script
+ artifacts:
+ when: always
+ expire_in: 2 weeks
+ paths:
+ - build.log
+ - output/images/
+ - output/build/build-time.log
+ - output/build/packages-file-list.txt
+