Commit af9f4e6c authored by Esteban Bosse 's avatar Esteban Bosse

Unify repo pipeline and images

parent 9cfecd6b
Pipeline #32192 failed with stages
in 4 minutes and 7 seconds
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base
RUN apt-get update && \
eatmydata apt-get install autopkgtest --no-install-recommends -y && \
rm -rf /var/lib/apt && \
rm /usr/sbin/policy-rc.d && \
ln -s /bin/true /usr/sbin/policy-rc.d
RUN useradd --gid 0 -m salsa-ci
FROM debian:unstable
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
eatmydata \
&& rm -rf /var/lib/apt
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
eatmydata \
&& rm -rf /var/lib/apt
FROM debian:stretch
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
eatmydata \
&& rm -rf /var/lib/apt
FROM debian:stretch-backports
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
eatmydata \
&& rm -rf /var/lib/apt
FROM debian:unstable
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
eatmydata \
&& rm -rf /var/lib/apt
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base
RUN apt-get update && eatmydata apt-get install blhc -y && rm -rf /var/lib/apt
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base
RUN apt-get update && eatmydata apt-get dist-upgrade -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get --no-install-recommends install dpkg-dev build-essential aptitude devscripts equivs -y && rm -rf /var/lib/apt
RUN useradd --gid 0 salsa-ci
COPY ./scripts/install-build-deps.sh /usr/local/bin/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base:jessie
RUN apt-get update && eatmydata apt-get dist-upgrade -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get --no-install-recommends install dpkg-dev build-essential aptitude devscripts equivs -y && rm -rf /var/lib/apt
RUN useradd --gid 0 salsa-ci
COPY ./scripts/install-build-deps.sh /usr/local/bin/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base:stretch
RUN apt-get update && eatmydata apt-get dist-upgrade -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get --no-install-recommends install dpkg-dev build-essential aptitude devscripts equivs -y && rm -rf /var/lib/apt
RUN useradd --gid 0 salsa-ci
COPY ./scripts/install-build-deps.sh /usr/local/bin/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base:stretch-backports
RUN apt-get update && eatmydata apt-get dist-upgrade -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get --no-install-recommends install dpkg-dev build-essential aptitude devscripts equivs -y && rm -rf /var/lib/apt
RUN useradd --gid 0 salsa-ci
COPY ./scripts/install-build-deps.sh /usr/local/bin/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base:unstable
RUN apt-get update && eatmydata apt-get dist-upgrade -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get --no-install-recommends install dpkg-dev build-essential aptitude devscripts equivs -y && rm -rf /var/lib/apt
RUN useradd --gid 0 salsa-ci
COPY ./scripts/install-build-deps.sh /usr/local/bin/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base
RUN apt-get update && eatmydata apt-get install git-buildpackage docker.io pristine-tar --no-install-recommends -y && rm -rf /var/lib/apt
# Just for backward compatibility, because current pipeline does gbp pull for no reasons... Remove it after merge
RUN apt-get update && eatmydata apt-get install ca-certificates fakeroot --no-install-recommends -y && rm -rf /var/lib/apt
COPY ./scripts/docker-build.sh /usr/local/bin/
# Support for docker:dind
ENV DOCKER_HOST=tcp://docker:2375
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base
RUN apt-get update && eatmydata apt-get install lintian golang -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get install git -y && rm -rf /var/lib/apt
ENV GOPATH=/root/go
RUN go get github.com/philhug/go-lintian/cmd/lintian2junit/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base:jessie
RUN apt-get update && eatmydata apt-get install lintian golang -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get install git -y && rm -rf /var/lib/apt
ENV GOPATH=/root/go
RUN go get github.com/philhug/go-lintian/cmd/lintian2junit/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base:stretch
RUN apt-get update && eatmydata apt-get install lintian golang -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get install git -y && rm -rf /var/lib/apt
ENV GOPATH=/root/go
RUN go get github.com/philhug/go-lintian/cmd/lintian2junit/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base:stretch-backports
RUN apt-get update && eatmydata apt-get install lintian golang -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get install git -y && rm -rf /var/lib/apt
ENV GOPATH=/root/go
RUN go get github.com/philhug/go-lintian/cmd/lintian2junit/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base:unstable
RUN apt-get update && eatmydata apt-get install lintian golang -y && rm -rf /var/lib/apt
RUN apt-get update && eatmydata apt-get install git -y && rm -rf /var/lib/apt
ENV GOPATH=/root/go
RUN go get github.com/philhug/go-lintian/cmd/lintian2junit/
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base
RUN apt-get update && eatmydata apt-get install -y \
python3 python3-yaml python3-gitlab python3-yaml openssh-client git \
&& rm -rf /var/lib/apt
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base
RUN apt-get update && eatmydata apt-get install docker.io piuparts --no-install-recommends -y && rm -rf /var/lib/apt
COPY ./scripts/*_install_*_configs /etc/piuparts/scripts/
RUN chmod -c o-w /etc/piuparts/scripts/*_install_*_configs
# Support for docker:dind
ENV DOCKER_HOST=tcp://docker:2375
ARG CI_REGISTRY_IMAGE
FROM $CI_REGISTRY_IMAGE/base
RUN apt-get update && eatmydata apt-get install reprotest patch faketime locales-all \
disorderfs sudo --no-install-recommends -y && rm -rf /var/lib/apt
COPY patches/reprotest/build.patch /tmp/build.patch
RUN patch /usr/lib/python3/dist-packages/reprotest/build.py /tmp/build.patch
ENV PYTHONIOENCODING utf-8
--- /usr/lib/python3/dist-packages/reprotest/build.py 2017-12-15 14:47:07.000000000 +0000
+++ build.patch 2018-05-16 13:22:58.946838683 +0000
@@ -332,7 +332,7 @@
else:
# if there is an issue with this being random, we could instead select it
# based on a deterministic hash of the inputs
- loc = random.choice(['fr_CH.UTF-8', 'es_ES', 'ru_RU.CP1251', 'kk_KZ.RK1048', 'zh_CN'])
+ loc = random.choice(['fr_CH.UTF-8', 'es_ES.UTF-8', 'ru_RU.CP1251', 'kk_KZ.UTF-8', 'zh_CN.UTF-8'])
return build.add_env('LANG', loc).add_env('LC_ALL', loc).add_env('LANGUAGE', '%s:fr' % loc)
......@@ -30,6 +30,14 @@ stages:
script:
- gbp pull --ignore-branch --pristine-tar --track-missing
- gbp buildpackage --git-ignore-branch --git-export-dir=${WORKING_DIR} --git-builder="docker-build.sh registry.salsa.debian.org/salsa-ci-team/images/dockerbuilder:${RELEASE}"
only:
changes:
- dockerfiles/*
- scripts/*
- patches/*
- salsa-ci.yml
variables:
- $SCHEDULED_BUILD
.build-unstable: &build-unstable
<<: *build-definition
......
#!/bin/bash
set -eu
BUILD_LOGFILE="${WORKING_DIR}/$(dpkg-parsechangelog -S Source)_$(dpkg-parsechangelog -S Version)_$(dpkg --print-architecture).build"
DOCKER_IMAGE_NAME=$1
VOLUMES="-v $PWD/..:/tmp/building -v $PWD:/tmp/building/package"
CONTAINER_ID=$(docker run -d --rm -w /tmp/building/package ${VOLUMES} ${DOCKER_IMAGE_NAME} sleep infinity)
cleanup() {
docker rm -f ${CONTAINER_ID}
}
trap cleanup EXIT
DEBIAN_VARENVS=""
IFS=$'\n' && for varenv in $(env); do
if [[ $varenv == DEB* ]]; then
DEBIAN_VARENVS+=" -e \"${varenv}\""
fi
done
set -x
eval docker cp /etc/apt/sources.list.d/./ ${CONTAINER_ID}:/etc/apt/sources.list.d/
eval docker cp /etc/apt/preferences.d/./ ${CONTAINER_ID}:/etc/apt/preferences.d/
eval docker exec ${DEBIAN_VARENVS} ${CONTAINER_ID} apt-get update
eval docker exec ${DEBIAN_VARENVS} ${CONTAINER_ID} apt-get install eatmydata -y
eval docker exec ${DEBIAN_VARENVS} ${CONTAINER_ID} eatmydata apt-get dist-upgrade -y
eval docker exec ${DEBIAN_VARENVS} ${CONTAINER_ID} eatmydata mk-build-deps -ri debian/control --tool install-build-deps.sh
eval docker exec ${DEBIAN_VARENVS} ${CONTAINER_ID} eatmydata chown -R salsa-ci:0 /tmp/building
set -o pipefail
eval docker exec --user salsa-ci ${DEBIAN_VARENVS} ${CONTAINER_ID} eatmydata dpkg-buildpackage "${@:2}" | tee "${BUILD_LOGFILE}" 2>&1
#!/bin/bash
FILENAME=$(echo *-build-deps*.deb)
PKGNAME=$(dpkg-deb -f ${FILENAME} Package)
aptitude -y --without-recommends \
-o APT::Install-Recommends=false \
-o Aptitude::ProblemResolver::StepScore=100 \
-o Aptitude::ProblemResolver::Keep-All-Level=55000 \
-o "Aptitude::ProblemResolver::Hints::KeepDummy=reject $PKGNAME :UNINST" \
-o Aptitude::ProblemResolver::Remove-Essential-Level=maximum \
${@}
rm $FILENAME
#!/bin/sh
if [ "$PIUPARTS_TEST" = install -o "$PIUPARTS_TEST" = 'upgrade' -a "$PIUPARTS_PHASE" = 'upgrade' ]; then
if [ -d /etc-target ]; then
cd /etc-target
for f in $(find -mindepth 1); do
if [ -d "$f" ]; then
echo "Not removing dir /etc/$f"
else
rm -v "/etc/$f"
fi
done
fi
fi
#!/bin/sh
if [ "$PIUPARTS_TEST" = install -o "$PIUPARTS_TEST" = 'upgrade' -a "$PIUPARTS_PHASE" = 'upgrade' ]; then
if [ -d /etc-target ]; then
needs_aptupdate=
cd /etc-target
for f in $(find -mindepth 1); do
if [ -d "$f" ]; then
mkdir -vp "/etc/$f"
else
cp -av "$f" "/etc/$f"
if echo "$f" | grep -q 'sources.list' ; then
needs_aptupdate=1
fi
fi
done
if [ -n "$needs_aptupdate" ]; then
apt-get update
fi
fi
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