#! /bin/sh -xe

##
## Test slurm deployment on tux04
##

slurm=$(guix build -f slurm.scm)
echo $slurm

# Symlink slurm daemon executables and systemd service files.
for executable in slurmctld slurmdbd slurmd slurmrestd;
do
    sudo ln --no-target-directory --force --symbolic $slurm/sbin/$executable /usr/local/sbin/$executable
    sudo ln --no-target-directory --force --symbolic $slurm/etc/$executable.service /etc/systemd/system/$executable.service
done

# It is enough to register one gcroot as that marks the whole store
# item as live.
sudo ln --force --symbolic /usr/local/sbin/slurmd /var/guix/gcroots