Added Cache.
continuous-integration/drone/push Build was killed Details

Signed-off-by: Yilin Sun <imi415@imi.moe>
This commit is contained in:
Yilin Sun 2024-04-17 14:38:00 +08:00
parent bad7367dcf
commit 3234c7a269
Signed by: imi415
GPG Key ID: DB982239424FF8AC
2 changed files with 98 additions and 2 deletions

View File

@ -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

22
.drone/patch_defconfig.sh Executable file
View File

@ -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