From 171ba82a3074817733dfaabc41cad572d55bc8ee Mon Sep 17 00:00:00 2001 From: Peter Parente Date: Wed, 29 Jan 2020 09:37:04 -0500 Subject: [PATCH] Fix ssh key format New Docker Hub UI loses newlines in the env var settings. Loss of new lines leads ssh-add to prompt and fail when loading the key. Base64 encode and decode the key to workaround the limitation. --- all-spark-notebook/hooks/post_push | 2 +- datascience-notebook/hooks/post_push | 2 +- minimal-notebook/hooks/post_push | 2 +- pyspark-notebook/hooks/post_push | 2 +- r-notebook/hooks/post_push | 2 +- scipy-notebook/hooks/post_push | 2 +- tensorflow-notebook/hooks/post_push | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/all-spark-notebook/hooks/post_push b/all-spark-notebook/hooks/post_push index 901e8b17..1f9f1914 100755 --- a/all-spark-notebook/hooks/post_push +++ b/all-spark-notebook/hooks/post_push @@ -18,7 +18,7 @@ INDEX_FILE="${GIT_SANDBOX}/Home.md" # Configure git so it can push back to GitHub. eval $(ssh-agent -s) -ssh-add <(echo "$DEPLOY_KEY") +ssh-add <(base64 -d <(echo "$DEPLOY_KEY")) ssh-add -l git config --global user.email "jupyter@googlegroups.com" git config --global user.name "Jupyter Docker Stacks" diff --git a/datascience-notebook/hooks/post_push b/datascience-notebook/hooks/post_push index 901e8b17..1f9f1914 100755 --- a/datascience-notebook/hooks/post_push +++ b/datascience-notebook/hooks/post_push @@ -18,7 +18,7 @@ INDEX_FILE="${GIT_SANDBOX}/Home.md" # Configure git so it can push back to GitHub. eval $(ssh-agent -s) -ssh-add <(echo "$DEPLOY_KEY") +ssh-add <(base64 -d <(echo "$DEPLOY_KEY")) ssh-add -l git config --global user.email "jupyter@googlegroups.com" git config --global user.name "Jupyter Docker Stacks" diff --git a/minimal-notebook/hooks/post_push b/minimal-notebook/hooks/post_push index 901e8b17..1f9f1914 100755 --- a/minimal-notebook/hooks/post_push +++ b/minimal-notebook/hooks/post_push @@ -18,7 +18,7 @@ INDEX_FILE="${GIT_SANDBOX}/Home.md" # Configure git so it can push back to GitHub. eval $(ssh-agent -s) -ssh-add <(echo "$DEPLOY_KEY") +ssh-add <(base64 -d <(echo "$DEPLOY_KEY")) ssh-add -l git config --global user.email "jupyter@googlegroups.com" git config --global user.name "Jupyter Docker Stacks" diff --git a/pyspark-notebook/hooks/post_push b/pyspark-notebook/hooks/post_push index 901e8b17..1f9f1914 100755 --- a/pyspark-notebook/hooks/post_push +++ b/pyspark-notebook/hooks/post_push @@ -18,7 +18,7 @@ INDEX_FILE="${GIT_SANDBOX}/Home.md" # Configure git so it can push back to GitHub. eval $(ssh-agent -s) -ssh-add <(echo "$DEPLOY_KEY") +ssh-add <(base64 -d <(echo "$DEPLOY_KEY")) ssh-add -l git config --global user.email "jupyter@googlegroups.com" git config --global user.name "Jupyter Docker Stacks" diff --git a/r-notebook/hooks/post_push b/r-notebook/hooks/post_push index 901e8b17..1f9f1914 100755 --- a/r-notebook/hooks/post_push +++ b/r-notebook/hooks/post_push @@ -18,7 +18,7 @@ INDEX_FILE="${GIT_SANDBOX}/Home.md" # Configure git so it can push back to GitHub. eval $(ssh-agent -s) -ssh-add <(echo "$DEPLOY_KEY") +ssh-add <(base64 -d <(echo "$DEPLOY_KEY")) ssh-add -l git config --global user.email "jupyter@googlegroups.com" git config --global user.name "Jupyter Docker Stacks" diff --git a/scipy-notebook/hooks/post_push b/scipy-notebook/hooks/post_push index 901e8b17..1f9f1914 100755 --- a/scipy-notebook/hooks/post_push +++ b/scipy-notebook/hooks/post_push @@ -18,7 +18,7 @@ INDEX_FILE="${GIT_SANDBOX}/Home.md" # Configure git so it can push back to GitHub. eval $(ssh-agent -s) -ssh-add <(echo "$DEPLOY_KEY") +ssh-add <(base64 -d <(echo "$DEPLOY_KEY")) ssh-add -l git config --global user.email "jupyter@googlegroups.com" git config --global user.name "Jupyter Docker Stacks" diff --git a/tensorflow-notebook/hooks/post_push b/tensorflow-notebook/hooks/post_push index 901e8b17..1f9f1914 100755 --- a/tensorflow-notebook/hooks/post_push +++ b/tensorflow-notebook/hooks/post_push @@ -18,7 +18,7 @@ INDEX_FILE="${GIT_SANDBOX}/Home.md" # Configure git so it can push back to GitHub. eval $(ssh-agent -s) -ssh-add <(echo "$DEPLOY_KEY") +ssh-add <(base64 -d <(echo "$DEPLOY_KEY")) ssh-add -l git config --global user.email "jupyter@googlegroups.com" git config --global user.name "Jupyter Docker Stacks"