Merge pull request #329 from fluxcd/exclude-ci
Add well-known CI configs to exclusion list
This commit is contained in:
commit
df64bb0c3e
|
@ -42,9 +42,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
excludeFile = ".sourceignore"
|
excludeFile = ".sourceignore"
|
||||||
excludeVCS = ".git/,.gitignore,.gitmodules,.gitattributes"
|
excludeVCS = ".git/,.gitignore,.gitmodules,.gitattributes"
|
||||||
excludeExt = "*.jpg,*.jpeg,*.gif,*.png,*.wmv,*.flv,*.tar.gz,*.zip"
|
excludeExt = "*.jpg,*.jpeg,*.gif,*.png,*.wmv,*.flv,*.tar.gz,*.zip"
|
||||||
|
excludeCI = ".github/,.circleci/,.travis.yml,.gitlab-ci.yml,appveyor.yml,.drone.yml,cloudbuild.yaml,codeship-services.yml,codeship-steps.yml"
|
||||||
|
excludeExtra = "**/.goreleaser.yml,**/.sops.yaml,**/.flux.yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Storage manages artifacts
|
// Storage manages artifacts
|
||||||
|
@ -425,7 +427,8 @@ func loadExcludePatterns(dir string, ignore *string) ([]gitignore.Pattern, error
|
||||||
}
|
}
|
||||||
|
|
||||||
if ignore == nil {
|
if ignore == nil {
|
||||||
for _, p := range strings.Split(excludeExt, ",") {
|
all := strings.Join([]string{excludeExt, excludeCI, excludeExtra}, ",")
|
||||||
|
for _, p := range strings.Split(all, ",") {
|
||||||
ps = append(ps, gitignore.ParsePattern(p, path))
|
ps = append(ps, gitignore.ParsePattern(p, path))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,6 +206,8 @@ func TestArchiveIgnore(t *testing.T) {
|
||||||
"video.wmv",
|
"video.wmv",
|
||||||
"bar.png",
|
"bar.png",
|
||||||
"foo.zip",
|
"foo.zip",
|
||||||
|
".drone.yml",
|
||||||
|
".flux.yaml",
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is the table of ignored files and their values. true means that it's
|
// this is the table of ignored files and their values. true means that it's
|
||||||
|
|
|
@ -114,9 +114,13 @@ in a gzip compressed TAR archive (`<bucket checksum>.tar.gz`).
|
||||||
|
|
||||||
### Excluding files
|
### Excluding files
|
||||||
|
|
||||||
Git files (`.git/`, `.gitignore`, `.gitmodules`, and `.gitattributes`) are
|
The following files and extensions are excluded from the archive by default:
|
||||||
excluded from the archive by default, as well as some extensions (`.jpg, .jpeg,
|
|
||||||
.gif, .png, .wmv, .flv, .tar.gz, .zip`)
|
- Git files (`.git/ ,.gitignore, .gitmodules, .gitattributes`)
|
||||||
|
- File extensions (`.jpg, .jpeg, .gif, .png, .wmv, .flv, .tar.gz, .zip`)
|
||||||
|
- CI configs (`.github/, .circleci/, .travis.yml, .gitlab-ci.yml, appveyor.yml, .drone.yml, cloudbuild.yaml, codeship-services.yml, codeship-steps.yml`)
|
||||||
|
- CLI configs (`.goreleaser.yml, .sops.yaml`)
|
||||||
|
- Flux v1 config (`.flux.yaml`)
|
||||||
|
|
||||||
Excluding additional files from the archive is possible by adding a
|
Excluding additional files from the archive is possible by adding a
|
||||||
`.sourceignore` file in the root of the bucket. The `.sourceignore` file
|
`.sourceignore` file in the root of the bucket. The `.sourceignore` file
|
||||||
|
|
|
@ -149,9 +149,13 @@ gzip compressed TAR archive (`<commit hash>.tar.gz`).
|
||||||
|
|
||||||
### Excluding files
|
### Excluding files
|
||||||
|
|
||||||
Git files (`.git/`, `.gitignore`, `.gitmodules`, and `.gitattributes`) are
|
The following files and extensions are excluded from the archive by default:
|
||||||
excluded from the archive by default, as well as some extensions (`.jpg, .jpeg,
|
|
||||||
.gif, .png, .wmv, .flv, .tar.gz, .zip`)
|
- Git files (`.git/ ,.gitignore, .gitmodules, .gitattributes`)
|
||||||
|
- File extensions (`.jpg, .jpeg, .gif, .png, .wmv, .flv, .tar.gz, .zip`)
|
||||||
|
- CI configs (`.github/, .circleci/, .travis.yml, .gitlab-ci.yml, appveyor.yml, .drone.yml, cloudbuild.yaml, codeship-services.yml, codeship-steps.yml`)
|
||||||
|
- CLI configs (`.goreleaser.yml, .sops.yaml`)
|
||||||
|
- Flux v1 config (`.flux.yaml`)
|
||||||
|
|
||||||
Excluding additional files from the archive is possible by adding a
|
Excluding additional files from the archive is possible by adding a
|
||||||
`.sourceignore` file in the root of the repository. The `.sourceignore` file
|
`.sourceignore` file in the root of the repository. The `.sourceignore` file
|
||||||
|
|
Loading…
Reference in New Issue