function get_repository_clone_url($repository)
{
    $repository_name = get_repo_name($repository);
    $repository_url = get_repo_ssh_clone_url($repository);
    $timestamp = standard_timestamp();
    $backup_folder_path = './../backups/' . $timestamp . '/' . $repository_name . '/';
    //Php wont create this, but this is where the commands that we write to a file will be set to clone the repos into
    return "git clone " . $repository_url . ' ' . $backup_folder_path . ';';
}
Example #2
0
    echo 'selected="selected"';
}
?>
>Least commented</option>
								</select>
							</div>
						</form>
					</div>
				</div>
				<blockquote>
					<p></p>
				</blockquote>					
				<div class="list-group">
					<?php 
foreach ($issues as $issue) {
    $repo_name = get_repo_name($issue['html_url']);
    ?>
					<div class="list-group-item <?php 
    echo $repo_name;
    ?>
">
						<div class="row">
							<div class="col-sm-1">
								<a href="<?php 
    echo $issue["user"]["html_url"];
    ?>
" target="_blank"><img src="<?php 
    echo $issue["user"]["avatar_url"];
    ?>
&amp;s=75" class="hidden-xs img-responsive img-circle" alt="<?php 
    echo $issue["user"]["login"];
    return $repos[0]['name'];
}
include "head.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
if ($savemsg) {
    print_info_box($savemsg, 'success');
}
$tab_array = array();
$tab_array[] = array(gettext("System Update"), false, "pkg_mgr_install.php?id=firmware");
$tab_array[] = array(gettext("Update Settings"), true, "system_update_settings.php");
display_top_tabs($tab_array);
$form = new Form();
$section = new Form_Section('Firmware Branch');
$section->addInput(new Form_Select(fwbranch, 'Branch', get_repo_name($config['system']['pkg_repo_conf_path']), build_repo_list()))->setHelp('Please select the stable, or the development branch from which to update the system firmware. ' . ' <br />' . 'Use of the development version is at your own risk!');
$form->add($section);
$section = new Form_Section('Updates');
$section->addInput(new Form_Checkbox('disablecheck', 'Dashboard check', 'Disable the automatic dashboard auto-update check', isset($curcfg['disablecheck'])));
$form->add($section);
if (file_exists("/usr/local/bin/git")) {
    $section = new Form_Section('GitSync');
    $section->addInput(new Form_Checkbox('synconupgrade', 'Auto sync on update', 'Enable repository/branch sync before reboot', isset($gitcfg['synconupgrade'])))->setHelp('After updating, sync with the following repository/branch before reboot.');
    if (is_dir("/root/pfsense/pfSenseGITREPO/pfSenseGITREPO")) {
        exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url", $output_str);
        if (is_array($output_str) && !empty($output_str[0])) {
            $lastrepositoryurl = $output_str[0];
        }
        unset($output_str);
    }
    $section->addInput(new Form_Input('repositoryurl', 'Repository URL', 'text', $gitcfg['repositoryurl'] ? $gitcfg['repositoryurl'] : ''))->setHelp('The most recently used repository was %s. This repository will be used if the field is left blank.', [$lastrepositoryurl]);
Example #4
0
<?php

// REMINDER; git ssh config keys: setx HOME c:\Users\admin\ on the command line.
// line endings: git config --global core.autocrlf true
// setting global ignore: git config --global core.excludesfile ~/.gitignore_global
// git config --global user.email "*****@*****.**"
// git config --global user.name "Your Name"
// non master releases
// git branch --set-upstream-to=origin/<branch> <local branch>
$current_path = getcwd();
$folders = explode('\\', $current_path);
$reponame = get_repo_name();
// check repo
if (empty($reponame)) {
    lpr('No reponame found. Going for a walk... Bye bye!', true);
}
if (strtolower(ask("Assuming plugin '{$reponame}' is being released. Is this correct? Y/N")) !== 'y') {
    lpr('Goodbye', true);
}
$configname = ask('What is the config file to be used?');
if (empty($configname) || !file_exists(dirname(__FILE__) . '/github_token/' . $configname)) {
    lpr('Missing user config file in: ' . dirname(__FILE__) . '/github_token/', true);
}
$user_token = file_get_contents(dirname(__FILE__) . '/github_token/' . $configname);
if (empty($user_token)) {
    lpr('No user token found in : ' . dirname(__FILE__) . '/github_token/' . $configname, true);
}
lpr('');
// git pull latest version
$output = shell_exec('git pull');
if ($output === null) {