94 lines
2.5 KiB
YAML
94 lines
2.5 KiB
YAML
apiVersion: tekton.dev/v1alpha1
|
|
kind: PipelineResource
|
|
metadata:
|
|
name: openwrt-configs-git
|
|
spec:
|
|
type: git
|
|
params:
|
|
- name: revision
|
|
value: master
|
|
- name: url
|
|
value: http://git-ui.lan/chaos/openwrt-configs.git
|
|
---
|
|
apiVersion: tekton.dev/v1beta1
|
|
kind: Task
|
|
metadata:
|
|
name: build-openwrt
|
|
spec:
|
|
params:
|
|
- name: make_flags
|
|
type: string
|
|
default: ""
|
|
- name: config
|
|
type: string
|
|
- name: version
|
|
type: string
|
|
default: ""
|
|
resources:
|
|
inputs:
|
|
- name: openwrt-configs
|
|
type: git
|
|
steps:
|
|
- name: openwrt-get
|
|
#image: cr.lan/debian-stable-build-essential
|
|
image: cr.lan/debian-stable-openwrt-build
|
|
script: |
|
|
#!/usr/bin/env bash
|
|
if [ ! -d /usr/src/openwrt ]; then
|
|
git clone https://github.com/openwrt/openwrt.git /usr/src/openwrt
|
|
fi
|
|
cd /usr/src/openwrt
|
|
echo "O_VERS: $(params.version)"
|
|
git branch -l
|
|
git checkout $(params.version) || exit 1
|
|
git pull
|
|
- name: build-openwrt
|
|
#image: cr.lan/debian-stable-build-essential
|
|
image: cr.lan/debian-stable-openwrt-build
|
|
script: |
|
|
#!/usr/bin/env bash
|
|
|
|
echo $PATH
|
|
echo "res.input.ke...path: $(resources.inputs.openwrt-configs.path)"
|
|
ls -altr /usr/src/
|
|
#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"
|
|
cp -v $(resources.inputs.openwrt-configs.path)/$(params.config) \
|
|
/usr/src/openwrt/.config || exit 1
|
|
cd /usr/src/openwrt
|
|
ls -la .
|
|
./scripts/feeds update -a
|
|
./scripts/feeds install -a
|
|
# build env does not like to be run as root....
|
|
export FORCE_UNSAFE_CONFIGURE=1
|
|
#distcc-pump make -j20 download world CC=distcc $(params.make_flags)
|
|
make -j6 download world $(params.make_flags)
|
|
workspaces:
|
|
- name: usr-src
|
|
mountPath: /usr/src
|
|
---
|
|
apiVersion: tekton.dev/v1beta1
|
|
kind: TaskRun
|
|
metadata:
|
|
name: openwrt-oxnas820
|
|
spec:
|
|
taskRef:
|
|
name: build-openwrt
|
|
params:
|
|
- name: config
|
|
value: dumont.wks-ATHWIFI
|
|
- name: version
|
|
value: openwrt-19.07
|
|
resources:
|
|
inputs:
|
|
- name: openwrt-configs
|
|
resourceRef:
|
|
name: openwrt-configs-git
|
|
workspaces:
|
|
- name: usr-src
|
|
persistentVolumeClaim:
|
|
claimName: tektoncd-workspaces
|
|
subPath: usr_src |