#!/bin/bash set -e function usage { cat <&2 usage exit 12 fi # Must supply a code branch to work with. if [ "${BRANCH}" == "" ]; then echo "Error: You must specify a branch with -b branchname." >&2 usage exit 13 fi if [ "${REPODIR}" == "" ]; then REPODIR="${BASEDIR}/$(basename "${BRANCH}")" fi if [ "${BRANCH}" == "mozilla-central" ]; then HGREPO="https://${HGHOST}/${BRANCH}" elif [[ "${BRANCH}" == mozilla-* ]]; then HGREPO="https://${HGHOST}/releases/${BRANCH}" else HGREPO="https://${HGHOST}/projects/${BRANCH}" fi clone_repo ${PIP} install pip-tools requirements_basefile="$(basename "${REQUIREMENTS_FILE}")" requirements_dir="$(dirname "${REQUIREMENTS_FILE}")" update_requirements "${requirements_dir}" "${requirements_basefile}" requirements_newfile="${requirements_basefile%%.in}.txt" DIFF_ARTIFACT="${ARTIFACTS_DIR}/${requirements_newfile}.diff" echo "INFO: diffing old/new ${requirements_newfile} into ${DIFF_ARTIFACT}" ${HG} -R "${REPODIR}" diff "${BASEDIR}/${BRANCH}/${requirements_dir}/${requirements_newfile}" | tee "${DIFF_ARTIFACT}" COMMIT_MESSAGE="No Bug, ${requirements_dir}/${requirements_newfile} pip-update." if ${HG} -R "${REPODIR}" commit -u "${COMMIT_AUTHOR}" -m "${COMMIT_MESSAGE}" then ${HG} -R "${REPODIR}" out push_repo fi echo "All done"