summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuriy Erofeev <yuiry.erofeev@toradex.com>2019-08-06 16:06:09 +0000
committeryuiry.erofeev <yuiry.erofeev@toradex.com>2019-08-30 05:22:19 -0400
commit6bd85ffba9f2297627b12ca9ace709ee403b5800 (patch)
treee4b741e8ce6b0dc4d5704907b296560af0b92fbf
parentd899927728beca8357a5b4120b690cb3c1d80844 (diff)
Initial commit of the CI/CD pipeline
-rw-r--r--.gitlab-ci.yml89
-rw-r--r--Dockerfile22
2 files changed, 111 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000000..6a8826b5166a
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,89 @@
+image: $CI_IMAGE
+
+variables:
+# uncomment for the pipeline debug purpose
+# CI_DEBUG_TRACE: "true"
+ CI_IMAGE: gitlab.int.toradex.com:4567/yuiry.erofeev/linux-toradex/ci-kernel-builder
+ DOCKER_HOST: tcp://docker:2375
+ DOCKER_DRIVER: overlay2
+ DOCKER_TLS_CERTDIR: ""
+
+# Kernel Configuration Section
+# Supplementary Tool Section
+ # Artifacts configuring section
+ KERNEL_CONFIG_BUILD_LOG_FILE_NAME: build_config.log
+ KERNEL_BUILD_LOG_FILE_NAME: build.log
+ KERNEL_CONFIGURATION_FILE: .config
+ # Defining temporary build folder to do outside of the box builds. Absolute path
+ TEMP_BUILD_FOLDER: /builds/temp-builds
+stages:
+ - build-product
+
+.build_base:
+ stage: build-product
+ variables:
+ GIT_STRATEGY: fetch
+# To run just on merge request
+# only:
+# - merge_requests
+# when: manual
+ script: |
+ #set -o xtrace
+ cd $CI_PROJECT_DIR
+ echo -e "Compiler used to build binaries is"
+ which ${CROSS_COMPILE}gcc
+ ${CROSS_COMPILE}gcc --version
+ echo -e "Arch is \e[36m$ARCH\e[39m"
+ mkdir -p $TEMP_BUILD_FOLDER
+ make O=$TEMP_BUILD_FOLDER $DEFCONFIG | tee $KERNEL_CONFIG_BUILD_LOG_FILE_NAME
+ make O=$TEMP_BUILD_FOLDER -j3 2>&1 | tee $KERNEL_BUILD_LOG_FILE_NAME
+ # Artifacts should be uploaded from the CI folder, so we should to copy it
+ cp $TEMP_BUILD_FOLDER/$KERNEL_CONFIGURATION_FILE $CI_PROJECT_DIR
+ #find / -name ".config" -print
+ artifacts:
+ when: always
+ name: "$CI_COMMIT_REF_NAME"
+ paths:
+ - $KERNEL_CONFIG_BUILD_LOG_FILE_NAME
+ - $KERNEL_BUILD_LOG_FILE_NAME
+ - $KERNEL_CONFIGURATION_FILE
+# To allow single steps failing without failing the whole pipeline
+ # allow_failure: true
+ after_script:
+ - set -o xtrace
+ - rm -rf $TEMP_BUILD_FOLDER
+
+# If you need additional products build just copy-paste build_******_product section with new config name
+build_apalis_product_imx6 :
+ extends: .build_base
+ variables:
+ DEFCONFIG: apalis_imx6_defconfig
+ stage: build-product
+
+
+build_apalis_product_imx6_android :
+ extends: .build_base
+ variables:
+ DEFCONFIG: apalis_imx6_android_defconfig
+# This only stage is set to manual mode because android config is not in the scope of the overall build
+ when: manual
+ stage: build-product
+
+
+build_colibri_product_imx6 :
+ extends: .build_base
+ variables:
+ DEFCONFIG: colibri_imx6_defconfig
+ stage: build-product
+
+build_colibri_product_imx7 :
+ extends: .build_base
+ variables:
+ DEFCONFIG: colibri_imx7_defconfig
+ stage: build-product
+
+build_colibri_product_imx6ull :
+ extends: .build_base
+ variables:
+ DEFCONFIG: colibri-imx6ull_defconfig
+ stage: build-product
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000000..980f9522208d
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,22 @@
+FROM debian:buster
+ENV PATH="/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/:$PATH" \
+ ARCH="arm" \
+ CROSS_COMPILE="arm-linux-gnueabihf-"
+RUN \
+ rm -rf /var/lib/apt/lists/* &&\
+ apt-get clean -y &&\
+ apt-get update -y &&\
+ apt-get install -y \
+ bc \
+ build-essential \
+ git \
+ libncurses5-dev \
+ lzop \
+ perl\
+ wget \
+ u-boot-tools \
+ tar
+# apt-get install -y uboot-mkimage \
+RUN wget -c https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz &&\
+ tar xvf gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz
+CMD ["/bin/bash"] \ No newline at end of file