Hi,
i solved this as i am using also packer to generate a VM for easier testing,
i am using gitlab-ci to generate me a debian package which then packer installs in the VM every day:
swupdate part of gitlab-ci:
#GENERATE BINARIES
build::hiatus::swupdate:
stage: build-packages
image: ubuntu:22.04
before_script:
- apt-get update; apt-get install -y gcc make libarchive-dev libconfig-dev libssl-dev wget zlib1g-dev libjson-c-dev libcurl4-openssl-dev
#libubootenv dependancy
- apt-get install -y cmake libyaml-dev
script:
- cd src/swupdate/
- export MAINDIR=$(pwd)
#local repository on gitlab
- 'wget --header="JOB-TOKEN: $CI_JOB_TOKEN" ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/swupdate/2024.05.2/swupdate-2024.05.2.tar.gz -nv'
- 'wget --header="JOB-TOKEN: $CI_JOB_TOKEN" ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/swupdate/2024.05.2/libubootenv-0.3.5.tar.gz -nv'
- tar -xvf swupdate-2024.05.2.tar.gz
- tar -xvf libubootenv-0.3.5.tar.gz
#####CUSTOM DEFCONFIG
- cp swupdate/defconfig swupdate-2024.05.2/
- cd libubootenv-0.3.5/
- mkdir build && cd build && cmake .. && cmake --build . -- -j$(nproc) && cmake --install .
- cp /usr/local/lib/libubootenv.* ${MAINDIR}/swupdate-2024.05.2/
- cd ${MAINDIR}/swupdate-2024.05.2/
- make defconfig
- make -j$(nproc)
artifacts:
paths:
- src/swupdate/swupdate-2024.05.2/swupdate
- src/swupdate/swupdate-2024.05.2/libubootenv*
expire_in: 1 day
#GENERATE DEBIAN PACKAGE
build::hiatus::swupdate-deb:
needs: ["build::hiatus::swupdate"]
stage: build-deb
image: ubuntu:22.04
variables:
PACKAGE_NAME: "swupdate"
PACKAGE_VERSION: $VERSION_TAG
PACKAGE_DEPENDANCY: "libarchive-dev, libconfig-dev, libssl-dev, zlib1g-dev"
DEB_PKG: ${PACKAGE_NAME}_${PACKAGE_VERSION}
script:
- cd src/swupdate/debian-package
- /bin/bash -c "mkdir -p ${DEB_PKG}/usr/{bin,lib/systemd/system,share/swupdate/www}"
- /bin/bash -c "mkdir -p ${DEB_PKG}/var/lib/swupdate"
- cp ../swupdate-2024.05.2/swupdate ${DEB_PKG}/usr/bin
- cp -r ../swupdate-web/www/* ${DEB_PKG}/usr/share/swupdate/www
- cp ../swupdate-2024.05.2/libubootenv.* ${DEB_PKG}/usr/lib
- cp ../swupdate/swupdate.service ${DEB_PKG}/usr/lib/systemd/system
- cp ../swupdate/sw_update_pub_key.pem ${DEB_PKG}/var/lib/swupdate
- /bin/bash ./helper_generate_deb.sh generate
- cp -v *.deb $CI_PROJECT_DIR
artifacts:
paths:
- swupdate_*.deb
expire_in: 1 day
helper_generate_deb.sh:
https://pastebin.com/F8UuEvGRswupdate.service:
https://pastebin.com/nUWezNy4swupdate-web: copy from swupdate git