예제 #1
0
        public bool KuduSync(KuduSyncOptions opts)
        {
            string id = Config.DefaultPublisherId;
            string comment;

            var kuduUser = Environment.GetEnvironmentVariable("KUDU_DEPLOYER");

            if (!String.IsNullOrEmpty(kuduUser))
            {
                var deploymentBranch = Environment.GetEnvironmentVariable("deployment_branch");
                comment = String.Format("From branch {0} by user {1}", deploymentBranch, kuduUser);
            }
            else
            {
                id      = "MachineName-" + Environment.MachineName;
                comment = String.Format("Deployed by {0} on machine {1}", Environment.UserName, Environment.MachineName);
            }

            Config.GitRepositoryDirectory = new DirectoryInfo(opts.To);
            InitializeSyncState(new CmdArgsInitalizeSyncState());
            PublishDirectory(new CmdArgsPublishDirectory()
            {
                Path    = opts.From,
                Ignore  = opts.Ignore,
                Comment = comment
            });
            SyncSubscriber(new CmdArgsSubIdOpt());
            WatchSyncState(new CmdArgsWatchSyncState()
            {
                PollInterval = 15
            });
            return(true);
        }
예제 #2
0
 public CmdVerbs()
 {
     GetToolVersion          = new CmdArgsGetToolVersion();
     NewSubscriber           = new CmdArgsNewSub();
     GetSubscriber           = new CmdArgsSubIdOpt();
     RemoveSubscriber        = new CmdArgsSubIdReq();
     SyncSubscriber          = new CmdArgsSubIdOpt();
     PublishDirectory        = new CmdArgsPublishDirectory();
     SyncDirectory           = new CmdArgsSyncDirectory();
     InitalizeSyncState      = new CmdArgsInitalizeSyncState();
     KuduSync                = new KuduSyncOptions();
     GetHelp                 = new CmdArgsGetHelpCommand();
     SetSubscriberSiteStatus = new CmdArgsSetSubscriberSiteStatus();
     WatchSyncState          = new CmdArgsWatchSyncState();
 }