Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt Whetton 19 posts 61 karma points
    Jan 08, 2014 @ 17:39
    Matt Whetton
    0

    Trigger export from command line or api call

    Is there any way I can trigger an export from either a command line call, powershell script or even api call (c#)?

    I'm basically trying to ensure an export happens every time I compile my project in visual studio.

    Matt

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Jan 09, 2014 @ 15:04
    Kevin Jump
    0

    HI

    not sure about command line, but you can start a sync by calling the class.

    using jumps.umbraco.usync;   
    

    .

    uSync u = new uSync();
    u.ReadAllFromDisk();
    

    the latest version (1.5.8) also has ability to watch for file changes. set watchFolder to true in the usyncsettings.config and it will run the sync when ever files inside the usync folder are changed by something other than usync.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Jan 09, 2014 @ 15:18
    Kevin Jump
    0

    yep and sorry just noticed that is performing an import - an export is

    u.SaveAllToDisk()

    however everytime you compile your VS project the app pool will restart, and the sync will run anyway. if you want it to always do a full write out on application start you can set write=true in the settings file - but unless you are chaning db values without going via umbraco UI this doesn't add much.

  • Matt Whetton 19 posts 61 karma points
    Jan 09, 2014 @ 15:38
    Matt Whetton
    0

    Thanks for the input

    I'm basically trying to get a workable development workflow (with source control) together for a team development environment. We are about to start a project with umbraco 7, and I'm really struggling to find a solution that I'm happy with. 

    uSync seems like the best option right now - but the 2 things I'm struggling with is

    1. Every time somebody updates a view / template via visual studio, we would have to trigger uSync to export somehow
    2. If somebody gets latest from source control, how to ensure that whatever is in the usync is sync'd to their umbraco instance 
    Maybe the watchFolder option might help with number 2, and we can work around number 1. Which element does the watchFolder attribute get set on, I cant see any documentation regarding it.
    I'm happy to tak suggestions though!
  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Jan 09, 2014 @ 15:46
    Kevin Jump
    0

    All that really matters is that views/templates are first created in umbraco because they are given an id, but the content of the files (after create) lives on the disk so a developer editing one of these files in vs and checking it in should have no problems.

    Usync was written to be checked into source control keeping the usync foldt as part of your source control should be enough to keep things in sync.

    You can turn each type of sync on or off in the concept g so if for example if you dont want usync to do anything with stylesheets you can turn it off.

    Basic check in rule - always make sure your local site runs before checking in - then you dont get errors and usync will have ran at startup.?

    Yeah as it evolved some of the documentation laged behind - the config file is the best place to look at the moment.

  • Matt Whetton 19 posts 61 karma points
    Jan 09, 2014 @ 16:09
    Matt Whetton
    0

    Great thanks - understand whats going on now and its doing just what we need!

Please Sign in or register to post replies

Write your reply to:

Draft