Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d047c347 authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

Add a gitlab-ci job to build dockerfile-guix

parent 291b8952
No related branches found
No related tags found
No related merge requests found
Pipeline #1088311 canceled
......@@ -13,6 +13,16 @@ stages:
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build-guix:
stage: build-first-layout
timeout: 24h
rules:
- changes:
- dockerfile-guix
script:
- docker build -f dockerfile-guix -t $CI_REGISTRY_IMAGE/guix .
- docker push $CI_REGISTRY_IMAGE/guix
build-base:
stage: build-first-layout
rules:
......
......@@ -20,9 +20,35 @@ RUN guix archive --authorize < /var/guix/profiles/per-user/root/current-guix/sha
# Install other useful linux packages
RUN apt-get -y upgrade --no-install-recommends bash bzip2 curl git jq unzip vim
# Clean
# RUN apt-get autoremove -y
# RUN apt-get autoclean -y
# RUN apt-get purge -y
RUN apt-get autoremove -y
RUN apt-get autoclean -y
RUN apt-get purge -y
# Execute this first before executing guix commands:
#/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild --disable-chroot --substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org https://guix.bordeaux.inria.fr' &
\ No newline at end of file
# Add specific guix-hpc channels
RUN echo '(cons (channel' > /root/.config/guix/channels.scm && \
echo " (name 'guix-hpc-non-free)" >> /root/.config/guix/channels.scm && \
echo ' (url "https://gitlab.inria.fr/guix-hpc/guix-hpc-non-free.git"))' >> /root/.config/guix/channels.scm && \
echo ' %default-channels)' >> /root/.config/guix/channels.scm
# Wrap guix-daemon so guix commands can be run by the script
RUN echo '#!/bin/bash' > /usr/local/bin/guix-daemon-wrapper.sh && \
echo 'set -x' >> /usr/local/bin/guix-daemon-wrapper.sh && \
echo "/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild --disable-chroot --substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org https://guix.bordeaux.inria.fr' &" >> /usr/local/bin/guix-daemon-wrapper.sh && \
echo 'GUIX_DAEMON_PID=$!' >> /usr/local/bin/guix-daemon-wrapper.sh && \
echo 'exec "$@"' >> /usr/local/bin/guix-daemon-wrapper.sh && \
echo 'RESULT=$?' >> /usr/local/bin/guix-daemon-wrapper.sh && \
echo 'kill $GUIX_DAEMON_PID' >> /usr/local/bin/guix-daemon-wrapper.sh && \
echo 'exit $RESULT' >> /usr/local/bin/guix-daemon-wrapper.sh && \
chmod a+x /usr/local/bin/guix-daemon-wrapper.sh
# Update Guix
RUN /usr/local/bin/guix-daemon-wrapper.sh guix pull
# Install hello package to check guix install and initialize the current user's profile (root)
RUN /usr/local/bin/guix-daemon-wrapper.sh guix install hello
# Add the updated guix in the PATH and path to executables installed with guix install
ENV PATH="/root/.guix-profile/bin":"/root/.config/guix/current/bin":$PATH
## Execute this first before executing guix commands:
#/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild --disable-chroot --substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org https://guix.bordeaux.inria.fr' &
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment