Closed asakin closed 10 years ago
Nice!
The readme gives the impression that the filesToMove
is optional, but won't this error out if that key isn't in the config?
Thanks!
The parameters are in fact optional. The lines
filesToMove = app.fetch("filesToMove", ["js/*.js", "css/*.css"])
createDirectories = app.fetch("createDirectories", false)
defaults both parameters to the old behaviour if they are not found by the fetch function.
Ariel
As discussed with @theotherzach earlier (and posting here for permanence!) I think the default for filesToMove
ought to be everything under dist/
. IMO, lineman should be concerned with creating a dist directory that is ready for deployment as-is. The desired folder structure for deployment ought to be created by lineman itself. In this manner, deployment simply becomes a matter of deciding where a lineman-built-application should be deployed. (as opposed to which pieces.)
Thanks @jasonkarns, I agree with your approach. What do you think about the following solution:
filesToMove
to be called artifacts
or filesToDeploy
and have a default value of ["*"](including folders)createDirectories
to be removed and be always true, assuming that whatever you chose to deploy is lineman's problem (do you think it should be optional? I think there's nothing wrong with it just being always true)overwriteExistingFiles
to be added with default true, allowing someone to have files in his public
folder that are not overwritten by the lineman app (for example, a different index.html)Thanks, Ariel
filesToMove to be called artifacts or filesToDeploy and have a default value of "*"
I like filesToDeploy
createDirectories to be removed and be always true, assuming that whatever you chose to deploy is lineman's problem (do you think it should be optional? I think there's nothing wrong with it just being always true)
agreed. Lineman shouldn't be creating directories that aren't wanted/needed in prod
overwriteExistingFiles to be added with default true, allowing someone to have files in his public folder that are not overwritten by the lineman app (for example, a different index.html)
agreed
The move should be recursive and not fail when a directory is already there (and overwrite files as needed)
agreed
I'm quite agreeable today, it seems.
Agree with the sentiment, jason
On Jul 30, 2013, at 1:28 AM, Jason Karns notifications@github.com wrote:
As discussed with @theotherzach earlier (and posting here for permanence!) I think the default for filesToMove ought to be everything under dist/. IMO, lineman should be concerned with creating a dist directory that is ready for deployment as-is. The desired folder structure for deployment ought to be created by lineman itself. In this manner, deployment simply becomes a matter of deciding where a lineman-built-application should be deployed. (as opposed to which pieces.)
\ Reply to this email directly or view it on GitHub.
Hi, I updated the code. Let me know what you think
Thanks! Ariel
Great! Let me do a dry run deploy against this code for the app we have in production. Once that looks good, I'll merge it in.
I'm having some trouble with this build pack. Here is my config:
{
"linemanApps": [
{
"type": "file",
"location": "frontend",
"installToPath": "lib/app/public",
"filesToMove" : ["js/*.js", "css/*.css"]
}
]
}
And I get this error:
mv: cannot move `/tmp/build_8gcdtjjkkmcm/frontend/dist/css' to `lib/app/public/./css': Directory not empty
mv: cannot move `/tmp/build_8gcdtjjkkmcm/frontend/dist/js' to `lib/app/public/./js': Directory not empty
Problem was on my end.
Looks good and thanks for the hard work!
@asakin If you were not aware (and I was not until recently) you can ignore files on a per project basis via the .git/info/exclude
file.
Also, for system-wide ignores, you can configure via ~/.gitconfig
Thanks, I'll do that!
Added two configuration items to lineman.json
filesToMove
contains a list of paths for files that need to be moved into the target folder.createDirectories
tells the compiler to create the target directories if they don't exist.This allows to manage images and html assets in lineman as well.
Thanks, Ariel Sakin