← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~ilasc/lp-staging-scripts/staging-restore-deploy-tellurium into lp:lp-staging-scripts

 

Ioana Lasc has proposed merging lp:~ilasc/lp-staging-scripts/staging-restore-deploy-tellurium into lp:lp-staging-scripts.

Commit message:
Update staging_restore.sh to deploy to tellurium

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ilasc/lp-staging-scripts/staging-restore-deploy-tellurium/+merge/384703

Codehosting and codebrowse were deployed to telllurium (one of our staging servers) by running crontabs:
https://bazaar.launchpad.net/~launchpad-pqm/lp-production-crontabs/staging/view/head%3A/tellurium.canonical.com-supermirror
and:
https://bazaar.launchpad.net/~launchpad-pqm/lp-production-crontabs/staging/view/head:/tellurium.canonical.com-loggerhead

This branch updates only the staging_restore.sh script to do deploy to tellurium.

Modifications to above two crontabs to stop deploying to tellurium are done in separate merge proposals for the files themselves. 
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~ilasc/lp-staging-scripts/staging-restore-deploy-tellurium into lp:lp-staging-scripts.
=== modified file 'staging_restore.sh'
--- staging_restore.sh	2020-05-22 13:39:08 +0000
+++ staging_restore.sh	2020-05-28 08:56:52 +0000
@@ -189,15 +189,31 @@
     ssh launchpad@gandwana.internal rsync -a --delete /srv/staging.launchpad.net/staging/launchpad/ /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
     ssh lp_deploy@xxxxxxxxxxxxxxxxxxxxx rsync -a --delete /srv/builddmaster.staging.launchpad.net/staging/launchpad/ /srv/builddmaster.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
     ssh importd@xxxxxxxxxxxxxxxxxxxxxxxx rsync -a --delete /srv/importd.staging.launchpad.net/staging/launchpad/ /srv/importd.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx rsync -a --delete /srv/bazaar.staging.launchpad.net/staging/launchpad/ /srv/bazaar.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
+    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx rsync -a --delete-after --exclude=sourcecode/launchpad-loggerhead/logs /srv/codebrowse.staging.launchpad.net/staging/launchpad/ /srv/codebrowse.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/
 
     rsync -a --delete ${BUILTCODEDIR}/ importd@xxxxxxxxxxxxxxxxxxxxxxxx:/srv/importd.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
     rsync -a --delete ${BUILTCODEDIR}/ launchpad@xxxxxxxxxxxxxxxxxxxxx:/srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
+<<<<<<< TREE
     rsync -a --delete ${BUILTCODEDIR}/ launchpad@gandwana.internal:/srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
+=======
+    rsync -a --delete ${BUILTCODEDIR}/ launchpad@xxxxxxxxxxxxxxxxxxxxxx:/srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
+    rsync -a -e 'ssh -p 922' --delete ${BUILTCODEDIR}/ supermirror@xxxxxxxxxxxxxxxxxxxxxxx:/srv/bazaar.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
+    rsync -a -e 'ssh -p 922' --delete ${BUILTCODEDIR}/ loggerhead@xxxxxxxxxxxxxxxxxxxxxxx:/srv/codebrowse.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ >> $LOGFILE 2>&1
+
+>>>>>>> MERGE-SOURCE
     ssh lp_deploy@xxxxxxxxxxxxxxxxxxxxx "rsync -a --delete /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/ /srv/builddmaster.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO}/" >> $LOGFILE 2>&1
     ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "make -C /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} build LPCONFIG=staging" >> $LOGFILE 2>&1
     ssh lp_deploy@xxxxxxxxxxxxxxxxxxxxx "make -C /srv/builddmaster.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging-ftpmaster" >> $LOGFILE 2>&1
     ssh importd@xxxxxxxxxxxxxxxxxxxxxxxx "make -C /srv/importd.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
+<<<<<<< TREE
     ssh launchpad@gandwana.internal "make -C /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
+=======
+    ssh launchpad@xxxxxxxxxxxxxxxxxxxxxx "make -C /srv/staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "make -C /srv/bazaar.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
+    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx "make -C /srv/codebrowse.staging.launchpad.net/staging/launchpad-rev-${SOURCEREVNO} compile LPCONFIG=staging" >> $LOGFILE 2>&1
+
+>>>>>>> MERGE-SOURCE
     # Let's put a "maintenance" file in place so nagios doesn't scream
     # and cron jobs know to not process
     ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "date +%s > /srv/staging.launchpad.net/maintenance.txt"
@@ -206,6 +222,14 @@
     ssh importd@xxxxxxxxxxxxxxxxxxxxxxxx touch /srv/importd.staging.launchpad.net/maintenance.txt >> $LOGFILE 2>&1
     ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "/srv/staging.launchpad.net/initscript stop" >> $LOGFILE 2>&1
     ssh lp_buildd@xxxxxxxxxxxxxxxxxxxxx "sudo service buildd-manager stop" >> $LOGFILE 2>&1
+    # Stop codehosting services on Tellurium
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-sftp-staging1 stop" >> $LOGFILE 2>&1
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-lp-forking-service-staging1 stop" >> $LOGFILE 2>&1
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-sftp-staging2 stop" >> $LOGFILE 2>&1
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-lp-forking-service-staging2 stop" >> $LOGFILE 2>&1
+    # Stop codebrowse services on Tellurium
+    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx "/srv/codebrowse.staging.launchpad.net/initscript stop" >> $LOGFILE 2>&1
+
     # Kill off any running cronjobs that block the DB updates
     ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "pkill -u 1000 -f staging.launchpad.net/staging/launchpad/cronscripts/"
     ssh launchpad@gandwana.internal "pkill -u 1000 -f staging.launchpad.net/staging/launchpad/cronscripts/"
@@ -232,8 +256,18 @@
     ssh lp_deploy@xxxxxxxxxxxxxxxxxxxxx ln -s launchpad-rev-${SOURCEREVNO} /srv/builddmaster.staging.launchpad.net/staging/launchpad
     ssh importd@xxxxxxxxxxxxxxxxxxxxxxxx rm -rf /srv/importd.staging.launchpad.net/staging/launchpad/
     ssh importd@xxxxxxxxxxxxxxxxxxxxxxxx ln -s launchpad-rev-${SOURCEREVNO} /srv/importd.staging.launchpad.net/staging/launchpad
+<<<<<<< TREE
     ssh launchpad@gandwana.internal rm -rf /srv/staging.launchpad.net/staging/launchpad
     ssh launchpad@gandwana.internal ln -s launchpad-rev-${SOURCEREVNO} /srv/staging.launchpad.net/staging/launchpad
+=======
+    ssh launchpad@xxxxxxxxxxxxxxxxxxxxxx rm -rf /srv/staging.launchpad.net/staging/launchpad
+    ssh launchpad@xxxxxxxxxxxxxxxxxxxxxx ln -s launchpad-rev-${SOURCEREVNO} /srv/staging.launchpad.net/staging/launchpad
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx rm -rf /srv/bazaar.staging.launchpad.net/staging/launchpad
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx ln -s launchpad-rev-${SOURCEREVNO} /srv/bazaar.staging.launchpad.net/staging/launchpad
+    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx rm -rf /srv/codebrowse.staging.launchpad.net/staging/launchpad
+    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx ln -s launchpad-rev-${SOURCEREVNO} /srv/codebrowse.staging.launchpad.net/staging/launchpad
+
+>>>>>>> MERGE-SOURCE
     # Now setup the link to build/js for convoy/comboloader as per RT#50616
     # First remove previous versions
     ssh launchpad@xxxxxxxxxxxxxxxxxxxxx "rm -f /srv/staging.launchpad.net/staging/convoy/*"
@@ -330,14 +364,33 @@
     # Now we want to restart the app server
     ssh launchpad@xxxxxxxxxxxxxxxxxxxxx /srv/staging.launchpad.net/initscript start >> $LOGFILE 2>&1
     ssh lp_buildd@xxxxxxxxxxxxxxxxxxxxx sudo service buildd-manager start >> $LOGFILE 2>&1
+<<<<<<< TREE
     ssh launchpad@gandwana.internal "sudo service celeryd-staging_launchpad_job start" >> $LOGFILE 2>&1
     ssh launchpad@gandwana.internal "sudo service celeryd-staging_bzrsyncd_job start" >> $LOGFILE 2>&1
+=======
+    ssh launchpad@xxxxxxxxxxxxxxxxxxxxxx "sudo service celeryd-staging_launchpad_job start" >> $LOGFILE 2>&1
+    ssh launchpad@xxxxxxxxxxxxxxxxxxxxxx "sudo service celeryd-staging_bzrsyncd_job start" >> $LOGFILE 2>&1
+
+>>>>>>> MERGE-SOURCE
     # Revert the offline message
     ssh launchpad@xxxxxxxxxxxxxxxxxxxxx rm -f /srv/staging.launchpad.net/www/root/offline.html
     ssh launchpad@xxxxxxxxxxxxxxxxxxxxx ln -s /srv/staging.launchpad.net/staging/launchpad/lib/canonical/launchpad/offline-unplanned.html /srv/staging.launchpad.net/www/root/offline.html
 
-    # Can remove the maint file on tellurium once the app servers are back
+    # bzr-sftp-staging wont start if maintanance file is active (currently) spm 2012-01-09
+    # Start codehosting services on tellurium and remove maintanance file
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-lp-forking-service-staging1 start" >> $LOGFILE 2>&1
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-lp-forking-service-staging2 start" >> $LOGFILE 2>&1
     ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "rm -f /srv/bazaar.staging.launchpad.net/maintenance.txt"
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-sftp-staging1 start" >> $LOGFILE 2>&1
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/etc/init.d/bzr-sftp-staging2 start" >> $LOGFILE 2>&1
+
+    # Sync some branches from production for testing
+    echo "$(date) Sync-ing branches from production"
+    ssh -p 922 supermirror@xxxxxxxxxxxxxxxxxxxxxxx "/srv/bazaar.staging.launchpad.net/scripts/codehosting_branch_mirror.sh" >> $LOGFILE 2>&1
+    echo "$(date) Sync-ed branches from production"
+
+    # Start codebrowse services on tellurium
+    ssh -p 922 loggerhead@xxxxxxxxxxxxxxxxxxxxxxx "/srv/codebrowse.staging.launchpad.net/initscript start" >> $LOGFILE 2>&1
 
     # Sync staging mailman to production
     echo $(date) "About to sync mailman to production" >> $LOGFILE
@@ -361,7 +414,13 @@
     clean_old_code launchpad@xxxxxxxxxxxxxxxxxxxxx /srv/staging.launchpad.net/staging launchpad
     clean_old_code lp_deploy@xxxxxxxxxxxxxxxxxxxxx /srv/builddmaster.staging.launchpad.net/staging launchpad
     clean_old_code importd@xxxxxxxxxxxxxxxxxxxxxxxx /srv/importd.staging.launchpad.net/staging launchpad
+<<<<<<< TREE
     clean_old_code launchpad@gandwana.internal /srv/staging.launchpad.net/staging launchpad
+=======
+    clean_old_code launchpad@xxxxxxxxxxxxxxxxxxxxxx /srv/staging.launchpad.net/staging launchpad
+    clean_old_code supermirror@xxxxxxxxxxxxxxxxxxxxxxx /srv/bazaar.staging.launchpad.net/staging launchpad
+    clean_old_code loggerhead@xxxxxxxxxxxxxxxxxxxxxxx /srv/codebrowse.staging.launchpad.net/staging launchpad
+>>>>>>> MERGE-SOURCE
 
     SCRIPT_END=$(date +%s)
     let TIME_TAKEN=${SCRIPT_END}-${SCRIPT_START}


References