Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bootstrap-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
powershell
bootstrap-git
Commits
8ea01082
Commit
8ea01082
authored
6 years ago
by
Dennis Ahrens
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Install.ps1
+10
-7
10 additions, 7 deletions
Install.ps1
README.md
+5
-0
5 additions, 0 deletions
README.md
with
15 additions
and
7 deletions
Install.ps1
+
10
−
7
View file @
8ea01082
...
...
@@ -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"
This diff is collapsed.
Click to expand it.
README.md
+
5
−
0
View file @
8ea01082
...
...
@@ -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:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment