File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ var _ = Describe("action struct", func() {
3434 },
3535 }
3636 repoInfo = & git.RepoInfo {
37- Repo : repoName ,
37+ Repo : repoName ,
38+ RepoType : "gitlab" ,
3839 }
3940 })
4041 Context ("buildCIFileConfig method" , func () {
@@ -51,6 +52,7 @@ var _ = Describe("action struct", func() {
5152 "AppName" : "test_repo" ,
5253 "ImageRepoSecret" : "IMAGE_REPO_SECRET" ,
5354 "ImageRepoDockerSecret" : "image-repo-auth" ,
55+ "RepoType" : "gitlab" ,
5456 "imageRepo" : map [string ]interface {}{
5557 "url" : "exmaple.com" ,
5658 "user" : "test_user" ,
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ var _ = Describe("PipelineConfig struct", func() {
3333 },
3434 }
3535 r = & git.RepoInfo {
36- Repo : repoName ,
36+ Repo : repoName ,
37+ RepoType : "gitlab" ,
3738 }
3839 })
3940 Context ("BuildCIFileConfig method" , func () {
@@ -60,6 +61,7 @@ var _ = Describe("PipelineConfig struct", func() {
6061 "StepGlobalVars" : "" ,
6162 "configLocation" : downloader .ResourceLocation ("123/workflows" ),
6263 "sonarqube" : nilStepConfig ,
64+ "RepoType" : "gitlab" ,
6365 "GitlabConnectionID" : "gitlabConnection" ,
6466 "test" : map [string ]interface {}{
6567 "enable" : emptyBool ,
@@ -89,6 +91,7 @@ var _ = Describe("PipelineConfig struct", func() {
8991 "ImageRepoSecret" : "IMAGE_REPO_SECRET" ,
9092 "ImageRepoDockerSecret" : "image-repo-auth" ,
9193 "StepGlobalVars" : "" ,
94+ "RepoType" : "gitlab" ,
9295 "imageRepo" : map [string ]interface {}{
9396 "url" : "exmaple.com" ,
9497 "user" : "test_user" ,
Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ func GetStepGlobalVars(repoInfo *git.RepoInfo) *StepGlobalVars {
4242 RepoType : repoInfo .RepoType ,
4343 }
4444 // config credentialID for jenkins if SSHPrivateKey is configured
45- if repoInfo .SSHPrivateKey != "" {
46- switch repoInfo . RepoType {
47- case "github" :
48- v . CredentialID = githubCredentialName
49- case "gitlab" :
45+ switch repoInfo .RepoType {
46+ case "github" :
47+ v . CredentialID = githubCredentialName
48+ case "gitlab" :
49+ if repoInfo . SSHPrivateKey != "" {
5050 v .CredentialID = gitlabCredentialName
5151 }
5252 }
You can’t perform that action at this time.
0 commit comments