jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405210 )
Change subject: Dev: Make sure we tag the correct commit in the src repo ...................................................................... Dev: Make sure we tag the correct commit in the src repo Get the corresponding commit in the src submodule Gets the corresponding commit from the src repo via the submodule and use that for tagging. This will avoid tagging a commit that has been merged since deployment. Yes, unfortunately, sometimes I've done the tagging a bit later than I should have. Now that we use the correct commit id this script doesn't need to check anymore that the commit was made in past 2 hours since it's a weaker check. Change-Id: If5879fae9ac874de6f13e89fbc7530de1963abe3 --- M scripts/tag-deploy.sh 1 file changed, 6 insertions(+), 13 deletions(-) Approvals: jenkins-bot: Verified Mholloway: Looks good to me, approved diff --git a/scripts/tag-deploy.sh b/scripts/tag-deploy.sh index 53f4464..d54abc7 100755 --- a/scripts/tag-deploy.sh +++ b/scripts/tag-deploy.sh @@ -16,23 +16,16 @@ repo_dir="$( cd $( dirname $0 )/.. && pwd )" cd "$( git config deploy.dir )" -# Check for deploy directory commit in past 2 hours -if [[ -z "$( git log --since="2 hours ago" )" ]]; then - printf "\nWARNING: The most recent deploy commit is:\n\n" - printf "$( git log -1 )\n\n" - printf "This isn't very recent. You may need to pull the most recent changes.\n\n" - read -p "Continue anyway? (y/N) " -n 1 -r - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - echo - exit 1 - fi -fi +# Get the corresponding commit in the src submodule +cd src +src_commit_id="$( git log --format="%h" -n 1 )" +cd .. # Build the deployment tag deploy_commit_date="$( git show -s --format=%ci | awk '{print $1;}' )" deploy_commit_id="$( git rev-parse --short HEAD )" tag="deploy/$deploy_commit_date/$deploy_commit_id" -# Tag the latest code repo commit with it & push tags +# Tag the correct commit in the src repo with & push tags cd "$repo_dir" -git tag -s "$tag" -m "deployed" && git push origin "$tag" && printf "Applied new tag: $tag\n" +git tag -s "$tag" -m "deployed" $src_commit_id && git push origin "$tag" && printf "Applied new tag: $tag\n" -- To view, visit https://gerrit.wikimedia.org/r/405210 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5879fae9ac874de6f13e89fbc7530de1963abe3 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: BearND <bsitzm...@wikimedia.org> Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org> Gerrit-Reviewer: Fjalapeno <cfl...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Mholloway <mhollo...@wikimedia.org> Gerrit-Reviewer: Mhurd <mh...@wikimedia.org> Gerrit-Reviewer: Ppchelko <ppche...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits