Commit ab63d388 authored by Markus Frosch's avatar Markus Frosch 📣
Browse files

Merge branch 'ci' into 'master'

Implement CI

See merge request !2
parents 9d33db8f 80240c99
Pipeline #3002 passed with stage
in 6 minutes and 2 seconds
......@@ -6,18 +6,18 @@ services:
- docker:dind
variables:
DOCKER_REGISTRY: registry.icinga.com
DOCKER_REGISTRY: ${CI_REGISTRY}
DOCKER_IMAGE_PREFIX: ${CI_PROJECT_PATH}/
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.icinga.com
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- apk -U add make
build:
stage: build
tags:
- docker-build
- docker-build-arm
script:
- make
- '[ "$CI_COMMIT_REF_NAME" != master ] || make -C debootstrap push'
......
......@@ -20,7 +20,7 @@ all: build
tarball: rootfs.tar.xz
rootfs.tar.xz:
$(MAKE) -C debootstrap tarball
$(MAKE) -C debootstrap build tarball
mv debootstrap/rootfs.tar.xz ./
build: tarball
......
......@@ -6,5 +6,6 @@ RUN apt-get update \
COPY debootstrap.sh /usr/local/sbin/
COPY script-raspbian /usr/share/debootstrap/scripts/raspbian
COPY qemu-arm-static /usr/bin/qemu-arm-static
CMD ["debootstrap.sh"]
......@@ -23,6 +23,7 @@ pull:
docker pull "$(FROM)"
build:
cp -av /usr/bin/qemu-arm-static .
docker build --cache-from "$(IMAGE)" --tag "$(IMAGE)" .
tarball: rootfs.tar.xz
......
......@@ -12,7 +12,11 @@
set -exu
gpg --keyserver "$KEYSERVER" --recv-key "$GPGKEY"
gpg --no-tty --keyserver "$KEYSERVER" --recv-key "$GPGKEY"
umount -R "${TARGET:?}/proc" || true
umount -R "${TARGET:?}/sys" || true
umount -R "${TARGET:?}/dev" || true
rm -rf "${TARGET:?}"
rm -f "${TARBALL}"
......@@ -31,6 +35,10 @@ then
exit 1
fi
umount -R "${TARGET:?}/proc" || true
umount -R "${TARGET:?}/sys" || true
umount -R "${TARGET:?}/dev" || true
rm -rf "${TARGET:?}"/var/lib/apt/lists/*
rm -rf "${TARGET:?}"/var/cache/apt/archives/*
......
......@@ -9,7 +9,12 @@ if [ -n "$DOCKER_REGISTRY" ]; then
IMAGE="${DOCKER_REGISTRY}/${IMAGE}"
fi
docker run -it --rm \
opts=
if [ -t 1 ] && [ -t 0 ]; then
opts=-t
fi
docker run -i $opts --rm \
--privileged \
-e "TARBALL=$TARBALL" \
-v "$(pwd):/work" -w "/work" \
......
......@@ -20,7 +20,7 @@ esac
work_out_debs () {
required="$(get_debs Priority: required)"
# remove some packages for Docker
# remove some packages for Docker
required="$(without "$required" "$ignore_packages")"
if doing_variant - || doing_variant fakechroot; then
......@@ -39,7 +39,7 @@ work_out_debs () {
fi
case $MIRRORS in
https://*)
https://*)
base="$base apt-transport-https ca-certificates"
;;
esac
......@@ -72,6 +72,13 @@ first_stage_install () {
second_stage_install () {
setup_dynamic_devices
if [ -x /usr/bin/qemu-arm-static ]; then
cp -a /usr/bin/qemu-arm-static "$TARGET/usr/bin/qemu-arm-static"
else
echo "No qemu-arm-static found!" >&2
exit 1
fi
x_feign_install () {
local pkg="$1"
local deb="$(debfor $pkg)"
......@@ -214,6 +221,9 @@ echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/
mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
rm -f "$TARGET/usr/sbin/policy-rc.d"
# cleanup ARM virt
rm -f "$TARGET/usr/bin/qemu-arm-static"
progress $bases $bases CONFBASE "Configuring base system"
info BASESUCCESS "Base system installed successfully."
}
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