Issue
Is it possible to use composer's archive feature to compress a project locally (similar to using zip)? For instance, I tried composer archive my-repo/project --format=zip --file test-archive
. It worked in the sense that it created a zip file called test-archive
, but composer did it by first going to my satis repo and pulling down a copy of the project.
I also have this defined in my composer.json
"archive": {
"exclude": [
".*",
"!.gitignore",
"node_modules/",
"vendor/",
"www/",
"composer/",
"*.lst",
"*.yml"
]
}
What I'm trying to do is use the archive feature as part of a bitbucket pipelines build process. The goal is to compress the project files (excluding some) and pass them to the Downloads page for the bitbucket repo. I have a working step using zip, but archive uses a better syntax for excluding files.
Solution
Ok - now I feel a little silly, but since someone kindly upvoted the question, I'll answer it. The documentation was slightly confusing to me. Composer doesn't actually need my-repo/project
to compress the file correctly. So if you do composer archive --format=zip --file test-archive
it will compress in place at the root of your project.
Answered By - aberkow
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.