Commit 8ca11cd2 authored by Robert Speicher's avatar Robert Speicher

Add scripts/setup_ssh.sh

parent 1b448257
......@@ -10,28 +10,6 @@ require_version()
fi
}
configure_git()
{
git config --global user.email "robert+release-tools@gitlab.com"
git config --global user.name "GitLab Release Tools Bot"
}
setup_ssh()
{
if ! which ssh-agent; then
apt-get update -y && apt-get install openssh-client -y
fi
eval $(ssh-agent -s)
echo "$RELEASE_BOT_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cp $(dirname $0)/../config/known_hosts ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
}
setup_env()
{
export GITLAB_API_PRIVATE_TOKEN="$RELEASE_BOT_PRODUCTION_TOKEN"
......@@ -39,11 +17,6 @@ setup_env()
}
require_version
if [ -n "${CI}" ]; then
# These should only be necessary in CI
configure_git
setup_ssh
fi
setup_env
case $1 in
......
#!/bin/sh
if [ -n "${CI}" ]; then
if ! which ssh-agent; then
apt-get update -y && apt-get install openssh-client -y
fi
eval $(ssh-agent -s)
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cp config/known_hosts ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment