Files
pixi-deploy/autodeploy/setup.sh
T
2026-06-18 20:54:31 +02:00

62 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
echo "Workspace: $GITHUB_WORKSPACE"
DESTINATION_DIR="$1"
echo "Destination: $DESTINATION_DIR"
# URL="https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-unknown-linux-musl.tar.gz"
URL="https://gitea.psi.ch/python/pixi/releases/download/latest/pixi-x86_64-unknown-linux-musl.tar.gz"
ARCHIVE=$(basename "$URL")
BINARY=$(echo "$ARCHIVE" | cut -d. -f1 | cut -d- -f1)
SCRIPT_PATH=$(dirname "$0")
echo "Script path: $SCRIPT_PATH"
"$SCRIPT_PATH/download.sh" "$URL"
"$SCRIPT_PATH/gitignore.sh" add "$ARCHIVE" || true
"$SCRIPT_PATH/gitignore.sh" add "$BINARY" || true
# git config user.name "GFA AutoDeploy"
# git config user.email "gfa-autodeploy@psi.ch"
# enforce glibc version of target system (consoles) instead of runner system
export CONDA_OVERRIDE_GLIBC=2.28
chmod +x "$GITHUB_WORKSPACE/pixi"
cd "$DESTINATION_DIR"
if [[ -f "pixi.toml" ]]; then
echo "pixi already initialized"
else
echo "pixi init"
"$GITHUB_WORKSPACE/pixi" init
fi
echo "pixi install"
"$GITHUB_WORKSPACE/pixi" install --all --no-progress
echo "copy owner group from level above"
group=$(stat -c '%g' ..)
chgrp -R "$group" .
#echo "copy permissions from owner to owner group"
#chmod -R g=u .
#"$SCRIPT_PATH/symlink.sh" "$PWD/.pixi/envs" "$PWD/../../envs"
# git add .gitattributes .gitignore pixi.lock pixi.toml
# git commit -m"automatic commit after install"
# git push