Skip to content

Commit

Permalink
Patched code
Browse files Browse the repository at this point in the history
Signed-off-by: jagpreetsinghsasan <[email protected]>
  • Loading branch information
jagpreetsinghsasan committed Apr 29, 2024
1 parent 5dca1b1 commit e5cace0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions examples/bevel/configure/configure_local_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,27 @@ import (
)

const (
BevelRemoteUrl = "https://github.com/hyperledger/bevel.git"
BevelRemoteUrl = "https://github.com/hyperledger/bevel.git"
BevelRemoteName = "BevelRemoteForCacti"
BevelBranchName = "cactibevelexample"
)

func DownloadBevelRepo(gitUrl string, gitUsername string, gitToken string, logger *zap.Logger){
func DownloadBevelRepo(gitUrl string, gitUsername string, gitToken string, logger *zap.Logger) {
logger.Info("Deleting any previous instances of repository present on the ./repo path")
errRemoveRepo := os.RemoveAll("./repo")
if errRemoveRepo != nil {
logger.Error(fmt.Sprint(errRemoveRepo))
}


logger.Info("Cloning the bevel repository")
_, err := git.PlainClone("repo", false, &git.CloneOptions{
URL: gitUrl,
URL: gitUrl,
Auth: &http.BasicAuth{
Username: gitUsername,
Password: gitToken,
},
Progress: os.Stdout,
})
Progress: os.Stdout,
})

if err != nil {
logger.Error(fmt.Sprint(err))
Expand All @@ -41,7 +40,11 @@ func DownloadBevelRepo(gitUrl string, gitUsername string, gitToken string, logge

func CreateBranchFromBevelRemote(logger *zap.Logger) {
utils.ExecuteCmd([]string{"git", "-C", "./repo/", "remote", "add", "bevel", BevelRemoteUrl}, false, logger)
utils.ExecuteCmd([]string{"git", "-C", "./repo/", "fetch", "bevel", "tag", "v1.0.0.0", "--no-tags"}, false, logger)
utils.ExecuteCmd([]string{"git", "-C", "./repo/", "checkout", "-b", BevelBranchName, "v1.0.0.0"}, false, logger)
// utils.ExecuteCmd([]string{"git", "-C", "./repo/", "fetch", "bevel", "tag", "v1.0.0.0", "--no-tags"}, false, logger)
// utils.ExecuteCmd([]string{"git", "-C", "./repo/", "checkout", "-b", BevelBranchName, "v1.0.0.0"}, false, logger)
// utils.ExecuteCmd([]string{"git", "-C", "./repo/", "push", "--set-upstream", "origin", "cactibevelexample", "--force"}, true, logger)
utils.ExecuteCmd([]string{"git", "-C", "./repo/", "fetch", "bevel", "main"}, false, logger)
utils.ExecuteCmd([]string{"git", "-C", "./repo/", "checkout", "-b", BevelBranchName}, false, logger)
utils.ExecuteCmd([]string{"git", "-C", "./repo/", "reset", "--hard", "bevel/main"}, false, logger)
utils.ExecuteCmd([]string{"git", "-C", "./repo/", "push", "--set-upstream", "origin", "cactibevelexample", "--force"}, true, logger)
}
}
2 changes: 1 addition & 1 deletion examples/bevel/prequisites/setup_k8ind.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func KindConfig(logger *zap.Logger) {
if err != nil {
logger.Fatal("Error during parsing the kind config file", zap.Any("ERROR", err))
}
err = kindTemplate.Execute(&KindConfigFile, KindClusterConfig{ControlPlaneCount: 1, WorkerNodeCount: 3})
err = kindTemplate.Execute(&KindConfigFile, KindClusterConfig{ControlPlaneCount: 1, WorkerNodeCount: 7})
if err != nil {
logger.Fatal("Error during executing the tpl file with vars", zap.Any("ERROR", err))
}
Expand Down

0 comments on commit e5cace0

Please sign in to comment.