Commit be26f191 authored by Guido Gunther's avatar Guido Gunther

Merge branch 'undefault-ci-builds' into 'master'

Undefault ci builds

See merge request !49
parents e41edba6 865a5a26
Pipeline #2370 passed with stage
in 15 seconds
......@@ -8,6 +8,7 @@ node {
parameters {
string(name: 'board', defaultValue: "imx6", description: 'What board type to build for?')
string(name: 'dist', defaultValue: "buster+ci", description: 'What distribuition to build for?')
string(name: 'build_type', defaultValue: "unstable", description: 'What type of build is this?')
string(name: 'publish', defaultValue: "false", description: 'Should the image get published?')
}
......@@ -27,17 +28,17 @@ node {
git url: gitUrl, branch: branch
}
stage('Clean') {
sh "make BOARD='${params.board}' TYPE='${params.build_type}' clean"
sh "make DIST='${params.dist}' BOARD='${params.board}' TYPE='${params.build_type}' clean"
}
stage('check') {
sh "make BOARD='${params.board}' TYPE='${params.build_type}' check"
sh "make DIST='${params.dist}' BOARD='${params.board}' TYPE='${params.build_type}' check"
}
stage('Build') {
sh "make BOARD='${params.board}' TYPE='${params.build_type}'"
sh "make DIST='${params.dist}' BOARD='${params.board}' TYPE='${params.build_type}'"
}
stage('Publish') {
if( "${params.publish}"=="true" ) {
sh "make BOARD='${params.board}' TYPE='${params.build_type}' sha256sums"
sh "make DIST='${params.dist}' BOARD='${params.board}' TYPE='${params.build_type}' sha256sums"
sh "bin/publish_ci_files -t image -T ${params.build_type} ${params.board}.img.xz sha256sums"
} else {
echo 'This image will not be published'
......
......@@ -5,6 +5,7 @@ TYPE=unstable
IMAGE=$(BOARD).img
COMPRESSED=$(IMAGE).xz
CHECKSUM=sha256sums
DIST=buster+ci
DEPS=\
build-image \
root.sh \
......@@ -18,7 +19,7 @@ all: $(COMPRESSED)
$(IMAGE): tmp/$(IMAGE).stamp
tmp/$(IMAGE).stamp: local.sh-link $(DEPS)
./build-image -b $(BOARD) -T $(TYPE)
./build-image -b $(BOARD) -T $(TYPE) -d $(DIST)
touch tmp/$(IMAGE).stamp
%.img.xz: %.img tmp/%.img.stamp
......
......@@ -12,7 +12,7 @@ usage() {
echo "Usage : $1 "
echo " -h Display this help message."
echo " -b [imx6|imx8|qemu-x86_64] select the board type."
echo " -d <distro> optional select the puros distro"
echo " -d <distro> distro to use. [ green, purple, buster, green+ci, buster+ci, purple+ci ]"
echo " -T [ci|unstable] use the artifacts from this build for the image"
echo " -B build rootfs tarball as well"
}
......@@ -48,7 +48,7 @@ setup_loop() {
cwd=$(pwd)
distro=${DIST:-buster}
distro=${DIST:-buster+ci}
mirror=${MIRROR:-"http://deb.debian.org/debian"}
pureos_board=imx6
build_type=unstable
......@@ -57,6 +57,7 @@ uboot_bin=
build_tarball=
want_qcow2=
apt_sources=
debootstrap_dist=
while getopts ":hb:d:T:B" opt; do
case ${opt} in
......@@ -84,6 +85,10 @@ while getopts ":hb:d:T:B" opt; do
esac
done
# If distro ends in CI use ci packages and cleanup distro name
[[ "${distro}" =~ \+ci ]] && ci_pkgs=1 || ci_pkgs=0
distro="${distro/+ci}"
kernel_url=https://storage.puri.sm/librem5/binaries/${build_type}/latest/files/
bootimg="${pureos_board}.img"
......@@ -92,7 +97,8 @@ bootimg="${pureos_board}.img"
# shellcheck source=conf/dists/buster
. conf/dists/"${distro}"
echo "Building ${bootimg} (board_type: ${board_type}, arch: ${arch}, build_type: ${build_type})"
[ -n "${debootstrap_dist}" ] || debootstrap_dist="${distro}"
echo "Building ${bootimg} (board_type: ${board_type}, arch: ${arch}, build_type: ${build_type}, ci_pkgs: ${ci_pkgs}, ${debootstrap_dist})"
echo "Installing extra packages ${packages}"
mkdir -p tmp/ files/
......@@ -122,12 +128,13 @@ sudo pureos_board="${pureos_board}" \
fdt_file="${fdt_file}" \
build_tarball="${build_tarball}" \
apt_sources="${escaped_apt_sources}" \
ci_pkgs="${ci_pkgs}" \
vmdebootstrap \
--enable-dhcp \
--verbose --image "${bootimg}" --log "tmp/${bootimg}.log" --size 3600M \
--mirror "${mirror}" \
--configure-apt \
--distribution "$distro" \
--distribution "${debootstrap_dist}" \
--serial-console-command "/sbin/getty -L ttymxc0 115200 vt100" \
--root-password='root' --hostname='pureos' --user=purism/123456 --sudo \
--customize "${cwd}/root.sh" \
......
mirror="http://repo.pureos.net/pureos"
apt_sources="deb http://repo.pureos.net/pureos green main
deb http://repo.pureos.net/pureos laboratory main"
debootstrap_dist=green
mirror="http://repo.pureos.net/pureos"
apt_sources="deb http://repo.pureos.net/pureos green main
deb http://repo.pureos.net/pureos purple main"
debootstrap_dist=green
......@@ -187,17 +187,18 @@ function setup_apt()
echo "Set sources list to:"
cat "${basedir}/etc/apt/sources.list"
cat << EOF > "${basedir}/etc/apt/sources.list.d/ci.list"
deb http://ci.puri.sm/ scratch librem5
EOF
cat << EOF > "${basedir}/etc/apt/apt.conf.d/71-no-recommends"
APT::Install-Recommends "0";
APT::Install-Suggests "0";
EOF
chroot ${basedir} apt-get install -y gnupg
cat data/ci-repo.key | chroot ${basedir} apt-key add -
if [ "${ci_pkgs}" -gt 0 ]; then
cat << EOF > "${basedir}/etc/apt/sources.list.d/ci.list"
deb http://ci.puri.sm/ scratch librem5
EOF
cat data/ci-repo.key | chroot ${basedir} apt-key add -
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment