From bb1ce61067f65ad10a7d0f67a4b52cb9a96be022 Mon Sep 17 00:00:00 2001 From: Nick Cross Date: Tue, 24 Dec 2024 11:24:05 +0000 Subject: [PATCH] Add logging. Remove debug. Fix source path --- deploy/tasks/pre-build-git.yaml | 2 +- .../main/java/com/redhat/hacbs/container/deploy/git/Git.java | 2 ++ pkg/reconciler/dependencybuild/buildrecipeyaml.go | 3 --- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/deploy/tasks/pre-build-git.yaml b/deploy/tasks/pre-build-git.yaml index 35d876143..5348c9ed3 100644 --- a/deploy/tasks/pre-build-git.yaml +++ b/deploy/tasks/pre-build-git.yaml @@ -83,7 +83,7 @@ spec: key: gitdeploytoken args: - deploy-pre-build-source - - --source-path=$(workspaces.source.path)/source + - --source-path=/var/workdir - --task-run-name=$(context.taskRun.name) - --scm-uri=$(params.SCM_URL) - --scm-commit=$(params.SCM_HASH) diff --git a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/git/Git.java b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/git/Git.java index d733410d5..32cbfc93e 100644 --- a/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/git/Git.java +++ b/java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/deploy/git/Git.java @@ -127,6 +127,7 @@ protected GitStatus pushRepository(Path path, String httpTransportUrl, String co //var tagNameFromDescribe = jGit.describe().setTags(true).setTarget(commit).call(); var objectId = ObjectId.fromString(commit); var jRepo = jGit.getRepository(); + Log.infof("### Git repository %s " , jGit.getRepository().getDirectory() ); if (new File(jGit.getRepository().getDirectory(), "shallow").exists()) { Log.warnf("Git repository is shallow repository - converting."); jGit.fetch().setUnshallow(true).call(); @@ -146,6 +147,7 @@ protected GitStatus pushRepository(Path path, String httpTransportUrl, String co } var branchName = tagName + "-jbs-branch"; var createBranch = jGit.branchList().call().stream().map(Ref::getName).noneMatch(("refs/heads/" + branchName)::equals); + Log.infof("Will create branch %s for tag %s and branch name %s", createBranch, tagName, branchName); var ref = jGit.checkout().setStartPoint(tagName).setName(branchName).setCreateBranch(createBranch).call(); StoredConfig jConfig = jRepo.getConfig(); Log.infof("Updating current origin of %s to %s", jConfig.getString("remote", "origin", "url"), diff --git a/pkg/reconciler/dependencybuild/buildrecipeyaml.go b/pkg/reconciler/dependencybuild/buildrecipeyaml.go index 1388451f5..0c56a3b3b 100644 --- a/pkg/reconciler/dependencybuild/buildrecipeyaml.go +++ b/pkg/reconciler/dependencybuild/buildrecipeyaml.go @@ -433,7 +433,6 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi }, }, }} - fmt.Printf("### RECIPE : DISABLEDPLUGINS %#v \n", recipe.DisabledPlugins) pipelinePreBuildGitTask := []tektonpipeline.PipelineTask{{ Name: PreBuildGitTaskName, RunAfter: []string{PreBuildTaskName}, @@ -507,7 +506,6 @@ func createPipelineSpec(log logr.Logger, tool string, commitTime int64, jbsConfi }, }, }} - fmt.Printf("### prebuildgit %#v \n", pipelinePreBuildGitTask) ps.Tasks = append(pipelineGitTask, ps.Tasks...) ps.Tasks = append(pipelinePreBuildTask, ps.Tasks...) ps.Tasks = append(pipelinePreBuildGitTask, ps.Tasks...) @@ -806,7 +804,6 @@ use-archive oci:$URL@$AARCHIVE=%s`, orasOptions, registryArgsWithDefaults(jbsCon ps.Tasks[index].Params = append(ps.Tasks[index].Params, tektonpipeline.Param{ Name: i.Name, Value: value}) - fmt.Printf("### index %s and params %#v \n ", ps.Tasks[index].Params) index += 1 ps.Tasks[index].Params = append(ps.Tasks[index].Params, tektonpipeline.Param{ Name: i.Name,