mirror of
https://git.dn42.dev/dn42/registry.git
synced 2025-06-22 11:45:43 +08:00
Merge branch 'master' of git.dn42:dn42/registry
This commit is contained in:
commit
989829cf37
4 changed files with 41 additions and 12 deletions
11
README.md
11
README.md
|
@ -1,8 +1,9 @@
|
||||||
# Tips for a successful Pull Request
|
# Tips for a successful Pull Request
|
||||||
1. Squash your commits -- Keep the changes simple to read.
|
1. Squash your commits -- Keep the changes simple to read.
|
||||||
2. Run the schema check -- Make sure the changes are valid!
|
2. Run the schema check -- Make sure the changes are valid! Run `./check-my-stuff YOUROWN-MNT`
|
||||||
3. Sign your commit -- Makes it easier to verify.
|
3. BONUS: install the commit hook! Run `./install-commit-hook YOUROWN-MNT`
|
||||||
4. Bonus: add your pgp fingerprint to your MNT `auth: pgp-fingerprint <pgp-fingerprint>` [[See XUU-MNT example](data/mntner/XUU-MNT)]
|
4. Sign your commit -- Makes it easier to verify.
|
||||||
3. ???
|
5. Bonus: add your pgp fingerprint to your MNT `auth: pgp-fingerprint <pgp-fingerprint>` [[See XUU-MNT example](data/mntner/XUU-MNT)]
|
||||||
4. Profit!
|
6. ???
|
||||||
|
7. Profit!
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,9 @@ if [ $# -eq 0 ]
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BASE=$(realpath $0)
|
BASE="$(realpath "$0")"
|
||||||
BASE=$(dirname $BASE)
|
BASE="$(dirname "$BASE")"
|
||||||
cd $BASE
|
cd "$BASE" || exit 1
|
||||||
|
|
||||||
|
utils/schema-check/dn42-schema.py scan data/ -m "$1" || ( echo "Schema validation failed, please check above!" ; exit 1 )
|
||||||
|
|
||||||
utils/schema-check/dn42-schema.py scan data/ -m $1
|
|
||||||
|
|
20
install-commit-hook
Executable file
20
install-commit-hook
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "Usage: $0 YOUR-MNT"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
BASE="$(realpath "$0")"
|
||||||
|
BASE="$(dirname "$BASE")"
|
||||||
|
cd "$BASE" || exit 1
|
||||||
|
|
||||||
|
cat > .git/hooks/pre-commit <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
./check-my-stuff "$1" || exit 1
|
||||||
|
|
||||||
|
EOF
|
||||||
|
chmod +x .git/hooks/pre-commit
|
||||||
|
|
|
@ -266,8 +266,10 @@ def __scan_index(idx, schemas, mntner):
|
||||||
continue
|
continue
|
||||||
c = FileDOM(v[0])
|
c = FileDOM(v[0])
|
||||||
ck = s.check_file(c, idx.keys())
|
ck = s.check_file(c, idx.keys())
|
||||||
if not ck:
|
if ck == "INFO" and ok != "FAIL":
|
||||||
ok = False
|
ok = ck
|
||||||
|
if ck == "FAIL":
|
||||||
|
ok = ck
|
||||||
|
|
||||||
return ok
|
return ok
|
||||||
|
|
||||||
|
@ -397,5 +399,10 @@ if __name__ == '__main__':
|
||||||
elif args["command"] == "scan":
|
elif args["command"] == "scan":
|
||||||
import time
|
import time
|
||||||
log.notice("## Scan Started at %s" %(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())))
|
log.notice("## Scan Started at %s" %(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())))
|
||||||
scan_files(args["path"], args["use_mntner"])
|
ck = scan_files(args["path"], args["use_mntner"])
|
||||||
log.notice("## Scan Completed at %s" %(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())))
|
log.notice("## Scan Completed at %s" %(time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())))
|
||||||
|
|
||||||
|
if ck == "INFO":
|
||||||
|
sys.exit(2)
|
||||||
|
elif ck == "FAIL":
|
||||||
|
sys.exit(1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue