Skip to content
Snippets Groups Projects
Commit 6df6e01c authored by Samuel Hym's avatar Samuel Hym
Browse files

CI: Use local debian mirror instead of cache.

Use the local debian mirror instead of the global one
Only install the required packages, not all the recommended ones
Use a short expiring date for artifacts, in cases of quick succession of
CI builds, only the most recent is to be kept
parent 1b4513eb
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# "apt update ; apt install", with caching of the downloaded packages
# and current state, to minimise load on debian mirrors without having
# to build a new docker image
CACHE=.ci/debian-cache.tar.gz
if [ -z "$1" ]; then
printf 'Usage: %s <package>...\n' "$0"
exit 1
fi
if ls -sh $CACHE; then
sudo tar xvaf $CACHE -C /var
else
printf 'No debian cache to extract\n'
fi
# Remove the configuration that disable apt cache
sudo rm /etc/apt/apt.conf.d/docker-clean
sudo apt update -y -q
# first only download the packages, so that they end up in the cache
sudo DEBIAN_FRONTEND=noninteractive apt install -yqd "$@"
sudo tar caf $CACHE -C /var lib/apt cache/apt
ls -sh $CACHE
# now really install the packages
sudo DEBIAN_FRONTEND=noninteractive apt install -yq --no-download "$@"
#!/bin/bash
# "apt update ; apt install", but from the local mirror
sudo cp .ci/sources.list /etc/apt/sources.list
sudo apt update -yq
sudo DEBIAN_FRONTEND=noninteractive apt install -yq --no-install-recommends "$@"
deb http://debian.polytech-lille.fr/debian buster main
deb http://debian.polytech-lille.fr/debian buster-updates main
......@@ -3,16 +3,13 @@ image: "coqorg/coq:latest"
build:
stage: build
script:
- .ci/apt-get-and-cache.sh ghc cabal-install libghc-language-c-dev libghc-wl-pprint-text-dev libghc-optparse-applicative-dev libghc-data-default-dev libghc-aeson-dev
- .ci/apt-get.sh ghc cabal-install libghc-language-c-dev libghc-wl-pprint-text-dev libghc-optparse-applicative-dev libghc-data-default-dev libghc-aeson-dev
- cabal build
- cp dist/build/digger/digger digger
cache:
paths:
- .ci/*-cache.tar.gz
when: 'always'
artifacts:
paths:
- digger
expire_in: 1 hour
test:
stage: test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment