Skip to content

Commit 3812ea2

Browse files
fix: job trigger fail (#3383)
* no rows error fix * fix
1 parent 81d5b92 commit 3812ea2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/pipeline/CiService.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/devtron-labs/devtron/pkg/pipeline/repository"
2828
repository2 "github.com/devtron-labs/devtron/pkg/plugin/repository"
2929
"github.com/devtron-labs/devtron/pkg/user"
30+
"github.com/go-pg/pg"
3031
"path/filepath"
3132
"strconv"
3233
"strings"
@@ -435,10 +436,13 @@ func (impl *CiServiceImpl) buildWfRequestForCiPipeline(pipeline *pipelineConfig.
435436
return nil, errors.New("error while parsing ci build config")
436437
}
437438
buildContextCheckoutPath, err := impl.ciPipelineMaterialRepository.GetCheckoutPath(ciBuildConfigBean.BuildContextGitMaterialId)
438-
if err != nil {
439+
if err != nil && err != pg.ErrNoRows {
439440
impl.Logger.Errorw("error occurred while getting checkout path from git material", "gitMaterialId", ciBuildConfigBean.BuildContextGitMaterialId, "error", err)
440441
return nil, err
441442
}
443+
if buildContextCheckoutPath == "" {
444+
buildContextCheckoutPath = checkoutPath
445+
}
442446
if ciBuildConfigBean.CiBuildType == bean2.SELF_DOCKERFILE_BUILD_TYPE || ciBuildConfigBean.CiBuildType == bean2.MANAGED_DOCKERFILE_BUILD_TYPE {
443447
ciBuildConfigBean.DockerBuildConfig.BuildContext = filepath.Join(buildContextCheckoutPath, ciBuildConfigBean.DockerBuildConfig.BuildContext)
444448
dockerBuildConfig := ciBuildConfigBean.DockerBuildConfig

0 commit comments

Comments
 (0)