1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-11-06 09:09:19 +02:00

fix(cnbBuild): use relative path for filtering files (#3278)

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
This commit is contained in:
Pavel Busko
2021-11-12 15:31:54 +01:00
committed by GitHub
parent 54479f7255
commit a748c533a2
5 changed files with 44 additions and 18 deletions

View File

@@ -156,7 +156,12 @@ func copyFile(source, target string, utils cnbutils.BuildUtils) error {
func copyProject(source, target string, include, exclude *ignore.GitIgnore, utils cnbutils.BuildUtils) error {
sourceFiles, _ := utils.Glob(path.Join(source, "**"))
for _, sourceFile := range sourceFiles {
if !isIgnored(sourceFile, include, exclude) {
relPath, err := filepath.Rel(source, sourceFile)
if err != nil {
log.SetErrorCategory(log.ErrorBuild)
return errors.Wrapf(err, "Calculating relative path for '%s' failed", sourceFile)
}
if !isIgnored(relPath, include, exclude) {
target := path.Join(target, strings.ReplaceAll(sourceFile, source, ""))
dir, err := isDir(sourceFile)
if err != nil {
@@ -391,7 +396,7 @@ func runCnbBuild(config *cnbBuildOptions, telemetryData *telemetry.CustomData, u
}
utils.AppendEnv([]string{fmt.Sprintf("SSL_CERT_FILE=%s", caCertificates)})
} else {
log.Entry().Info("skipping updation of certificates")
log.Entry().Info("skipping certificates update")
}
err = utils.RunExecutable(detectorPath, "-buildpacks", buildpacksPath, "-order", orderPath, "-platform", platformPath)