diff --git a/install.sh b/install.sh index 6f366b6..fe362b4 100644 --- a/install.sh +++ b/install.sh @@ -1,37 +1,47 @@ #!/bin/sh +set -e -# install basic packages +if [ ! -f /etc/alpine-release ]; then + echo "Error: This script only runs on Alpine Linux." + exit 1 +fi + +echo "Installing packages..." apk add gnupg gnupg-scdaemon pinentry-tty git -# gnupg config +echo "Configuring GPG..." mkdir -p ~/.gnupg chmod -R 700 ~/.gnupg echo 'enable-ssh-support' > ~/.gnupg/gpg-agent.conf echo 'pinentry-program /usr/bin/pinentry-tty' >> ~/.gnupg/gpg-agent.conf -# setup env +echo "Setting up environment..." export GPG_TTY="$(tty)" export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" -# trust key on card +echo "Importing and trusting GPG key..." gpg --recv-keys "56FB101D4E094804B1666859083A2C9A046554D6" echo "56FB101D4E094804B1666859083A2C9A046554D6:6:" | gpg --import-ownertrust -# restart agent +echo "Restarting GPG agent..." gpgconf --kill gpg-agent gpg-agent --daemon -# test -ssh -T git@g.eliaskohout.de +echo "Testing SSH connection..." +ssh -T git@g.eliaskohout.de || true -# setup projects -mkdir ~/projects/ -cd ~/projects/ +echo "Setting up projects directory..." +mkdir -p ~/projects +cd ~/projects git clone "git@g.eliaskohout.de:eliaskohout/env.git" -# setup env +echo "Adding community repository..." grep main /etc/apk/repositories | sed 's/main/community/' >> /etc/apk/repositories apk update + +echo "Running env setup..." cd env ./runs/up.python.sh -./scripts/conf-run up \ No newline at end of file +./scripts/conf-run up + +echo "Setup complete!"