public void DeleteApplication(string ownerName, string name)
        {
            var command = CreateCommand(AppsCommand, $"delete --app \"{ownerName}/{name}\"");

            BashHelper.ExecuteBashCommandWithConfirmation(command);
            ApplicationsChanged?.Invoke(this, new EventArgs());
        }
Beispiel #2
0
        bool GitRepoIsNotBlank(string solutionFullPath)
        {
            var executionResult             = BashHelper.ExecuteBashCommand($"cd {solutionFullPath};git log --oneline | wc -l");
            var commitsNumberBiggerThanZero = int.Parse(executionResult.output.Trim()) > 0;

            return(executionResult.code == 0 && commitsNumberBiggerThanZero);
        }
Beispiel #3
0
        protected override void Run()
        {
            using (var monitor = IdeApp.Workbench.ProgressMonitors.GetToolOutputProgressMonitor(true))
            {
                monitor.BeginTask(1);

                try
                {
                    var solution         = ProjectOperations.CurrentSelectedSolution;
                    var solutionFullPath = solution.BaseDirectory.FullPath;

                    monitor.Log.WriteLine($"Archiving {solutionFullPath}");
                    var result = BashHelper.ExecuteBashCommand($"cd {solutionFullPath};git archive --format zip --output \"{solution.Name}_{DateTime.Now.ToArhiveTimestamp()}.zip\" HEAD");

                    monitor.ReportSuccess($"Git archive return code: {result.code} {Environment.NewLine}Git archive log: {result}");
                }
                catch (Exception ex)
                {
                    monitor.ReportError($"Archiving failed with: ", ex);
                }
                finally
                {
                    monitor.EndTask();
                }
            }
        }
        public void TakePicture()
        {
            var res = BashHelper.ExecuteBlockingBash("cd /home/pi/photobooth && ./takePicture.sh");

            Console.WriteLine(res);
            _hubContext.Clients.All.Navigate("capture");
        }
        public void StartLiveView()
        {
            _hubContext.Clients.All.Navigate("live-view");
            var res = BashHelper.ExecuteNonBlockingBash("cd /home/pi/photobooth && ./startLiveView.sh");

            Console.WriteLine(res);
        }
        public SessionAnalytics GetSessionAnalytics(string ownerName, string name, DateTime startDate, DateTime endDate)
        {
            var command = CreateCommand(AnalyticsCommand, $"sessions --app \"{ownerName}/{name}\"  -s \"{endDate.ToShortDateString()}\"  -e \"{startDate.ToShortDateString()}\"");
            var result  = BashHelper.ExecuteBashCommand(command);

            string[] lines = Regex.Split(result.Output, "\n");

            return(SessionAnalytics.ParseFromString(lines));
        }
        public Profile GetProfile()
        {
            var command = CreateCommand(ProfileCommand, $"list");
            var result  = BashHelper.ExecuteBashCommand(command);

            string[] lines = Regex.Split(result.Output, "\n");

            return(Profile.ParseFromString(lines));
        }
Beispiel #8
0
        //ToDo: figure out why this doesn't fire
        public string StartServer()
        {
            var minecraftStatus = new MinecraftStatusChecker(_configuration["ip"], 25565);

            if (!minecraftStatus.ServerUp)
            {
                var command = "screen -dmS \"minecraft\" sh /home/minecraft/minecraft/run.sh";
                BashHelper.Bash(command);
                return("Server is starting up!");
            }
            return("Server is already up!");
        }
Beispiel #9
0
        private string StopServer()
        {
            if (IsChanging)
            {
                return("Don't spam to start/stop this could have caused a lot of issues if i was retarded!");
            }

            IsChanging = true;
            var result = BashHelper.Execute("pkill -f /srv/fivem/");

            IsChanging = false;
            return(result);
        }
Beispiel #10
0
        private string StartServer()
        {
            if (IsChanging)
            {
                return("Don't spam to start/stop this could have caused a lot of issues if i was retarded!");
            }

            IsChanging = true;
            var result = BashHelper.Execute($"bash {ARTIFACTS_FOLDER}/run.sh +exec {DATA_FOLDER}/server.cfg");

            IsChanging = false;
            return(result);
        }
        public Application GetApplicationDetails(string applicationOwner, string applicationName)
        {
            Application application = new Application();

            var command = CreateCommand(AppsCommand, $"show --app \"{applicationOwner}/{applicationName}\"");
            var result  = BashHelper.ExecuteBashCommand(command);

            string[] lines = Regex.Split(result.Output, "\n");

            application = Application.ParseFromString(lines);

            return(application);
        }
        public Application UpdateApplication(string ownerName, string name, string displayName, string description)
        {
            Application application = new Application();

            var command = CreateCommand(AppsCommand, $"update --app \"{ownerName}/{name}\"  -n \"{name}\" -d \"{displayName}\" -description \"{description}\"");
            var result  = BashHelper.ExecuteBashCommand(command);

            string[] lines = Regex.Split(result.Output, "\n");

            application = Application.ParseFromString(lines);

            ApplicationsChanged?.Invoke(this, new EventArgs());

            return(application);
        }
        public Application CreateApplication(string displayName, string os, string platform)
        {
            Application application = new Application();

            var command = CreateCommand(AppsCommand, $"create -d \"{displayName}\"  -o \"{os}\"  -p \"{platform}\"");
            var result  = BashHelper.ExecuteBashCommand(command);

            string[] lines = Regex.Split(result.Output, "\n");

            application = Application.ParseFromString(lines);

            ApplicationsChanged?.Invoke(this, new EventArgs());

            return(application);
        }
Beispiel #14
0
        private void OnApplicationStarted()
        {
            // init system
            var result = string.Empty;

            try
            {
                result  = "pwd = " + BashHelper.ExecuteBlockingBash("pwd");
                result += BashHelper.ExecuteBlockingBash("cd scripts && ./initsystem.sh");
            }
            catch (Exception e)
            {
                result += e.Message;
            }

            Console.WriteLine("init: " + result);
        }
        public List <Application> GetApplications()
        {
            List <Application> applications = new List <Application>();

            var command = CreateCommand(AppsCommand, "list");
            var result  = BashHelper.ExecuteBashCommand(command);

            string[] lines = Regex.Split(result.Output, "\n");

            foreach (var line in lines)
            {
                if (!string.IsNullOrEmpty(line))
                {
                    applications.Add(Application.ParseFromString(line));
                }
            }

            return(applications);
        }
Beispiel #16
0
        public Task Start()
        {
            return(Task.Run(async() =>
            {
                while (true)
                {
                    var command = $"cat {pipeFile}";

                    var result = BashHelper.ExecBashCommand(command);

                    if (string.IsNullOrWhiteSpace(result.Error))
                    {
                        var tvService = new TVService();

                        var tvCommand = (IRCommands)Enum.Parse(typeof(IRCommands), result.Message, true);
                        await tvService.SendCommand(tvCommand);
                    }
                }
            }));
        }
        public void StopLiveView()
        {
            var res = BashHelper.ExecuteNonBlockingBash("cd /home/pi/photobooth && ./stopLiveView.sh");

            Console.WriteLine(res);
        }
        public void PrintPicture()
        {
            var res = BashHelper.ExecuteNonBlockingBash("lp /home/pi/net/photobooth/ClientApp/dist/assets/latest.jpg");

            Console.WriteLine(res);
        }
        public void Logout()
        {
            var command = CreateCommand(ProfileCommand, $"logout");

            BashHelper.ExecuteBashCommand(command);
        }
        public void Init()
        {
            var res = BashHelper.ExecuteBlockingBash("cd scripts && ./initsystem.sh");

            Console.WriteLine(res);
        }
Beispiel #21
0
 public void RunScript()
 {
     Console.WriteLine("Connection String: " + connection);
     BashHelper.BashDeployIotEdge(connection);
     Console.WriteLine(BashHelper.bashOutput);
 }