Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using dploy with preprocessors #72

Open
habovh opened this issue Feb 2, 2015 · 8 comments
Open

Using dploy with preprocessors #72

habovh opened this issue Feb 2, 2015 · 8 comments
Milestone

Comments

@habovh
Copy link

habovh commented Feb 2, 2015

Hi, I really like dploy, but I have one question.
If I work with preprocessors like SASS/SCSS, Compass, CoffeeScript, Jade, etc, how am I supposed to deploy a website while the output of these tools is not pushed to the git repository?
It would be nice to have some kind of "map" that can track GIT source files to output files, so they can be uploaded if their corresponding source file has been updated in GIT. The current workaround I am using is the "include" directive, but it is pretty straight-forward, and not really efficient for this case...

@enzy
Copy link

enzy commented Feb 11, 2015

What about some deploy repository or branch where you would track a builded project state?
FYI: I'm using include directive atm too.

@habovh
Copy link
Author

habovh commented Feb 11, 2015

What about some deploy repository or branch where you would track a builded project state?

That is not a viable solution.

Let's imagine I have a builded state branch, whenever I want to catchup from master I'll need to rebase it, and I can't have 2 different .gitignore files that will both exist in the builded state branch and the master branch : whenever I would rebase, the .gitignore file in the builded state branch will be modified.

@lucasmotta
Copy link
Owner

@toborrow @enzy at the moment you cannot do that, because if a file is not being tracked by git, there's no way to tell if a file has changed or not. So you have to use the "include" option.
In other hand, I really like the idea to create a "mapping" option so you can connect your source files to your output files. Something like this:

map:
  "source/coffee/*.coffee": "release/js/app.js"
  "source/template/*.jade": "release/js/app.js"
  "source/stylus/*.styl": "release/css/app.css"

So this way, if you change any of your Coffee or Jade files, we upload the app.js. And if you change any of your Stylus files, we upload the app.css.

Does that makes sense? Would you need more options to the mapping maybe, like setting the remote path for your mapped file (similar to the include option)?

Well, let me know your thought on this! But I'm excited with this suggestion :)

@habovh
Copy link
Author

habovh commented Feb 26, 2015

Hey!

Glad you like the idea! Really!

General idea

The Mapping idea seems good, but the user should be warned to first compile the corresponding source files, otherwise if we admit that the source changed, has been committed, but didn't go through a compilation process, then the files would be uploaded "as is" and there is no guarantee that the files sent over the server are actually corresponding to the rev.

To workaround this "side effect", I would suggest to also add an option when using dploy that would only send files that are handled by the map setting. Ok, this would send every file mapped, but would be nice in case we deployed without compiling, just to catch up without having to do another blank commit.

About file path

I would like to know if it is possible to upload only one file, among many in the same folder, but using the * and ** tokens in the file path.
Let's say I have the following file structure (with source files and output ones) :

.
├── index.html
├── index.jade
└── javascript
    ├── app.coffee
    ├── controller
    │   ├── AppCtrl.coffee
    │   ├── AuthCtrl.coffee
    │   ├── ChooseCtrl.coffee
    │   ├── MapCtrl.coffee
    │   └── ResultsCtrl.coffee
    ├── dist
    │   ├── app.js
    │   ├── controller
    │   │   ├── AppCtrl.js
    │   │   ├── AuthCtrl.js
    │   │   ├── ChooseCtrl.js
    │   │   ├── MapCtrl.js
    │   │   └── ResultsCtrl.js
    │   └── service
    │       └── CheckToken.js
    └── service
        └── CheckToken.coffee

What would be nice, is that I set something like:

map:
  "javascript/**/*.coffee": "javascript/dist/**/*.js"
  "index.jade": "index.html"

And then, that Dploy would upload any corresponding file that has been modified since rev from the source map, and place it in the distant folder/subfolder (creating any necessary subfolder) using the same filename, but different extension. I'm unsure about if it is currently possible. You'll know better than me ;-)

What do you think? Is that possible? Does it seem user-friendly? I would definitely use deploy more often!

@lucasmotta
Copy link
Owner

Hey @habovh and @enzy – I'm happy to say that the new DPLOY will support this feature!
It's still under development, but it's pretty much stable at the moment.

If you want to give it a try on the beta, use this branch then:
https://github.com/LeanMeanFightingMachine/dploy/tree/v2-beta

@lucasmotta lucasmotta added this to the version 2 milestone Jun 18, 2015
@habovh
Copy link
Author

habovh commented Jun 18, 2015

That's really great! I'll definitely try it later today!

@mattfelten
Copy link

How does this work with, let's say, a Jekyll site? Basically where everything would need to be mapped to a _build dir including images. I'm assuming it would be something like:

map:
  "**/*.html": "_build/**/*.html"
  "layout/*.html": "_build/**/*.html"

But not really sure if there's a simpler way of doing this without listing out each type of file

@illycz
Copy link

illycz commented Oct 18, 2016

Map feature looks great. I have only one question @lucasmotta

You asked here: #72 (comment)

"Does that makes sense? Would you need more options to the mapping maybe, like setting the remote path for your mapped file (similar to the include option)?"

Is this feature implemented within map?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants