Skip to content
Snippets Groups Projects
Commit 8ea01082 authored by Dennis Ahrens's avatar Dennis Ahrens
Browse files

Add ssh key to ssh_config and describe deploy keys a little

parent 5179cf08
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment