-
Notifications
You must be signed in to change notification settings - Fork 7
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 #231 from l3montree-dev/fix/autoSetup
Refactor GitLab integration to accept GitLab URL and update pipeline templates
- Loading branch information
Showing
5 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ import ( | |
"github.com/go-git/go-git/v5/plumbing/transport/http" | ||
) | ||
|
||
func setupAndPushPipeline(accessToken string, projectName string, templatePath string) error { | ||
func setupAndPushPipeline(accessToken string, gitlabUrl string, projectName string, templatePath string) error { | ||
dir, err := os.MkdirTemp("", "repo-clone") | ||
if err != nil { | ||
return fmt.Errorf("could not create temporary directory: %v", err) | ||
|
@@ -24,10 +24,8 @@ func setupAndPushPipeline(accessToken string, projectName string, templatePath s | |
} | ||
|
||
r, err := git.PlainClone(dir, false, &git.CloneOptions{ | ||
//URL: "[email protected]:" + projectName + ".git", | ||
URL: "https://gitlab.com/" + projectName + ".git", | ||
URL: gitlabUrl + "/" + projectName + ".git", | ||
Auth: authentication, | ||
//URL: "https://gitlab.com/l3montree/bachelorarbeit.git", | ||
}) | ||
if err != nil { | ||
return fmt.Errorf("could not clone repository: %v", err) | ||
|
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,9 +1,9 @@ | ||
stages: | ||
- build | ||
- test | ||
- build | ||
- test | ||
|
||
include: | ||
- component: $CI_SERVER_FQDN/l3montree/devguard/sca@~latest | ||
inputs: | ||
asset_name: "$DEVGUARD_ASSET_NAME" | ||
token: "$DEVGUARD_TOKEN" | ||
- remote: "https://gitlab.com/l3montree/devguard/-/raw/main/templates/container-scanning.yml" | ||
inputs: | ||
asset_name: "$DEVGUARD_ASSET_NAME" | ||
token: "$DEVGUARD_TOKEN" |
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,10 +1,10 @@ | ||
stages: | ||
- build | ||
- test | ||
- deploy | ||
- build | ||
- test | ||
- deploy | ||
|
||
include: | ||
- component: $CI_SERVER_FQDN/l3montree/devguard/full@~latest | ||
inputs: | ||
asset_name: "$DEVGUARD_ASSET_NAME" | ||
token: "$DEVGUARD_TOKEN" | ||
- remote: "https://gitlab.com/l3montree/devguard/-/raw/main/templates/full.yml" | ||
inputs: | ||
asset_name: "$DEVGUARD_ASSET_NAME" | ||
token: "$DEVGUARD_TOKEN" |
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,8 +1,8 @@ | ||
stages: | ||
- test | ||
- test | ||
|
||
include: | ||
- component: $CI_SERVER_FQDN/l3montree/devguard/software-composition-analysis@~latest | ||
inputs: | ||
asset_name: "$DEVGUARD_ASSET_NAME" | ||
token: "$DEVGUARD_TOKEN" | ||
- remote: "https://gitlab.com/l3montree/devguard/-/raw/main/templates/software-composition-analysis.yml" | ||
inputs: | ||
asset_name: "$DEVGUARD_ASSET_NAME" | ||
token: "$DEVGUARD_TOKEN" |