Changeset View
Changeset View
Standalone View
Standalone View
contrib/source-control-tools/automated-commits.sh
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | update-chainparams) | ||||
./make_chainparams.py -a 127.0.0.1:18332 > "${CHAINPARAMS_TESTNET_TXT}" | ./make_chainparams.py -a 127.0.0.1:18332 > "${CHAINPARAMS_TESTNET_TXT}" | ||||
git add "${CHAINPARAMS_TESTNET_TXT}" | git add "${CHAINPARAMS_TESTNET_TXT}" | ||||
CHAINPARAMS_CONSTANTS="${TOPLEVEL}"/src/chainparamsconstants.h | CHAINPARAMS_CONSTANTS="${TOPLEVEL}"/src/chainparamsconstants.h | ||||
./generate_chainparams_constants.py . > "${CHAINPARAMS_CONSTANTS}" | ./generate_chainparams_constants.py . > "${CHAINPARAMS_CONSTANTS}" | ||||
git add "${CHAINPARAMS_CONSTANTS}" | git add "${CHAINPARAMS_CONSTANTS}" | ||||
popd | popd | ||||
# Sanity check that the new chainparams build | |||||
ABC_BUILD_NAME=build-werror "${TEAMCITY_SCRIPTS_DIR}"/build-configurations.sh | |||||
git commit -m "${BOT_PREFIX} Update chainparams" | git commit -m "${BOT_PREFIX} Update chainparams" | ||||
;; | ;; | ||||
*) | *) | ||||
echo "Error: Invalid commit name '${COMMIT_TYPE}'" | echo "Error: Invalid commit name '${COMMIT_TYPE}'" | ||||
exit 2 | exit 2 | ||||
;; | ;; | ||||
esac | esac | ||||
echo "Sanity checks..." | echo "Sanity checks..." | ||||
LINT_OUTPUT=$(arc lint --never-apply-patches) | LINT_OUTPUT=$(arc lint --never-apply-patches) | ||||
LINT_EXIT_CODE=$? | LINT_EXIT_CODE=$? | ||||
# If there is more than one line of output, then lint advice lines are likely present. | # If there is more than one line of output, then lint advice lines are likely present. | ||||
# We treat these as errors because code generators should always produce lint-free code. | # We treat these as errors because code generators should always produce lint-free code. | ||||
LINT_NUM_LINES=$(echo ${LINT_OUTPUT} | wc -l) | LINT_NUM_LINES=$(echo ${LINT_OUTPUT} | wc -l) | ||||
if [ "${LINT_EXIT_CODE}" -ne 0 ] || [ "${LINT_NUM_LINES}" -gt 1 ]; then | if [ "${LINT_EXIT_CODE}" -ne 0 ] || [ "${LINT_NUM_LINES}" -gt 1 ]; then | ||||
echo "Error: The linter found issues with the automated commit. Correct the issue in the code generator and try again." | echo "Error: The linter found issues with the automated commit. Correct the issue in the code generator and try again." | ||||
exit 3 | exit 3 | ||||
fi | fi | ||||
# Smoke tests to give some confidence that master won't be put into a bad state | |||||
ABC_BUILD_NAME=build-smoke-tests "${TEAMCITY_SCRIPTS_DIR}"/build-configurations.sh | |||||
Fabien: Smoke tests is not very meaningful to someone editing the `build-configurations.sh` script. | |||||
jasonbcoxAuthorUnsubmitted Done Inline ActionsThis is true, but limiting the scope of those tests doesn't seem necessary when that build config can be used in other places in the future. See my other comment. jasonbcox: This is true, but limiting the scope of those tests doesn't seem necessary when that build… | |||||
echo "Pushing automated commit '${COMMIT_TYPE}'..." | echo "Pushing automated commit '${COMMIT_TYPE}'..." | ||||
GIT_PUSH_OPTIONS=("--verbose") | GIT_PUSH_OPTIONS=("--verbose") | ||||
case ${DRY_RUN:=yes} in | case ${DRY_RUN:=yes} in | ||||
no|NO|false|FALSE) | no|NO|false|FALSE) | ||||
# Do nothing | # Do nothing | ||||
;; | ;; | ||||
Show All 11 Lines |
Smoke tests is not very meaningful to someone editing the build-configurations.sh script.
build-automated-commits-tests or similar is more relevant.