diff --git a/Install.ps1 b/Install.ps1 index 79cf286d8bc20d300681fc9049ef0b662b8efdfc..5766e405a380f1ca1667fb269bf2a96ca1f25940 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -31,17 +31,11 @@ if(Is-Installed("git")) { Start-Process -NoNewWindow just-install -Wait -ArgumentList 'git' } -"Make some sanity checks in the environment - verify python and git are located where we think they are..." -if (!(Test-Path $pythonExe) ) { - "python.exe is not located at: $pythonExe" - "either the installation was not successful or the path changed." -} if (!(Test-Path $gitDir) ) { "git installation not found at: $gitDir" "either the installation was not successful or the path changed." } -"Sanity successfully verified: begin to install our worker" "Create a directory for our files at $targetDirectory" if(!(Test-Path -Path $targetDirectory )){ New-Item -ItemType directory -Path $targetDirectory | Out-Null @@ -61,7 +55,16 @@ if (!(Test-Path $sshKeyName) ) { exit } -"You now need to tell gitlab (Dennis Ahrens or Artiom Lukyanchyk) about this ssh public key" +"Tell ssh to use this keys in the SSH agent so git uses them by default." +"Review $gitDir\etc\ssh\ssh_config to see whats going on here." +Add-Content -NoNewline -Path "$gitDir\etc\ssh\ssh_config" -Value @" +AddKeysToAgent yes +IdentityFile $sshKeyName +"@ + +"You now need to tell gitlab about this ssh public key." "" cat $sshPublicKey "" +"Detailed information: https://docs.gitlab.com/ee/ssh/#per-repository-deploy-keys" + diff --git a/README.md b/README.md index 95d7984a446f23e21656202466b60ce07c7be051..fcd2c5fc799397091ce8c99d241f229924c0173f 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,11 @@ Be careful, this executes code directly on your machine. You are expected to rea Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://lab.it.hs-hannover.de/powershell/bootstrap-git/raw/master/Install.ps1')) ``` +## Deploy Keys in gitlab + +Add the generated key to **your repository** as [deploy key](https://docs.gitlab.com/ee/ssh/#per-repository-deploy-keys). +You find this in the Project Settings under Repository. + ## Troubleshouting It might happen that you receive an error, because your OS is not willing to speak TLS1.2: