1
0
Fork 0

update.sh: ensure sub-repo in dir roa/ is created if not exists

This commit is contained in:
netravnen 2019-01-04 10:11:22 +00:00
parent 98ce68e163
commit a2033470f8
1 changed files with 12 additions and 2 deletions

View File

@ -12,6 +12,16 @@ git -C ../registry/ checkout master --quiet
php roagen.php
php rfc8416.php
# Ensure sub-repo is created to track roa file udpates
if [ ! -d roa/ ] ; then mkdir roa ; fi
if [ ! -d roa/.git/ ] ; then
git -C roa/ init
if [ ! -f roa/README.md ; then
touch roa/README.md
echo '## roas' | tee roa/README.md ; fi
git -C roa/ commit --allow-empty -m "Initial commit"
git -C roa/ commit roa/README.md -m "Add README.md" ; fi
# Write out last commit to file
echo "## Notes
@ -31,8 +41,8 @@ $(git -C ../registry/ log -n 1)
\`\`\`" > roa/README.md
# Commit latest version of ROA files
git add roa/*
git commit roa/* -m "Updated ROA files - $ISO_DATE" --quiet
git -C roa/ add roa/*
git -C roa/ commit roa/* -m "Updated ROA files - $ISO_DATE" --quiet
# Push repository to every remote configured
for REMOTE in $(git remote | egrep -v upstream | paste -sd " " -) ; do git push $REMOTE master:master --quiet ; done