From 29fbb9a49eb9abb823f5e0bc23732fb70fe61fa3 Mon Sep 17 00:00:00 2001 From: QuanMPhm Date: Thu, 18 Apr 2024 14:19:16 -0400 Subject: [PATCH] Added a script to clone nonbillable information using deploy keys The script requires the environment variable GH_NONBILLABLE_DEPLOYKEY to be set, containg the private key of the deploy key pair If ran on a local machine with a .ssh/config file already setup by the user, it also expects the Host `github-nonbillable` to be configured For more detail, see `clone_nonbillable_and_process.sh` Execution of the script will clone the nonbillable repo, and copy the relevant .txt files into the process_csv_report repo --- tools/clone_nonbillables_and_process.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tools/clone_nonbillables_and_process.sh diff --git a/tools/clone_nonbillables_and_process.sh b/tools/clone_nonbillables_and_process.sh new file mode 100644 index 0000000..b94f77c --- /dev/null +++ b/tools/clone_nonbillables_and_process.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -xe + +# Add deploy key to ssh config +mkdir -p ~/.ssh +if [ ! -e ~/.ssh/config]; then + touch ~/.ssh/config + touch ~/.ssh/id_nonbillable + echo " + Host github-nonbillable + HostName github.com + IdentityFile ~/.ssh/id_nonbillable + " > ~/.ssh/config + echo "$GH_NONBILLABLE_DEPLOYKEY" > ~/.ssh/id_nonbillable +fi +chmod 600 ~/.ssh/id_nonbillable + +git clone git@github-nonbillable:CCI-MOC/non-billable-projects.git ~/non-billable-projects