refactoring, one task to build them all

This commit is contained in:
2021-02-24 18:36:07 +01:00
parent b52e91b0e0
commit ecbf0c3187
9 changed files with 111 additions and 18475 deletions

View File

@@ -0,0 +1,59 @@
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-kernel-debian
spec:
params:
- name: pathToContext
type: string
description: |
Path to where we build our kernel, usually /usr/src/...
default: /usr/src
- name: kernel_version
type: string
- name: make_flags
type: array
- name: config
type: string
resources:
inputs:
- name: kernel-configs
type: git
steps:
- name: install-kernel-source
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
echo 'deb-src http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/src-testing.list
echo 'deb http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/testing.list
apt update -y
apt install -y $(apt-cache search linux-source-$(params.kernel_version) |awk '{print $1}' |tail -1)
- name: unpack-kernel-sources
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
cd /usr/src
for DSRC in $(ls linux-source*xz |tail -1 |awk -F '.tar' '{print $1}'); do
D=$(basename ${DSRC})
if [[ ! -d ${D} ]]; then
tar -xvf ${DSRC}*.xz
fi
done
- name: build-kernel
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
echo "res.input.ke...path: $(resources.inputs.kernel-configs.path)"
echo $PATH
cp $(resources.inputs.kernel-configs.path)/$(params.config) \
/usr/src/linux-source-${VER}/.config || exit 1
cd /usr/src/linux-source-$(params.kernel_version)
#distcc config
echo "localhost/1,cpp,lzo --randomize distcc-0.distcc,cpp,lzo distcc-1.distcc,cpp,lzo distcc-2.distcc,cpp,lzo distcc-3.distcc,cpp,lzo" >/etc/distcc/hosts
echo "ALL DISTCC HOSTS"
distcc --show-hosts
echo "/ALL DISTCC HOSTS"
distcc-pump make -j20 bindeb-pkg CC=distcc $(params.make_flags[*])
workspaces:
- name: usr-src
mountPath: /usr/src

View File

@@ -1,82 +1,23 @@
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-kernel-pine64-armbian
spec:
params:
- name: pathToContext
type: string
description: |
Path to where we build our kernel, usually /usr/src/...
default: /usr/src
resources:
inputs:
- name: kernel-configs
type: git
steps:
- name: install-kernel-source
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
echo 'deb-src http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/src-testing.list
echo 'deb http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/testing.list
# apt update -y
# apt install -y linux-source $(apt-cache search linux-source |awk '{print $1}' |tail -1)
- name: unpack-kernel-source
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
cd /usr/src
for DSRC in $(ls linux-source*xz |tail -1 |awk -F '.tar' '{print $1}'); do
D=$(basename ${DSRC})
if [[ ! -d ${D} ]]; then
tar -xvf ${DSRC}*.xz
fi
done
- name: build-kernel-pine64-armbian
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
echo "res.input.ke...path: $(resources.inputs.kernel-configs.path)"
echo $PATH
cp $(resources.inputs.kernel-configs.path)/pine64-armbian /usr/src/linux-source-5.10/.config
cd /usr/src/linux-source-5.10
#distcc config
echo "localhost/1,cpp,lzo --randomize distcc-0.distcc,cpp,lzo distcc-1.distcc,cpp,lzo distcc-2.distcc,cpp,lzo distcc-3.distcc,cpp,lzo" >/etc/distcc/hosts
echo "ALL DISTCC HOSTS"
distcc --show-hosts
echo "/ALL DISTCC HOSTS"
dpkg -L distcc-pump
#hack pythonpath issue
ln -s /usr/lib/distcc-pump/lib/python3.7/site-packages/include_server /usr/lib/distcc-pump/
distcc-pump make -j20 bindeb-pkg LOCALVERSION=-pine1 CC=distcc
- name: cleanup-workspace-post
image: alpine
command:
- rm
args:
- -rfv
- /workspace/kernel-configs*
workspaces:
- name: usr-src
mountPath: /usr/src
# - name: workspace
# mountPath: /workspace
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: build-kernel-pine64-armbian
spec:
#serviceAccountName: dockerhub-service
taskRef:
name: build-kernel-pine64-armbian
name: build-kernel-debian
params:
- name: kernel_version
value: '5.10'
- name: config
value: pine64-armbian
- name: make_flags
value:
- LOCALVERSION=-pine1
resources:
inputs:
- name: kernel-configs
resourceRef:
name: debian-kernel-build-git
- name: kernel-configs
resourceRef:
name: debian-kernel-build-git
workspaces:
- name: usr-src
persistentVolumeClaim:

View File

@@ -1,77 +1,26 @@
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-kernel-riotboard
spec:
params:
- name: pathToContext
type: string
description: |
Path to where we build our kernel, usually /usr/src/...
default: /usr/src
resources:
inputs:
- name: kernel-configs
type: git
steps:
- name: install-kernel-source
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
echo 'deb-src http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/src-testing.list
echo 'deb http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/testing.list
#apt update -y
#apt install -y $(apt-cache search linux-source |awk '{print $1}' |tail -1)
- name: unpack-kernel-source
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
[ -d /usr/src/linux-source-5.10 ] && exit 0
echo "Unpackfrom-sourceing /usr/src/linux-source*xz ... takes a while."
tar -C /usr/src -xvf /usr/src/linux-source*xz
- name: build-kernel-riotboard
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
export VER=5.10
echo "res.input.ke...path: $(resources.inputs.kernel-configs.path)"
echo $PATH
cp $(resources.inputs.kernel-configs.path)/pine64-armbain /usr/src/linux-source-${VER}/.config
cd /usr/src/linux-source-${VER}
#distcc config
echo "localhost/1,cpp,lzo --randomize distcc-0.distcc,cpp,lzo distcc-1.distcc,cpp,lzo distcc-2.distcc,cpp,lzo distcc-3.distcc,cpp,lzo" >/etc/distcc/hosts
echo "ALL DISTCC HOSTS"
distcc --show-hosts
echo "/ALL DISTCC HOSTS"
distcc-pump make ARCH=arm KBUILD_DEBARCH=armhf CROSS_COMPILE=arm-linux-gnueabihf- \
-j4 bindeb-pkg LOCALVERSION=-riot2 CC=distcc
- name: cleanup-workspace-post
image: alpine
command:
- rm
args:
- -rfv
- /workspace/kernel-configs*
workspaces:
- name: usr-src
mountPath: /usr/src
# - name: workspace
# mountPath: /workspace
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: build-kernel-riotboard
spec:
#serviceAccountName: dockerhub-service
taskRef:
name: build-kernel-riotboard
name: build-kernel-debian
params:
- name: kernel_version
value: '5.10'
- name: config
value: riotboard
- name: make_flags
value:
- LOCALVERSION=-riot2
- ARCH=arm
- KBUILD_DEBARCH=armhf
- CROSS_COMPILE=arm-linux-gnueabihf-
resources:
inputs:
- name: kernel-configs
resourceRef:
name: debian-kernel-build-git
- name: kernel-configs
resourceRef:
name: debian-kernel-build-git
workspaces:
- name: usr-src
persistentVolumeClaim:

View File

@@ -0,0 +1,25 @@
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: build-kernel-trimslice
spec:
taskRef:
name: build-kernel-debian
params:
- name: kernel_version
value: '5.10'
- name: config
value: trimslice
- name: make_flags
value:
- LOCALVERSION=-trimslice1
resources:
inputs:
- name: kernel-configs
resourceRef:
name: debian-kernel-build-git
workspaces:
- name: usr-src
persistentVolumeClaim:
claimName: tektoncd-workspaces
subPath: usr_src

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff