DockerIgnoreStrategy Class
Ignores file paths based on the .dockerignore specification.
| Source | core/lib/fs/ignore.ts |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const dockerIgnoreStrategy = cdk.DockerIgnoreStrategy.docker('absoluteRootPath', ['patterns']);
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
docker_ignore_strategy = cdk.DockerIgnoreStrategy.docker("absoluteRootPath", ["patterns"])
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
DockerIgnoreStrategy dockerIgnoreStrategy = DockerIgnoreStrategy.docker("absoluteRootPath", List.of("patterns"));
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
var dockerIgnoreStrategy = DockerIgnoreStrategy.Docker("absoluteRootPath", new [] { "patterns" });
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
dockerIgnoreStrategy := cdk.DockerIgnoreStrategy_Docker(jsii.String("absoluteRootPath"), []*string{
jsii.String("patterns"),
})
Initializer
ts
new DockerIgnoreStrategy(absoluteRootPath: string, patterns: string[])
python
DockerIgnoreStrategy(absolute_root_path: str, patterns: typing.List[str])
java
new DockerIgnoreStrategy(String absoluteRootPath, List<String> patterns)
csharp
new DockerIgnoreStrategy(string absoluteRootPath, string[] patterns)
go
NewDockerIgnoreStrategy(AbsoluteRootPath *string, Patterns *[]*string)
Methods
add(pattern: string): voiddef add(self, pattern: str) -> Nonepublic void add(String pattern)public void Add(string pattern)func Add(Pattern *string) #Adds another pattern.
completelyIgnores(absoluteDirectoryPath: string): booleandef completely_ignores(self, absolute_directory_path: str) -> boolpublic Boolean completelyIgnores(String absoluteDirectoryPath)public bool CompletelyIgnores(string absoluteDirectoryPath)func CompletelyIgnores(AbsoluteDirectoryPath *string) *bool #Determines whether a given directory path should be ignored and have all of its children ignored.
1 parameter · returns
Parameters
absoluteDirectoryPathabsolute_directory_pathabsoluteDirectoryPathabsoluteDirectoryPathAbsoluteDirectoryPath— absolute directory path to be assessed against the pattern.
Returns: true if the directory and all of its children should be ignored
docker(absoluteRootPath: string, patterns: string[]): DockerIgnoreStrategy // chainable@staticmethod def docker(absolute_root_path: str, patterns: typing.List[str]) -> DockerIgnoreStrategypublic static DockerIgnoreStrategy docker(String absoluteRootPath, List<String> patterns)public static DockerIgnoreStrategy Docker(string absoluteRootPath, string[] patterns)func Docker(AbsoluteRootPath *string, Patterns *[]*string) DockerIgnoreStrategy static #Ignores file paths based on the `.dockerignore specification`.
1 parameter · returns
Parameters
absoluteRootPathabsolute_root_pathabsoluteRootPathabsoluteRootPathAbsoluteRootPath— the absolute path to the root directory of the paths to be considered.
Returns: DockerIgnorePattern associated with the given patterns.
fromCopyOptions(options: CopyOptions, absoluteRootPath: string): IgnoreStrategy@staticmethod def from_copy_options(options: CopyOptions, absolute_root_path: str) -> IgnoreStrategypublic static IgnoreStrategy fromCopyOptions(CopyOptions options, String absoluteRootPath)public static IgnoreStrategy FromCopyOptions(CopyOptions options, string absoluteRootPath)func FromCopyOptions(Options CopyOptions, AbsoluteRootPath *string) IgnoreStrategy static #Creates an IgnoreStrategy based on the `ignoreMode` and `exclude` in a `CopyOptions`.
2 parameters · returns
Parameters
optionsoptionsoptionsoptionsOptions— theCopyOptionsto create theIgnoreStrategyfrom.absoluteRootPathabsolute_root_pathabsoluteRootPathabsoluteRootPathAbsoluteRootPath— the absolute path to the root directory of the paths to be considered.
Returns: IgnoreStrategy based on the CopyOptions
git(absoluteRootPath: string, patterns: string[]): GitIgnoreStrategy@staticmethod def git(absolute_root_path: str, patterns: typing.List[str]) -> GitIgnoreStrategypublic static GitIgnoreStrategy git(String absoluteRootPath, List<String> patterns)public static GitIgnoreStrategy Git(string absoluteRootPath, string[] patterns)func Git(AbsoluteRootPath *string, Patterns *[]*string) GitIgnoreStrategy static #Ignores file paths based on the `.gitignore specification`.
1 parameter · returns
Parameters
absoluteRootPathabsolute_root_pathabsoluteRootPathabsoluteRootPathAbsoluteRootPath— the absolute path to the root directory of the paths to be considered.
Returns: GitIgnorePattern associated with the given patterns.
glob(absoluteRootPath: string, patterns: string[]): GlobIgnoreStrategy@staticmethod def glob(absolute_root_path: str, patterns: typing.List[str]) -> GlobIgnoreStrategypublic static GlobIgnoreStrategy glob(String absoluteRootPath, List<String> patterns)public static GlobIgnoreStrategy Glob(string absoluteRootPath, string[] patterns)func Glob(AbsoluteRootPath *string, Patterns *[]*string) GlobIgnoreStrategy static #Ignores file paths based on simple glob patterns.
1 parameter · returns
Parameters
absoluteRootPathabsolute_root_pathabsoluteRootPathabsoluteRootPathAbsoluteRootPath— the absolute path to the root directory of the paths to be considered.
Returns: GlobIgnorePattern associated with the given patterns.
ignores(absoluteFilePath: string): booleandef ignores(self, absolute_file_path: str) -> boolpublic Boolean ignores(String absoluteFilePath)public bool Ignores(string absoluteFilePath)func Ignores(AbsoluteFilePath *string) *bool #Determines whether a given file path should be ignored or not.
1 parameter · returns
Parameters
absoluteFilePathabsolute_file_pathabsoluteFilePathabsoluteFilePathAbsoluteFilePath— absolute file path to be assessed against the pattern.
Returns: true if the file should be ignored
none(): IgnoreStrategy@staticmethod def none() -> IgnoreStrategypublic static IgnoreStrategy none()public static IgnoreStrategy None()func None() IgnoreStrategy static #Return an IgnoreStrategy that does not ignore any files.