Yuvipanda has submitted this change and it was merged.

Change subject: l10nupdate: Fix scap command paths
......................................................................


l10nupdate: Fix scap command paths

Use the full path to scap commands rather than the legacy /usr/local/bin
symlinks. Also respect the exit code of sync-dir and abort processing
when it fails.

Bug: T1383
Change-Id: Ie9a9cd0e9113fe8afdb886b93167f1d83986da21
---
M files/misc/l10nupdate/l10nupdate-1
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  Yuvipanda: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/files/misc/l10nupdate/l10nupdate-1 
b/files/misc/l10nupdate/l10nupdate-1
index 4a76f6f..3807972 100755
--- a/files/misc/l10nupdate/l10nupdate-1
+++ b/files/misc/l10nupdate/l10nupdate-1
@@ -1,9 +1,11 @@
 #!/bin/bash
 # This script belongs in /usr/local/bin/.
+
 . /etc/profile.d/mediawiki.sh
 . $MEDIAWIKI_STAGING_DIR/multiversion/MWRealm.sh
 
 BINDIR=/usr/local/bin
+SCAPDIR=/srv/deployment/scap/scap/bin
 MWMULTIDIR=$MEDIAWIKI_STAGING_DIR/multiversion
 # The configuration in CommonSettings.php should match GITDIR and GITREPOS
 GITDIR=/var/lib/l10nupdate/mediawiki
@@ -99,10 +101,18 @@
 
                echo "Syncing to Apaches at `date --rfc-3339=seconds`"
                SYNC_START=$(date +%s)
-               NOLOGMSG=1 $BINDIR/sudo-withagent l10nupdate $BINDIR/sync-dir 
"php-$mwVerNum/cache/l10n"
+               # FIXME: This should use the keyholder proxy so we can kill the
+               # l10nupdate private key.
+               NOLOGMSG=1 $BINDIR/sudo-withagent l10nupdate $SCAPDIR/sync-dir 
"php-$mwVerNum/cache/l10n"
+               if [[ $? -ne 0 ]]; then
+                       echo "Failed to sync-dir 'php-$mwVerNum/cache/l10n'"
+                       exit 1
+               fi
+
                # TODO: Add parameter to scap-rebuild-cdbs to only build 1 
version of MW
-               dsh -g mediawiki-installation -M -F 40 -- "sudo -u mwdeploy 
$BINDIR/scap-rebuild-cdbs"
+               dsh -g mediawiki-installation -M -F 40 -- "sudo -u mwdeploy 
$SCAPDIR/scap-rebuild-cdbs"
                SYNC_END=$(date +%s)
+
                $BINDIR/dologmsg "!log LocalisationUpdate completed ($mwVerNum) 
at `date --rfc-3339=seconds`"
                echo "All done at `date --rfc-3339=seconds`"
                $BINDIR/deploy2graphite l10nupdate-sync $((SYNC_END-SYNC_START))

-- 
To view, visit https://gerrit.wikimedia.org/r/174784
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9a9cd0e9113fe8afdb886b93167f1d83986da21
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis <bda...@wikimedia.org>
Gerrit-Reviewer: BryanDavis <bda...@wikimedia.org>
Gerrit-Reviewer: Gage <jger...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Yuvipanda <yuvipa...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to