diff --git a/getOrCreateSshKeys.sh b/getOrCreateSshKeys.sh index 0169c53..d1c394e 100755 --- a/getOrCreateSshKeys.sh +++ b/getOrCreateSshKeys.sh @@ -5,6 +5,7 @@ IDLE_TIME=${IDLE_TIME:-86400} LOCALUSER=${LOCALUSER:-swsuser} LOCALGROUP=${LOCALGROUP:-swsgroup} +export GIT_SSH_COMMAND="ssh -i $HOME/.ssh/id_ed25519" getOrCreateSshKeys() { #user is root @@ -46,7 +47,8 @@ else cp /run/secrets/id_ed25519.pub ~/.ssh/id_ed25519.pub chown "${LOCALUSER}:${LOCALGROUP}" ~/.ssh/id_ed25519 chown "${LOCALUSER}:${LOCALGROUP}" ~/.ssh/id_ed25519.pub - chmod 600 ~/.ssh/id_ed25519.pub + chmod 600 ~/.ssh/id_ed25519 + chmod 666 ~/.ssh/id_ed25519.pub ls -la ~/.ssh/ else diff --git a/git2zola.sh b/git2zola.sh index a368eef..0813ddd 100755 --- a/git2zola.sh +++ b/git2zola.sh @@ -42,8 +42,6 @@ BASE_URL=${BASE_URL:-"http://docker.local:${SWSPORT}"} # Zola output build and sws path OUTPUT_DIR=${OUTPUT_DIR:-$HOME/$GITPROJECTUSER/$GITPROJECTNAME/public} -export GIT_SSH_COMMAND="ssh -i $HOME/.ssh/id_ed25519" - # set trap to exit this process # at this time only exit this process if it get a exit code trap "exit" EXIT @@ -138,7 +136,12 @@ getTheme () { fi } +echo "Starting $_" + getOrCreateSshKeys +echo "Using git command: $GIT_SSH_COMMAND" +echo "Working directory:" +pwd echo "put git server ${GITSERVER} to known hosts" ssh-keyscan -p "${GITSERVERPORT}" -H "${GITSERVER}" >> ~/.ssh/known_hosts zola --version