Loading .gitlab-ci.yml +2 −5 Original line number Diff line number Diff line Loading @@ -23,8 +23,5 @@ build-list: - git config --global user.email "$GITLAB_USER_EMAIL" script: - node build_list.js - node validate_json.js - git add list/e_trackers.json - git commit -m "Auto update trackers list" - git push origin HEAD:main - doupdate.sh build_list.js +6 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ const https = require('https') const fs = require('fs') const url = require('url') const EXIT_CODE_NO_CHANGES = 5 function fetch(url) { return new Promise((resolve, reject) => { https.get(url, (response) => { Loading Loading @@ -56,6 +58,7 @@ fetch(adawayUri) }) .then(toto => { if (listHasNoChanges()) { process.exitCode = EXIT_CODE_NO_CHANGES throw "No changes in trackers, abort updating." } }) Loading @@ -69,8 +72,10 @@ fetch(adawayUri) console.log("DONE") }) .catch(err => { if (process.exitCode === undefined) { process.exitCode = 1 } console.log(err) process.exit(1) }) Loading doupdate.sh 0 → 100755 +22 −0 Original line number Diff line number Diff line #!/bin/sh node build_list.js RETVAL=$? case "$RETVAL" in "0") node validate_json.js git add list/e_trackers.json git commit -m "Auto update trackers list" git push origin HEAD:main ;; "5") RETVAL=0 ;; *) ;; esac exit $RETVAL Loading
.gitlab-ci.yml +2 −5 Original line number Diff line number Diff line Loading @@ -23,8 +23,5 @@ build-list: - git config --global user.email "$GITLAB_USER_EMAIL" script: - node build_list.js - node validate_json.js - git add list/e_trackers.json - git commit -m "Auto update trackers list" - git push origin HEAD:main - doupdate.sh
build_list.js +6 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,8 @@ const https = require('https') const fs = require('fs') const url = require('url') const EXIT_CODE_NO_CHANGES = 5 function fetch(url) { return new Promise((resolve, reject) => { https.get(url, (response) => { Loading Loading @@ -56,6 +58,7 @@ fetch(adawayUri) }) .then(toto => { if (listHasNoChanges()) { process.exitCode = EXIT_CODE_NO_CHANGES throw "No changes in trackers, abort updating." } }) Loading @@ -69,8 +72,10 @@ fetch(adawayUri) console.log("DONE") }) .catch(err => { if (process.exitCode === undefined) { process.exitCode = 1 } console.log(err) process.exit(1) }) Loading
doupdate.sh 0 → 100755 +22 −0 Original line number Diff line number Diff line #!/bin/sh node build_list.js RETVAL=$? case "$RETVAL" in "0") node validate_json.js git add list/e_trackers.json git commit -m "Auto update trackers list" git push origin HEAD:main ;; "5") RETVAL=0 ;; *) ;; esac exit $RETVAL