Skip to contentSkip to conversation

Add gitlab-CI support

PATCH Superseded Arnout Vandecappelle (Essensium/Mind) 2 participants 5 messages Feb 7, 2017 – Feb 13, 2017 Kbuild

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 .gitlab-ci.yml    | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 .gitlab-ci.yml.in |  49 ++++++++++++++
 Makefile          |   3 +
 3 files changed, 242 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 .gitlab-ci.yml.in
.gitlab-ci.yml new file +190 -0
new file mode 100644
index 0000000000..e9af0e7e05
@@ -0,0 +1,190 @@
+# 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 not packe lists, so need to update first
+    - apt-get update -qq
+    - apt-get install -y -qq build-essential locales git bzr cvs mercurial subversion libc6:i386 unzip bc 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
+
+check-gitlab-ci.yml:
+    before_script: [] # No need for all the extras here
+    script:
+        - cp .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:
+        - 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
+            }
+    artifacts:
+        when: always
+        expire_in: 2 weeks
+        paths:
+            - build.log
+            - output/images/
+            - output/build/build-time.log
+            - output/build/packages-file-list.txt
+
+acmesystems_aria_g25_128mb_defconfig: *defconfig
+acmesystems_aria_g25_256mb_defconfig: *defconfig
+acmesystems_arietta_g25_128mb_defconfig: *defconfig
+acmesystems_arietta_g25_256mb_defconfig: *defconfig
+altera_socdk_defconfig: *defconfig
+altera_sockit_defconfig: *defconfig
+arcturus_ucp1020_defconfig: *defconfig
+arm_foundationv8_defconfig: *defconfig
+arm_juno_defconfig: *defconfig
+armadeus_apf27_defconfig: *defconfig
+armadeus_apf28_defconfig: *defconfig
+armadeus_apf51_defconfig: *defconfig
+armadeus_apf9328_defconfig: *defconfig
+at91sam9260eknf_defconfig: *defconfig
+at91sam9g20dfc_defconfig: *defconfig
+at91sam9g45m10ek_defconfig: *defconfig
+at91sam9rlek_defconfig: *defconfig
+at91sam9x5ek_defconfig: *defconfig
+atmel_sama5d2_xplained_mmc_defconfig: *defconfig
+atmel_sama5d2_xplained_mmc_dev_defconfig: *defconfig
+atmel_sama5d3_xplained_defconfig: *defconfig
+atmel_sama5d3_xplained_dev_defconfig: *defconfig
+atmel_sama5d3_xplained_mmc_defconfig: *defconfig
+atmel_sama5d3_xplained_mmc_dev_defconfig: *defconfig
+atmel_sama5d3xek_defconfig: *defconfig
+atmel_sama5d4_xplained_defconfig: *defconfig
+atmel_sama5d4_xplained_dev_defconfig: *defconfig
+atmel_sama5d4_xplained_mmc_defconfig: *defconfig
+atmel_sama5d4_xplained_mmc_dev_defconfig: *defconfig
+beagleboardx15_defconfig: *defconfig
+beaglebone_defconfig: *defconfig
+beaglebone_qt5_defconfig: *defconfig
+chromebook_snow_defconfig: *defconfig
+ci20_defconfig: *defconfig
+cubieboard2_defconfig: *defconfig
+firefly_rk3288_defconfig: *defconfig
+firefly_rk3288_demo_defconfig: *defconfig
+freescale_imx28evk_defconfig: *defconfig
+freescale_imx31_3stack_defconfig: *defconfig
+freescale_imx6dlsabreauto_defconfig: *defconfig
+freescale_imx6dlsabresd_defconfig: *defconfig
+freescale_imx6qsabreauto_defconfig: *defconfig
+freescale_imx6qsabresd_defconfig: *defconfig
+freescale_imx6sololiteevk_defconfig: *defconfig
+freescale_imx6sxsabresd_defconfig: *defconfig
+freescale_imx6ulevk_defconfig: *defconfig
+freescale_imx7dsabresd_defconfig: *defconfig
+freescale_mpc8315erdb_defconfig: *defconfig
+freescale_p1010rdb_pa_defconfig: *defconfig
+galileo_defconfig: *defconfig
+gdb_bfin_bf512_defconfig: *defconfig
+grinn_chiliboard_defconfig: *defconfig
+grinn_liteboard_defconfig: *defconfig
+imx23evk_defconfig: *defconfig
+imx6q-sabresd_defconfig: *defconfig
+imx6ulpico_defconfig: *defconfig
+lego_ev3_defconfig: *defconfig
+linksprite_pcduino_defconfig: *defconfig
+minnowboard_defconfig: *defconfig
+minnowboard_max-graphical_defconfig: *defconfig
+minnowboard_max_defconfig: *defconfig
+mx25pdk_defconfig: *defconfig
+mx51evk_defconfig: *defconfig
+mx53loco_defconfig: *defconfig
+mx6cubox_defconfig: *defconfig
+mx6sx_udoo_neo_defconfig: *defconfig
+mx6udoo_defconfig: *defconfig
+nanopi_neo_defconfig: *defconfig
+nitrogen6sx_defconfig: *defconfig
+nitrogen6x_defconfig: *defconfig
+nitrogen7_defconfig: *defconfig
+odroidc2_defconfig: *defconfig
+olimex_a20_olinuxino_lime2_defconfig: *defconfig
+olimex_a20_olinuxino_lime_defconfig: *defconfig
+olimex_a20_olinuxino_lime_mali_defconfig: *defconfig
+olimex_a20_olinuxino_micro_defconfig: *defconfig
+olimex_imx233_olinuxino_defconfig: *defconfig
+openblocks_a6_defconfig: *defconfig
+orangepi_one_defconfig: *defconfig
+orangepi_pc_defconfig: *defconfig
+pandaboard_defconfig: *defconfig
+pc_x86_64_bios_defconfig: *defconfig
+pc_x86_64_efi_defconfig: *defconfig
+qemu_aarch64_virt_defconfig: *defconfig
+qemu_arm_versatile_defconfig: *defconfig
+qemu_arm_versatile_nommu_defconfig: *defconfig
+qemu_arm_vexpress_defconfig: *defconfig
+qemu_m68k_mcf5208_defconfig: *defconfig
+qemu_m68k_q800_defconfig: *defconfig
+qemu_microblazebe_mmu_defconfig: *defconfig
+qemu_microblazeel_mmu_defconfig: *defconfig
+qemu_mips32r2_malta_defconfig: *defconfig
+qemu_mips32r2el_malta_defconfig: *defconfig
+qemu_mips32r6_malta_defconfig: *defconfig
+qemu_mips32r6el_malta_defconfig: *defconfig
+qemu_mips64_malta_defconfig: *defconfig
+qemu_mips64el_malta_defconfig: *defconfig
+qemu_mips64r6_malta_defconfig: *defconfig
+qemu_mips64r6el_malta_defconfig: *defconfig
+qemu_nios2_10m50_defconfig: *defconfig
+qemu_or1k_defconfig: *defconfig
+qemu_ppc64_pseries_defconfig: *defconfig
+qemu_ppc_g3beige_defconfig: *defconfig
+qemu_ppc_mpc8544ds_defconfig: *defconfig
+qemu_ppc_virtex_ml507_defconfig: *defconfig
+qemu_sh4_r2d_defconfig: *defconfig
+qemu_sh4eb_r2d_defconfig: *defconfig
+qemu_sparc64_sun4u_defconfig: *defconfig
+qemu_sparc_ss10_defconfig: *defconfig
+qemu_x86_64_defconfig: *defconfig
+qemu_x86_defconfig: *defconfig
+qemu_xtensa_lx60_defconfig: *defconfig
+qemu_xtensa_lx60_nommu_defconfig: *defconfig
+raspberrypi0_defconfig: *defconfig
+raspberrypi2_defconfig: *defconfig
+raspberrypi3_defconfig: *defconfig
+raspberrypi_defconfig: *defconfig
+riotboard_defconfig: *defconfig
+roseapplepi_defconfig: *defconfig
+s6lx9_microboard_defconfig: *defconfig
+sheevaplug_defconfig: *defconfig
+snps_aarch64_vdk_defconfig: *defconfig
+snps_archs38_vdk_defconfig: *defconfig
+snps_archs38_zebu_defconfig: *defconfig
+snps_axs101_defconfig: *defconfig
+snps_axs103_defconfig: *defconfig
+stm32f429_disco_defconfig: *defconfig
+stm32f469_disco_defconfig: *defconfig
+telit_evk_pro3_defconfig: *defconfig
+toradex_apalis_imx6_defconfig: *defconfig
+ts4800_defconfig: *defconfig
+ts4900_defconfig: *defconfig
+ts5x00_defconfig: *defconfig
+via_imx6_vab820_defconfig: *defconfig
+wandboard_defconfig: *defconfig
+warp7_defconfig: *defconfig
+warpboard_defconfig: *defconfig
+zynq_microzed_defconfig: *defconfig
+zynq_zc706_defconfig: *defconfig
+zynq_zed_defconfig: *defconfig
+zynq_zybo_defconfig: *defconfig
.gitlab-ci.yml.in new file +49 -0

49 lines not on this page · raw message

Makefile +3 -0
index 5e4bc92c88..20b5001874 100644
@@ -1065,6 +1065,9 @@ release:
 print-version:
 	@echo $(BR2_VERSION_FULL)
 
+.gitlab-ci.yml: .gitlab-ci.yml.in configs/*_defconfig
+	(cd configs; ls -1 *_defconfig) | sed 's/$$/: *defconfig/' | cat $< - > $@
+
 include docs/manual/manual.mk
 -include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(dir)/docs/*/*.mk)
 
Signature · 1 line
2.11.0
#1 lore raw

PATCH v2 1/1 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.

---
v2: Remove the custom before-script for check-gitlab-ci.yml.
'make' is needed, so most of the rest of the before script is needed as well, so it's not so useful to avoid it.

I pushed to my private buildroot clone on gitlab and triggered a build. See https://gitlab.com/arnout/buildroot/pipelines/6435620

I think it would be useful to still apply this to master.

---
 .gitlab-ci.yml    | 189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 .gitlab-ci.yml.in |  48 ++++++++++++++
 Makefile          |   3 +
 3 files changed, 240 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 .gitlab-ci.yml.in
.gitlab-ci.yml new file +189 -0
new file mode 100644
index 0000000000..f7fa5a0972
@@ -0,0 +1,189 @@
+# 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 not packe lists, so need to update first
+    - apt-get update -qq
+    - apt-get install -y -qq build-essential locales git bzr cvs mercurial subversion libc6:i386 unzip bc 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
+
+check-gitlab-ci.yml:
+    script:
+        - cp .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:
+        - 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
+            }
+    artifacts:
+        when: always
+        expire_in: 2 weeks
+        paths:
+            - build.log
+            - output/images/
+            - output/build/build-time.log
+            - output/build/packages-file-list.txt
+
+acmesystems_aria_g25_128mb_defconfig: *defconfig
+acmesystems_aria_g25_256mb_defconfig: *defconfig
+acmesystems_arietta_g25_128mb_defconfig: *defconfig
+acmesystems_arietta_g25_256mb_defconfig: *defconfig
+altera_socdk_defconfig: *defconfig
+altera_sockit_defconfig: *defconfig
+arcturus_ucp1020_defconfig: *defconfig
+arm_foundationv8_defconfig: *defconfig
+arm_juno_defconfig: *defconfig
+armadeus_apf27_defconfig: *defconfig
+armadeus_apf28_defconfig: *defconfig
+armadeus_apf51_defconfig: *defconfig
+armadeus_apf9328_defconfig: *defconfig
+at91sam9260eknf_defconfig: *defconfig
+at91sam9g20dfc_defconfig: *defconfig
+at91sam9g45m10ek_defconfig: *defconfig
+at91sam9rlek_defconfig: *defconfig
+at91sam9x5ek_defconfig: *defconfig
+atmel_sama5d2_xplained_mmc_defconfig: *defconfig
+atmel_sama5d2_xplained_mmc_dev_defconfig: *defconfig
+atmel_sama5d3_xplained_defconfig: *defconfig
+atmel_sama5d3_xplained_dev_defconfig: *defconfig
+atmel_sama5d3_xplained_mmc_defconfig: *defconfig
+atmel_sama5d3_xplained_mmc_dev_defconfig: *defconfig
+atmel_sama5d3xek_defconfig: *defconfig
+atmel_sama5d4_xplained_defconfig: *defconfig
+atmel_sama5d4_xplained_dev_defconfig: *defconfig
+atmel_sama5d4_xplained_mmc_defconfig: *defconfig
+atmel_sama5d4_xplained_mmc_dev_defconfig: *defconfig
+beagleboardx15_defconfig: *defconfig
+beaglebone_defconfig: *defconfig
+beaglebone_qt5_defconfig: *defconfig
+chromebook_snow_defconfig: *defconfig
+ci20_defconfig: *defconfig
+cubieboard2_defconfig: *defconfig
+firefly_rk3288_defconfig: *defconfig
+firefly_rk3288_demo_defconfig: *defconfig
+freescale_imx28evk_defconfig: *defconfig
+freescale_imx31_3stack_defconfig: *defconfig
+freescale_imx6dlsabreauto_defconfig: *defconfig
+freescale_imx6dlsabresd_defconfig: *defconfig
+freescale_imx6qsabreauto_defconfig: *defconfig
+freescale_imx6qsabresd_defconfig: *defconfig
+freescale_imx6sololiteevk_defconfig: *defconfig
+freescale_imx6sxsabresd_defconfig: *defconfig
+freescale_imx6ulevk_defconfig: *defconfig
+freescale_imx7dsabresd_defconfig: *defconfig
+freescale_mpc8315erdb_defconfig: *defconfig
+freescale_p1010rdb_pa_defconfig: *defconfig
+galileo_defconfig: *defconfig
+gdb_bfin_bf512_defconfig: *defconfig
+grinn_chiliboard_defconfig: *defconfig
+grinn_liteboard_defconfig: *defconfig
+imx23evk_defconfig: *defconfig
+imx6q-sabresd_defconfig: *defconfig
+imx6ulpico_defconfig: *defconfig
+lego_ev3_defconfig: *defconfig
+linksprite_pcduino_defconfig: *defconfig
+minnowboard_defconfig: *defconfig
+minnowboard_max-graphical_defconfig: *defconfig
+minnowboard_max_defconfig: *defconfig
+mx25pdk_defconfig: *defconfig
+mx51evk_defconfig: *defconfig
+mx53loco_defconfig: *defconfig
+mx6cubox_defconfig: *defconfig
+mx6sx_udoo_neo_defconfig: *defconfig
+mx6udoo_defconfig: *defconfig
+nanopi_neo_defconfig: *defconfig
+nitrogen6sx_defconfig: *defconfig
+nitrogen6x_defconfig: *defconfig
+nitrogen7_defconfig: *defconfig
+odroidc2_defconfig: *defconfig
+olimex_a20_olinuxino_lime2_defconfig: *defconfig
+olimex_a20_olinuxino_lime_defconfig: *defconfig
+olimex_a20_olinuxino_lime_mali_defconfig: *defconfig
+olimex_a20_olinuxino_micro_defconfig: *defconfig
+olimex_imx233_olinuxino_defconfig: *defconfig
+openblocks_a6_defconfig: *defconfig
+orangepi_one_defconfig: *defconfig
+orangepi_pc_defconfig: *defconfig
+pandaboard_defconfig: *defconfig
+pc_x86_64_bios_defconfig: *defconfig
+pc_x86_64_efi_defconfig: *defconfig
+qemu_aarch64_virt_defconfig: *defconfig
+qemu_arm_versatile_defconfig: *defconfig
+qemu_arm_versatile_nommu_defconfig: *defconfig
+qemu_arm_vexpress_defconfig: *defconfig
+qemu_m68k_mcf5208_defconfig: *defconfig
+qemu_m68k_q800_defconfig: *defconfig
+qemu_microblazebe_mmu_defconfig: *defconfig
+qemu_microblazeel_mmu_defconfig: *defconfig
+qemu_mips32r2_malta_defconfig: *defconfig
+qemu_mips32r2el_malta_defconfig: *defconfig
+qemu_mips32r6_malta_defconfig: *defconfig
+qemu_mips32r6el_malta_defconfig: *defconfig
+qemu_mips64_malta_defconfig: *defconfig
+qemu_mips64el_malta_defconfig: *defconfig
+qemu_mips64r6_malta_defconfig: *defconfig
+qemu_mips64r6el_malta_defconfig: *defconfig
+qemu_nios2_10m50_defconfig: *defconfig
+qemu_or1k_defconfig: *defconfig
+qemu_ppc64_pseries_defconfig: *defconfig
+qemu_ppc_g3beige_defconfig: *defconfig
+qemu_ppc_mpc8544ds_defconfig: *defconfig
+qemu_ppc_virtex_ml507_defconfig: *defconfig
+qemu_sh4_r2d_defconfig: *defconfig
+qemu_sh4eb_r2d_defconfig: *defconfig
+qemu_sparc64_sun4u_defconfig: *defconfig
+qemu_sparc_ss10_defconfig: *defconfig
+qemu_x86_64_defconfig: *defconfig
+qemu_x86_defconfig: *defconfig
+qemu_xtensa_lx60_defconfig: *defconfig
+qemu_xtensa_lx60_nommu_defconfig: *defconfig
+raspberrypi0_defconfig: *defconfig
+raspberrypi2_defconfig: *defconfig
+raspberrypi3_defconfig: *defconfig
+raspberrypi_defconfig: *defconfig
+riotboard_defconfig: *defconfig
+roseapplepi_defconfig: *defconfig
+s6lx9_microboard_defconfig: *defconfig
+sheevaplug_defconfig: *defconfig
+snps_aarch64_vdk_defconfig: *defconfig
+snps_archs38_vdk_defconfig: *defconfig
+snps_archs38_zebu_defconfig: *defconfig
+snps_axs101_defconfig: *defconfig
+snps_axs103_defconfig: *defconfig
+stm32f429_disco_defconfig: *defconfig
+stm32f469_disco_defconfig: *defconfig
+telit_evk_pro3_defconfig: *defconfig
+toradex_apalis_imx6_defconfig: *defconfig
+ts4800_defconfig: *defconfig
+ts4900_defconfig: *defconfig
+ts5x00_defconfig: *defconfig
+via_imx6_vab820_defconfig: *defconfig
+wandboard_defconfig: *defconfig
+warp7_defconfig: *defconfig
+warpboard_defconfig: *defconfig
+zynq_microzed_defconfig: *defconfig
+zynq_zc706_defconfig: *defconfig
+zynq_zed_defconfig: *defconfig
+zynq_zybo_defconfig: *defconfig
.gitlab-ci.yml.in new file +48 -0

48 lines not on this page · raw message

Makefile +3 -0
index dcda8fe024..bf653a587c 100644
@@ -1066,6 +1066,9 @@ release:
 print-version:
 	@echo $(BR2_VERSION_FULL)
 
+.gitlab-ci.yml: .gitlab-ci.yml.in configs/*_defconfig
+	(cd configs; ls -1 *_defconfig) | sed 's/$$/: *defconfig/' | cat $< - > $@
+
 include docs/manual/manual.mk
 -include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(dir)/docs/*/*.mk)
 
Signature · 1 line
2.11.0
#2 lore raw

PATCH v2 1/1 Add gitlab-CI support

Quoted 18 lines · Arnout Vandecappelle (Essensium/Mind)

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.

Quoted 8 lines

---
v2: Remove the custom before-script for check-gitlab-ci.yml.
'make' is needed, so most of the rest of the before script is needed as well, so it's not so useful to avoid it.

I pushed to my private buildroot clone on gitlab and triggered a build. See https://gitlab.com/arnout/buildroot/pipelines/6435620

They all failed for some reason, so don't apply just yet :-)

Regards,
Arnout

Quoted 274 lines

I think it would be useful to still apply this to master.

---
 .gitlab-ci.yml    | 189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 .gitlab-ci.yml.in |  48 ++++++++++++++
 Makefile          |   3 +
 3 files changed, 240 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 .gitlab-ci.yml.in
.gitlab-ci.yml new file +189 -0
new file mode 100644
index 0000000000..f7fa5a0972
@@ -0,0 +1,189 @@
+# 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 not packe lists, so need to update first
+    - apt-get update -qq
+    - apt-get install -y -qq build-essential locales git bzr cvs mercurial subversion libc6:i386 unzip bc 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
+
+check-gitlab-ci.yml:
+    script:
+        - cp .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:
+        - 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
+            }
+    artifacts:
+        when: always
+        expire_in: 2 weeks
+        paths:
+            - build.log
+            - output/images/
+            - output/build/build-time.log
+            - output/build/packages-file-list.txt
+
+acmesystems_aria_g25_128mb_defconfig: *defconfig
+acmesystems_aria_g25_256mb_defconfig: *defconfig
+acmesystems_arietta_g25_128mb_defconfig: *defconfig
+acmesystems_arietta_g25_256mb_defconfig: *defconfig
+altera_socdk_defconfig: *defconfig
+altera_sockit_defconfig: *defconfig
+arcturus_ucp1020_defconfig: *defconfig
+arm_foundationv8_defconfig: *defconfig
+arm_juno_defconfig: *defconfig
+armadeus_apf27_defconfig: *defconfig
+armadeus_apf28_defconfig: *defconfig
+armadeus_apf51_defconfig: *defconfig
+armadeus_apf9328_defconfig: *defconfig
+at91sam9260eknf_defconfig: *defconfig
+at91sam9g20dfc_defconfig: *defconfig
+at91sam9g45m10ek_defconfig: *defconfig
+at91sam9rlek_defconfig: *defconfig
+at91sam9x5ek_defconfig: *defconfig
+atmel_sama5d2_xplained_mmc_defconfig: *defconfig
+atmel_sama5d2_xplained_mmc_dev_defconfig: *defconfig
+atmel_sama5d3_xplained_defconfig: *defconfig
+atmel_sama5d3_xplained_dev_defconfig: *defconfig
+atmel_sama5d3_xplained_mmc_defconfig: *defconfig
+atmel_sama5d3_xplained_mmc_dev_defconfig: *defconfig
+atmel_sama5d3xek_defconfig: *defconfig
+atmel_sama5d4_xplained_defconfig: *defconfig
+atmel_sama5d4_xplained_dev_defconfig: *defconfig
+atmel_sama5d4_xplained_mmc_defconfig: *defconfig
+atmel_sama5d4_xplained_mmc_dev_defconfig: *defconfig
+beagleboardx15_defconfig: *defconfig
+beaglebone_defconfig: *defconfig
+beaglebone_qt5_defconfig: *defconfig
+chromebook_snow_defconfig: *defconfig
+ci20_defconfig: *defconfig
+cubieboard2_defconfig: *defconfig
+firefly_rk3288_defconfig: *defconfig
+firefly_rk3288_demo_defconfig: *defconfig
+freescale_imx28evk_defconfig: *defconfig
+freescale_imx31_3stack_defconfig: *defconfig
+freescale_imx6dlsabreauto_defconfig: *defconfig
+freescale_imx6dlsabresd_defconfig: *defconfig
+freescale_imx6qsabreauto_defconfig: *defconfig
+freescale_imx6qsabresd_defconfig: *defconfig
+freescale_imx6sololiteevk_defconfig: *defconfig
+freescale_imx6sxsabresd_defconfig: *defconfig
+freescale_imx6ulevk_defconfig: *defconfig
+freescale_imx7dsabresd_defconfig: *defconfig
+freescale_mpc8315erdb_defconfig: *defconfig
+freescale_p1010rdb_pa_defconfig: *defconfig
+galileo_defconfig: *defconfig
+gdb_bfin_bf512_defconfig: *defconfig
+grinn_chiliboard_defconfig: *defconfig
+grinn_liteboard_defconfig: *defconfig
+imx23evk_defconfig: *defconfig
+imx6q-sabresd_defconfig: *defconfig
+imx6ulpico_defconfig: *defconfig
+lego_ev3_defconfig: *defconfig
+linksprite_pcduino_defconfig: *defconfig
+minnowboard_defconfig: *defconfig
+minnowboard_max-graphical_defconfig: *defconfig
+minnowboard_max_defconfig: *defconfig
+mx25pdk_defconfig: *defconfig
+mx51evk_defconfig: *defconfig
+mx53loco_defconfig: *defconfig
+mx6cubox_defconfig: *defconfig
+mx6sx_udoo_neo_defconfig: *defconfig
+mx6udoo_defconfig: *defconfig
+nanopi_neo_defconfig: *defconfig
+nitrogen6sx_defconfig: *defconfig
+nitrogen6x_defconfig: *defconfig
+nitrogen7_defconfig: *defconfig
+odroidc2_defconfig: *defconfig
+olimex_a20_olinuxino_lime2_defconfig: *defconfig
+olimex_a20_olinuxino_lime_defconfig: *defconfig
+olimex_a20_olinuxino_lime_mali_defconfig: *defconfig
+olimex_a20_olinuxino_micro_defconfig: *defconfig
+olimex_imx233_olinuxino_defconfig: *defconfig
+openblocks_a6_defconfig: *defconfig
+orangepi_one_defconfig: *defconfig
+orangepi_pc_defconfig: *defconfig
+pandaboard_defconfig: *defconfig
+pc_x86_64_bios_defconfig: *defconfig
+pc_x86_64_efi_defconfig: *defconfig
+qemu_aarch64_virt_defconfig: *defconfig
+qemu_arm_versatile_defconfig: *defconfig
+qemu_arm_versatile_nommu_defconfig: *defconfig
+qemu_arm_vexpress_defconfig: *defconfig
+qemu_m68k_mcf5208_defconfig: *defconfig
+qemu_m68k_q800_defconfig: *defconfig
+qemu_microblazebe_mmu_defconfig: *defconfig
+qemu_microblazeel_mmu_defconfig: *defconfig
+qemu_mips32r2_malta_defconfig: *defconfig
+qemu_mips32r2el_malta_defconfig: *defconfig
+qemu_mips32r6_malta_defconfig: *defconfig
+qemu_mips32r6el_malta_defconfig: *defconfig
+qemu_mips64_malta_defconfig: *defconfig
+qemu_mips64el_malta_defconfig: *defconfig
+qemu_mips64r6_malta_defconfig: *defconfig
+qemu_mips64r6el_malta_defconfig: *defconfig
+qemu_nios2_10m50_defconfig: *defconfig
+qemu_or1k_defconfig: *defconfig
+qemu_ppc64_pseries_defconfig: *defconfig
+qemu_ppc_g3beige_defconfig: *defconfig
+qemu_ppc_mpc8544ds_defconfig: *defconfig
+qemu_ppc_virtex_ml507_defconfig: *defconfig
+qemu_sh4_r2d_defconfig: *defconfig
+qemu_sh4eb_r2d_defconfig: *defconfig
+qemu_sparc64_sun4u_defconfig: *defconfig
+qemu_sparc_ss10_defconfig: *defconfig
+qemu_x86_64_defconfig: *defconfig
+qemu_x86_defconfig: *defconfig
+qemu_xtensa_lx60_defconfig: *defconfig
+qemu_xtensa_lx60_nommu_defconfig: *defconfig
+raspberrypi0_defconfig: *defconfig
+raspberrypi2_defconfig: *defconfig
+raspberrypi3_defconfig: *defconfig
+raspberrypi_defconfig: *defconfig
+riotboard_defconfig: *defconfig
+roseapplepi_defconfig: *defconfig
+s6lx9_microboard_defconfig: *defconfig
+sheevaplug_defconfig: *defconfig
+snps_aarch64_vdk_defconfig: *defconfig
+snps_archs38_vdk_defconfig: *defconfig
+snps_archs38_zebu_defconfig: *defconfig
+snps_axs101_defconfig: *defconfig
+snps_axs103_defconfig: *defconfig
+stm32f429_disco_defconfig: *defconfig
+stm32f469_disco_defconfig: *defconfig
+telit_evk_pro3_defconfig: *defconfig
+toradex_apalis_imx6_defconfig: *defconfig
+ts4800_defconfig: *defconfig
+ts4900_defconfig: *defconfig
+ts5x00_defconfig: *defconfig
+via_imx6_vab820_defconfig: *defconfig
+wandboard_defconfig: *defconfig
+warp7_defconfig: *defconfig
+warpboard_defconfig: *defconfig
+zynq_microzed_defconfig: *defconfig
+zynq_zc706_defconfig: *defconfig
+zynq_zed_defconfig: *defconfig
+zynq_zybo_defconfig: *defconfig
.gitlab-ci.yml.in new file +48 -0
new file mode 100644
index 0000000000..a8e91c1ca4
@@ -0,0 +1,48 @@
+# 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 not packe lists, so need to update first
+    - apt-get update -qq
+    - apt-get install -y -qq build-essential locales git bzr cvs mercurial subversion libc6:i386 unzip bc 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
+
+check-gitlab-ci.yml:
+    script:
+        - cp .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:
+        - 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
+            }
+    artifacts:
+        when: always
+        expire_in: 2 weeks
+        paths:
+            - build.log
+            - output/images/
+            - output/build/build-time.log
+            - output/build/packages-file-list.txt
+
Makefile +3 -0
index dcda8fe024..bf653a587c 100644
@@ -1066,6 +1066,9 @@ release:
 print-version:
 	@echo $(BR2_VERSION_FULL)
 
+.gitlab-ci.yml: .gitlab-ci.yml.in configs/*_defconfig
+	(cd configs; ls -1 *_defconfig) | sed 's/$$/: *defconfig/' | cat $< - > $@
+
 include docs/manual/manual.mk
 -include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(dir)/docs/*/*.mk)
 
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH v2 1/1 Add gitlab-CI support

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello Arnout,

I did something similar for our buildroot project. See my comments below.

Quoted 43 lines · Arnout Vandecappelle (Essensium/Mind)

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.

---
v2: Remove the custom before-script for check-gitlab-ci.yml.
'make' is needed, so most of the rest of the before script is needed as well, so it's not so useful to avoid it.

I pushed to my private buildroot clone on gitlab and triggered a build. See https://gitlab.com/arnout/buildroot/pipelines/6435620

I think it would be useful to still apply this to master.

---
 .gitlab-ci.yml    | 189 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 .gitlab-ci.yml.in |  48 ++++++++++++++
 Makefile          |   3 +
 3 files changed, 240 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 .gitlab-ci.yml.in
.gitlab-ci.yml new file +1 -0
new file mode 100644
index 0000000000..f7fa5a0972
@@ -0,0 +1,189 @@
+# Configuration for Gitlab-CI.

.gitlab-ci.yml line 11

Quoted 10 lines
.gitlab-ci.yml new file +10 -0
+# 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 not packe lists, so need to update first

There is a typo here. Probably you meant "no package lists".

.gitlab-ci.yml line 13

Quoted 2 lines
.gitlab-ci.yml new file +2 -0
+    - apt-get update -qq
+    - apt-get install -y -qq build-essential locales git bzr cvs mercurial subversion libc6:i386 unzip bc wget cpio

You might want to explicitly add the ca-certificates and file packages here. They are implicitly installed as recommends of some of the version control systems, but are not preinstalled or part of build-essential.

Also maybe you want to add --no-install-recommends to keep down the install time. Then maybe a few more packages need to be added (i.e. rsync)

Quoted 71 lines
.gitlab-ci.yml new file +35 -0
+    # 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
+
+check-gitlab-ci.yml:
+    script:
+        - cp .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:
+        - 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
+            }
+    artifacts:
+        when: always
+        expire_in: 2 weeks
+        paths:
+            - build.log
+            - output/images/
+            - output/build/build-time.log
+            - output/build/packages-file-list.txt
+
[...]
.gitlab-ci.yml.in new file +29 -0
new file mode 100644
index 0000000000..a8e91c1ca4
@@ -0,0 +1,48 @@
+# 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 not packe lists, so need to update first
+    - apt-get update -qq
+    - apt-get install -y -qq build-essential locales git bzr cvs mercurial subversion libc6:i386 unzip bc 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
+
+check-gitlab-ci.yml:
+    script:
+        - cp .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

.gitlab-ci.yml.in line 39

Quoted 10 lines
.gitlab-ci.yml.in new file +10 -0
+    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
+            }

I wondered why you used process substitution here, instead of something like this (Which I find easier to understand, but that might just be me.):

make 2>&1 | tee build.log | grep '>>>' || {echo [...]}

But then we'd have to set -o pipefail, is that the reason for not using a pipeline, or am I missing something else?

Quoted 15 lines
.gitlab-ci.yml.in new file +9 -0
+    artifacts:
+        when: always
+        expire_in: 2 weeks
+        paths:
+            - build.log
+            - output/images/
+            - output/build/build-time.log
+            - output/build/packages-file-list.txt
+
Makefile +0 -0
index dcda8fe024..bf653a587c 100644

Makefile release: · line 1074

Quoted 9 lines
Makefile +3 -0
@@ -1066,6 +1066,9 @@ release:
 print-version:
 	@echo $(BR2_VERSION_FULL)
 
+.gitlab-ci.yml: .gitlab-ci.yml.in configs/*_defconfig
+	(cd configs; ls -1 *_defconfig) | sed 's/$$/: *defconfig/' | cat $< - > $@
+
 include docs/manual/manual.mk
 -include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(dir)/docs/*/*.mk)
 

Best regards,
Marcus

#4 lore raw

PATCH v2 1/1 Add gitlab-CI support

Hi Marcus,

Thank you for your feedback! I'll take it into account for v3.

Quoted 3 lines · Marcus Hoffmann

Hello Arnout,

I did something similar for our buildroot project. See my comments below.

If you have any more suggestions, I welcome them.

Quoted 2 lines · Arnout Vandecappelle (Essensium/Mind)

[snip]

Quoted 10 lines

.gitlab-ci.yml line 39

Quoted 9 lines
.gitlab-ci.yml new file +9 -0
+        - 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
+            }
Quoted 7 lines

I wondered why you used process substitution here, instead of something like this (Which I find easier to understand, but that might just be me.):

make 2>&1 | tee build.log | grep '>>>' || {echo [...]}

But then we'd have to set -o pipefail, is that the reason for not using a pipeline, or am I missing something else?

I didn't think about it too hard, I just copied it from Thomas Petazzoni's
Travis script [1]. But now you mention it, it's probably because of the pipefail.

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF