BuildEnvironments/DINDAgent/entrypoint.sh
2024-11-09 00:42:05 -07:00

24 lines
No EOL
569 B
Bash

#!/bin/bash
if [ -d /keys ]
then
echo "Installing SSH Keys..."
mkdir -pv $HOME/.ssh
cp -v /keys/id_rsa $HOME/.ssh/
cp -v /keys/id_rsa.pub $HOME/.ssh/
chmod 0600 $HOME/.ssh/id_rsa
sleep 10
fi
echo "Logging into Docker..."
docker login git.zontreck.com -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
sleep 10
echo "Connecting agent"
java -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -jar /agent.jar -url "https://ci.zontreck.com" -secret "$DOCKER_AGENT_SECRET" -name "BuilderHost" -workDir "/builder"
echo "Container stopping or crashed"
sleep 5