Cannot exclude files during terraform module publish
cdivitotawela opened this issue · 2 comments
Describe the bug
Using following command to publish a terraform module and want to exclude .git and .github directories. Published module zip file contains the excluded directories.
jf terraform publish --namespace mynamespace --provider azurerm --tag 'v0.0.8' --exclusions "\*.git\*"
Tried different options --exclusions '.git;.github'
and none seems to be working.
I can see DEBUG logs indicate it ignored .git directory but it is still included.
09:30:50 [Debug] Sending HTTP GET request to: https://mynamespace.jfrog.io/artifactory/api/system/version
09:30:50 [Debug] The path '/Users/***/github/***/***/.DS_Store' is excluded
09:30:50 [Debug] The path '/Users/***/github/***/***/.git' is excluded
Following instruction in https://docs.jfrog-applications.jfrog.io/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory/package-managers-integration#terraform-publish example 2
Current behavior
Cannot exclude files using --exclusions
when publishing terraform module
Reproduction steps
- Create a simple terraform module in a git repository and run following command to exclude the .git folder
jf terraform publish --namespace mynamespace --provider azurerm --tag 'v0.0.8' --exclusions "\*.git\*"
- Check the zip file content in Artifactory portal and .git folder is included in the zip file
Expected behavior
Any file, directory added in --exclusions
argument must be excluded from the zip file uploaded to Artifactory
JFrog CLI version
jf version 2.56.0
Operating system type and version
OSX
JFrog Artifactory version
Cloud
JFrog Xray version
No response
Having the same issue. Trying to eclude .git, .github, .terraform. The only thing that works is using , which, in our use case, excludes things we intend to keep in a couple of cases
Same issue here - my intended workaround is to use rsync
to copy the directory to somewhere else but excluding the files I don't want, and then using jf
to upload the temporary directory which has already been sanitised. But this is a frustrating bug, especially since the documentation states explicitly that this is possible in the last paragraph.