Skip to content

Commit

Permalink
Added a script to clone nonbillable information using deploy keys
Browse files Browse the repository at this point in the history
The script requires the environment variable GH_NONBILLABLE_DEPLOYKEY to be set, containg the private key of the deploy key pair
Execution of the script will clone the nonbillable repo, and copy the relevant .txt files into the process_csv_report repo
  • Loading branch information
QuanMPhm committed Apr 18, 2024
1 parent ad7ba1e commit 3e54893
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions clone_nonbillables_and_process.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
set -xe

# Add deploy key to ssh config
mkdir -p ~/.ssh
touch ~/.ssh/config
touch ~/.ssh/id_nonbillable
if ! grep -q "Host github-nonbillable" ~/.ssh/id_nonbillable; then
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
cp ~/non-billable-projects/*.txt .

0 comments on commit 3e54893

Please sign in to comment.