Commit b6f50ae4 authored by Aryan Noshirvani's avatar Aryan Noshirvani

Remove base64 decode check and write private key directly to id_ed25519

parent 155104c1
Pipeline #973 failed with stages
in 4 minutes and 21 seconds
......@@ -34,11 +34,7 @@ deploy_prod:
- echo "Deploying to production server..."
- |
if [ -n "$SSH_PRIVATE_KEY" ]; then
if echo "$SSH_PRIVATE_KEY" | grep -q "BEGIN"; then
printf "%s\n" "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
else
echo "$SSH_PRIVATE_KEY" | base64 -d | tr -d '\r' > ~/.ssh/id_ed25519
fi
printf "%s\n" "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
else
echo "WARNING: SSH_PRIVATE_KEY variable is not set."
......
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