-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1101 from jecisc/1099-Gitlab-integration-should-m…
…anage-non-default-port 1099-Gitlab-integration-should-manage-non-default-port
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
Iceberg-Pharo6.package/MCGitlabRepository.extension/instance/scpUrl.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
*Iceberg-Pharo6 | ||
sshPort | ||
"In pharo 6 we do not have the code to be able to load gitlab with non default ssh port projects. So we return nil so that #scpUrl does not break." | ||
|
||
^ nil | ||
|
7 changes: 7 additions & 0 deletions
7
...cebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlabWithNonDefaultSSHPort.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
running | ||
testScpUrlForSelfHostedGitlabWithNonDefaultSSHPort | ||
| repository | | ||
SystemVersion current major <= 6 ifTrue: [ self skip ]. | ||
|
||
repository := MCGitlabRepository location: 'gitlab://git.pharo.org:1234:pharo-project/pharo'. | ||
self assert: repository scpUrl equals: 'ssh://[email protected]:1234/pharo-project/pharo.git' |
6 changes: 5 additions & 1 deletion
6
Iceberg.package/MCGitlabRepository.extension/instance/scpUrl.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
*Iceberg | ||
scpUrl | ||
^ 'git@<1s>:<2s>.git' expandMacrosWith: self hostname with: projectPath | ||
"If the sshPort is not nil it means that we have a non default ssh port. Thus we need to add `ssh://` and th port number to the scheme" | ||
|
||
^ self sshPort | ||
ifNil: [ 'git@<1s>:<2s>.git' expandMacrosWith: self hostname with: projectPath ] | ||
ifNotNil: [ :port | 'ssh://git@<1s>:<2s>/<3s>.git' expandMacrosWith: self hostname with: port with: projectPath ] |