diff --git a/.drone.yml b/.drone.yml index 511ed17..9781275 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,17 +15,54 @@ steps: environment: DEBIAN_FRONTEND: noninteractive commands: - - apt-get update - - apt-get install -y sed make binutils build-essential diffutils gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc findutils wget + - apt-get update + - apt-get install -y sed make binutils build-essential diffutils gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc findutils wget + +- name: patch defconfig + environment: + CONFIG_NAME: "rpi2_defconfig" + commands: + - .drone/patch_defconfig.sh - name: configure commands: - ./buildroot_make.sh rpi2_defconfig +- name: restore cache + image: plugins/s3-cache + settings: + pull: true + endpoint: https://s3.ap-northeast-1.wasabisys.com + access_key: + from_secret: cache_ak + secret_key: + from_secret: cache_aks + restore: true + filename: "cache_rpi2" + mount: + - ./dl + - ./ccache + - name: build commands: - ./buildroot_make.sh -j4 +- name: save cache + image: plugins/s3-cache + settings: + pull: true + endpoint: https://s3.ap-northeast-1.wasabisys.com + access_key: + from_secret: cache_ak + secret_key: + from_secret: cache_aks + rebuild: true + flush: true + filename: "cache_rpi2" + mount: + - ./dl + - ./ccache + --- kind: pipeline type: vm @@ -46,10 +83,47 @@ steps: - apt-get update - apt-get install -y sed make binutils build-essential diffutils gcc g++ bash patch gzip bzip2 perl tar cpio unzip rsync file bc findutils wget +- name: patch defconfig + environment: + CONFIG_NAME: "tlt113_minievm_defconfig" + commands: + - .drone/patch_defconfig.sh + - name: configure commands: - ./buildroot_make.sh tlt113_minievm_defconfig +- name: restore cache + image: plugins/s3-cache + settings: + pull: true + endpoint: https://s3.ap-northeast-1.wasabisys.com/imi415-ci-artifacts + access_key: + from_secret: cache_ak + secret_key: + from_secret: cache_aks + restore: true + filename: "cache_rpi2" + mount: + - ./dl + - ./ccache + - name: build commands: - ./buildroot_make.sh -j4 + +- name: save cache + image: plugins/s3-cache + settings: + pull: true + endpoint: https://s3.ap-northeast-1.wasabisys.com/imi415-ci-artifacts + access_key: + from_secret: cache_ak + secret_key: + from_secret: cache_aks + rebuild: true + flush: true + filename: "cache_rpi2" + mount: + - ./dl + - ./ccache diff --git a/.drone/patch_defconfig.sh b/.drone/patch_defconfig.sh new file mode 100755 index 0000000..2f4f100 --- /dev/null +++ b/.drone/patch_defconfig.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +SOURCE_PATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/../" &> /dev/null && pwd ) +CONFIG_PATH=${SOURCE_PATH}/external_tree/configs/${CONFIG_NAME} + +echo "Patching config file: ${CONFIG_PATH}" + +if [ ! -f ${CONFIG_PATH} ]; then + echo "Config file not found" + exit -1 +fi + +CCACHE_PATH="${SOURCE_PATH}/ccache" +DL_PATH="${SOURCE_PATH}/dl" + +cat - << CFG >> ${CONFIG_PATH} +BR2_DL_DIR="${DL_PATH}" +BR2_CCACHE=y +BR2_CCACHE_DIR="${CCACHE_PATH}" +BR2_CCACHE_INITIAL_SETUP="-M 50G" +CFG +