Exemplo n.º 1
0
        /// <summary>
        /// Any values.yaml files in any packages referenced by the step will automatically have variable substitution applied
        /// </summary>
        IEnumerable <string> DefaultValuesFiles()
        {
            var packageReferenceNames = variables.GetIndexes(PackageVariables.PackageCollection);

            foreach (var packageReferenceName in packageReferenceNames)
            {
                yield return(Path.Combine(PackageDirectory(packageReferenceName), "values.yaml"));
            }
        }
Exemplo n.º 2
0
        private IEnumerable <string> FileTargetFactory()
        {
            var packageReferenceNames = variables.GetIndexes(PackageVariables.PackageCollection);

            foreach (var packageReferenceName in packageReferenceNames)
            {
                var sanitizedPackageReferenceName = fileSystem.RemoveInvalidFileNameChars(packageReferenceName);
                var paths = variables.GetPaths(SpecialVariables.Helm.Packages.ValuesFilePath(packageReferenceName));

                foreach (var path in paths)
                {
                    yield return(Path.Combine(sanitizedPackageReferenceName, path));
                }
            }
        }
Exemplo n.º 3
0
        IEnumerable <string> FileTargetFactory()
        {
            var packageReferenceNames = variables.GetIndexes(PackageVariables.PackageCollection);

            foreach (var packageReferenceName in packageReferenceNames)
            {
                var packageRoot = packageReferenceName;
                if (string.IsNullOrEmpty(packageReferenceName))
                {
                    packageRoot = variables.Get(PackageVariables.IndexedPackageId(packageReferenceName));
                }
                var sanitizedPackageReferenceName = fileSystem.RemoveInvalidFileNameChars(packageRoot ?? String.Empty);

                yield return(Path.Combine(sanitizedPackageReferenceName, "values.yaml"));

                var paths = variables.GetPaths(SpecialVariables.Helm.Packages.ValuesFilePath(packageReferenceName));

                foreach (var path in paths)
                {
                    yield return(Path.Combine(sanitizedPackageReferenceName, path));
                }
            }
        }
        string CustomHelmExecutableFullPath(IVariables variables, string workingDirectory)
        {
            var helmExecutable = variables.Get(SpecialVariables.Helm.CustomHelmExecutable);

            if (!string.IsNullOrWhiteSpace(helmExecutable))
            {
                if (variables.GetIndexes(PackageVariables.PackageCollection)
                    .Contains(SpecialVariables.Helm.Packages.CustomHelmExePackageKey) && !Path.IsPathRooted(helmExecutable))
                {
                    var fullPath = Path.GetFullPath(Path.Combine(workingDirectory, SpecialVariables.Helm.Packages.CustomHelmExePackageKey, helmExecutable));
                    log.Info(
                        $"Using custom helm executable at {helmExecutable} from inside package. Full path at {fullPath}");

                    return(fullPath);
                }
                else
                {
                    log.Info($"Using custom helm executable at {helmExecutable}");
                    return(helmExecutable);
                }
            }

            return(null);
        }