Move update functions to update.sh

This commit is contained in:
netravnen 2018-12-23 17:21:41 +00:00
parent f8c6a92c72
commit 3cd8ba21a5
4 changed files with 13 additions and 25 deletions

View file

@ -53,17 +53,6 @@ function trim_special_chars ($string)
return (trim ($string, " \t\n\r\0\x0B")); return (trim ($string, " \t\n\r\0\x0B"));
} }
/*
* Function:
* pushToRemotes ()
*
* Commit and push to all git remote repositories.
*/
function commitPushToRemotes ()
{
echo shell_exec ("./update.sh 2>&1");
}
function writeBirdConfig ($roas) function writeBirdConfig ($roas)
{ {
$json = json_encode($roas, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); $json = json_encode($roas, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);

View file

@ -4,10 +4,6 @@
require ("lib/define.php"); require ("lib/define.php");
require ("lib/functions.php"); require ("lib/functions.php");
// Before we begin. Ensure registry repository is up-to-date
fetchUpstreamMaster();
checkoutMaster();
// Define array() we are going to populate with data. // Define array() we are going to populate with data.
$roas["slurmVersion"] = 1; $roas["slurmVersion"] = 1;
$roas["validationOutputFilters"]["prefixFilters"] = array(); $roas["validationOutputFilters"]["prefixFilters"] = array();
@ -216,6 +212,4 @@ foreach ($raw_array as $sub_array)
writeRoutinatorExceptionFile($roas); writeRoutinatorExceptionFile($roas);
commitPushToRemotes();
?> ?>

View file

@ -3,10 +3,6 @@
require ("lib/define.php"); require ("lib/define.php");
require ("lib/functions.php"); require ("lib/functions.php");
// Before we begin. Ensure registry repository is up-to-date
fetchUpstreamMaster();
checkoutMaster();
/* /*
* *
* IPv6 * IPv6
@ -192,6 +188,4 @@ foreach ($raw_array as $sub_array)
writeExportJSON($roas); writeExportJSON($roas);
writeBirdConfig($roas); writeBirdConfig($roas);
commitPushToRemotes();
?> ?>

View file

@ -2,9 +2,20 @@
ISO_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") ISO_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
# Ensure registry repository is up-to-date
git -C ../registry/ pull origin master:master --quiet 2>&1
# Checkout master branch in dn42/repository
git -C ../registry/ checkout master --quiet
# Update with data from registry
php roagen.php
php rfc8416.php
# Commit latest version of ROA files # Commit latest version of ROA files
git add roa/* --quiet git add roa/*
git commit roa/* -m "Updated ROA files - $ISO_DATE" --quiet git commit roa/* -m "Updated ROA files - $ISO_DATE" --quiet
# Push repository to every remote configured # Push repository to every remote configured
for REMOTE in $(git remote | egrep -v upstream | paste -sd " " -) ; do git push $REMOTE master:master --quiet ; done for REMOTE in $(git remote | egrep -v upstream | paste -sd " " -) ; do
git push $REMOTE master:master --quiet ; done