From 68437d6f53af9d8d04fb37250c6e5130615e1969 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Sat, 16 Apr 2022 12:37:18 +0530 Subject: [PATCH] fix: CI: write multi-line ssh key --- Makefile | 2 +- scripts/ci.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 977d562..4a1661b 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ ci-deploy: ## Deploy from CI/CD. Only call from within CI git config --global user.email "${CI_COMMIT_AUTHOR_EMAIL}" git config --global user.name "${CI_COMMIT_AUTHOR}" ./scripts/zola.sh deploy pages public "${CI_COMMIT_AUTHOR} <${CI_COMMIT_AUTHOR_EMAIL}>" - ./scripts/ci.sh --init ${HOSTEA_WRITE_DEPLOY_KEY} + ./scripts/ci.sh --init "$$HOSTEA_WRITE_DEPLOY_KEY" ./scripts/ci.sh --deploy ${PAGES_DEPLOY_SECRET} pages ./scripts/ci.sh --clean diff --git a/scripts/ci.sh b/scripts/ci.sh index 4c9f540..a8136c7 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -46,7 +46,8 @@ EOF # $1: SSH private key write_ssh(){ - echo $1 > $SSH_ID_FILE + echo > $SSH_ID_FILE + echo "$1" >> $SSH_ID_FILE } set_ssh_remote() { @@ -98,7 +99,7 @@ then exit -1 fi set_ssh_remote - write_ssh $2 + write_ssh "$2" elif match_arg $1 '-c' '--clean' then clean