Mentions légales du service

Skip to content
Snippets Groups Projects
Commit fd2fb1a9 authored by SHERMAN David's avatar SHERMAN David
Browse files

Compile OpenWRT packages and firmware in CI/CD

parent c0d74ca0
Branches main
No related tags found
No related merge requests found
Pipeline #945233 passed
default:
tags:
- openshift
- small
.prepare_variables_script: &prepare_variables_script
- echo WORK=${WORK:=${HOME}}
- echo FEED=${FEED:=${PWD}}
before_script:
- *prepare_variables_script
variables:
BUILDER_REPO: registry.gitlab.inria.fr/midi-bidouille/openshift
PACKAGE_REGISTRY: $CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic
CUSTOM_PACKAGES: >-
helloworld
BASE_PACKAGES: >-
luci-ssl
stages:
- packages
- firmware
- upload
.build_target: &build_target
image: $BUILDER_REPO/sdk-feeds:${TARGET}
before_script: *prepare_variables_script
script:
- echo src-link custom $FEED >> $WORK/feeds.conf.default
- time $WORK/scripts/feeds update custom
- time $WORK/scripts/feeds install -a
- cp $FEED/config.${TARGET%-openwrt*} $WORK/.config
- for p in "$CUSTOM_PACKAGES"; do echo CONFIG_PACKAGE_${p}=m >> $WORK/.config; done
- make -C $WORK defconfig
- make -C $WORK -j10 $(for p in "$CUSTOM_PACKAGES"; do echo package/$p/compile; done)
- $WORK/staging_dir/host/bin/usign -G -s $WORK/key-build -p $WORK/key-build.pub -c 'Custom build key'
- make -C $WORK package/index
- mkdir -p $FEED/custom-packages
- find $WORK/bin/packages/*/custom -name \*.ipk | xargs -r -I % rsync -av % $FEED/custom-packages
artifacts:
paths:
- custom-packages
build packages:
stage: packages
variables:
TARGET: ${TARGET}
<<: *build_target
parallel:
matrix:
- TARGET:
- bcm27xx-bcm2710-openwrt-23.05
# - bcm27xx-bcm2711-openwrt-23.05
build firmware:
stage: firmware
dependencies:
- build packages
variables:
TARGET: ${TARGET}
SUFFIX: ""
image: $BUILDER_REPO/imagebuilder:${TARGET}
script:
- mkdir -p $WORK/packages $WORK/files/etc
- rsync -av $FEED/custom-packages/ $WORK/packages
- rsync -a $FEED/files/ $WORK/files || echo No custom files, skipping
- make -C $WORK image PROFILE=$PROFILE FILES=files PACKAGES="$BASE_PACKAGES" -j10
- mkdir -p $FEED/custom-firmware
- find $WORK/bin -name '*-sysupgrade.*' | xargs -r -I % rsync -av % $FEED/custom-firmware
artifacts:
paths:
- custom-firmware
parallel:
matrix:
- TARGET: bcm27xx-bcm2710-openwrt-23.05
PROFILE: rpi-3
SUFFIX: "-rpi3"
# upload packages:
# image: ruby:3.1
# stage: upload
# variables:
# GIT_STRATEGY: none
# script: |-
# for ipk in custom-packages/*; do
# asset=$(basename $ipk)
# curl \
# --header "JOB-TOKEN: $CI_JOB_TOKEN" \
# --upload-file "$ipk" \
# --verbose \
# "$PACKAGE_REGISTRY/$PACKAGE/$CI_COMMIT_REF_SLUG/$asset"
# done
# upload images:
# image: ruby:3.1
# stage: upload
# variables:
# GIT_STRATEGY: none
# script: |-
# for img in $(find ./bin -name \*squashfs-sysupgrade.bin -o -name \*ext4-sysupgrade.img.gz); do
# asset=$(basename $img)
# curl \
# --header "JOB-TOKEN: $CI_JOB_TOKEN" \
# --upload-file "$img" \
# --verbose \
# "$PACKAGE_REGISTRY/$FIRMWARE_PACKAGE/$CI_COMMIT_REF_SLUG/$asset"
# done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment