require GitLab CI session to run these scripts

These scripts assume things that you only get while running in a CI
Docker container, like root access and state that is reset everytime.
This commit is contained in:
Hans-Christoph Steiner 2018-06-14 15:34:38 +02:00
parent 6c596bd7b9
commit 61a5b0173f
5 changed files with 13 additions and 0 deletions

View File

@ -26,6 +26,7 @@ RUN mkdir -p /usr/share/man/man1 \
&& rm -rf /var/lib/apt/lists/*
COPY gitlab-ci-git-buildpackage /
COPY gitlab-ci-common /usr/share/
COPY gitlab-ci-enable-sid /usr/bin/
COPY gitlab-ci-enable-experimental /usr/bin/

6
gitlab-ci-common Normal file
View File

@ -0,0 +1,6 @@
if [ -z "$CI" ]; then
echo "This script should only ever be run in GitLab CI!"
exit 1
fi

View File

@ -1,5 +1,7 @@
#!/bin/bash -e
. /usr/share/gitlab-ci-common
printf "Package: *\nPin: release o=Debian,a=stable\nPin-Priority: 900\n" \
> /etc/apt/preferences.d/debian-stable.pref

View File

@ -1,5 +1,7 @@
#!/bin/bash -e
. /usr/share/gitlab-ci-common
printf "Package: *\nPin: release o=Debian,a=stable\nPin-Priority: 900\n" \
> /etc/apt/preferences.d/debian-stable.pref

View File

@ -5,6 +5,8 @@ if [ "$CI_COMMIT_REF_NAME" == "upstream" ] || [ "$CI_COMMIT_REF_NAME" == "pristi
exit 0
fi
. /usr/share/gitlab-ci-common
# https://gitlab.com/gitlab-org/gitlab-runner/issues/1380#note_48552305
lockfile=/.lock
if [[ ! -f $lockfile ]] ; then