← Back to team overview

mvhub-dev team mailing list archive

[Merge] lp:~omacneil/mvhub/update_doc_push_prod into lp:mvhub

 

Dan MacNeil has proposed merging lp:~omacneil/mvhub/update_doc_push_prod into lp:mvhub.

Requested reviews:
  MVHub devs with commit rights (mvhub-commit)


improvements / updates to checklist for pushing trunk to production
-- 
https://code.launchpad.net/~omacneil/mvhub/update_doc_push_prod/+merge/29010
Your team MVHub Developers is subscribed to branch lp:mvhub.
=== modified file 'app-mvhub/DocumentRoot/cgi-bin/mvhub/agency_form.pl'
--- app-mvhub/DocumentRoot/cgi-bin/mvhub/agency_form.pl	2010-06-24 15:15:46 +0000
+++ app-mvhub/DocumentRoot/cgi-bin/mvhub/agency_form.pl	2010-07-01 15:32:31 +0000
@@ -248,6 +248,23 @@
         values_href => $values_href
     );
 
+<<<<<<< TREE
+=======
+# Get "last updated" date from production agency table so we can insert it into
+# date_agency_created.
+    my $sql
+        = MVHub::Utils::DB::get_sql_select_statement('AGENCY_X_LAST_UPDATED');
+    my $date_created = ( $dbh->selectrow_array( $sql, {}, $agency_id ) )[0];
+
+# Now that record's inserted into production table, add entry to date_agency_created table
+    MVHub::Utils::DB::insert_one_record(
+        dbh   => $dbh,
+        table => 'date_agency_created',
+        values_href =>
+            { agency_id => $agency_id, date_created => $date_created }
+    );
+
+>>>>>>> MERGE-SOURCE
     return $agency_id;
 }
 

=== modified file 'app-mvhub/DocumentRoot/cgi-bin/mvhub/program.pl'
=== modified file 'app-mvhub/doc/checklists/move_to_production.txt'
--- app-mvhub/doc/checklists/move_to_production.txt	2010-05-03 20:43:48 +0000
+++ app-mvhub/doc/checklists/move_to_production.txt	2010-07-01 15:32:31 +0000
@@ -1,30 +1,15 @@
-
 See: app-mvhub/doc/policy/why_move_to_production_checklist.txt
 
 ##########
 	Checklist for regular move into production 
 ##########
 
-___ Determine MAJOR_RELASE_NUM
+___ Determine RELEASE_TAG
 
 	# releases are  tagged, 'yyyy-mm-dd' 
 	
-	export MAJOR_RELEASE_NUM=`date +%Y-%m-%d`
+	export RELEASE_TAG=`date +%Y-%m-%d`
        
-___ Determine minor (bug fix) release number
-	
-	# for a regular scheduled release the 
-	# minor release number is 00
-	
-	# For any small, unplanned changes (like critical bug fixes)
-	# use the existing MAJOR_RELEASE_NUM and increment MINOR_RELEASE_NUM
-
-	export MINOR_RELEASE_NUM='00'
-
-___ Determine release tag
-	
-	export RELEASE_TAG="$MAJOR_RELEASE_NUM-$MINOR_RELEASE_NUM"
-
 ___ Create the release
 	
 	# Navigate to trunk branch
@@ -38,48 +23,28 @@
 
 		cd lib-mvhub
 
-		__ set version for CPAN
-			# fix two lines: 
-			#	Version 0.01
-			#	our $VERSION = '0.01';
+		__ increment version for CPAN
+			# increment two lines: 
+			#	Version 0.0n
+			#	our $VERSION = '0.0n';
 
 			$EDITOR lib/MVHub.pm
+
+		 __ export version number
+	
+			export VERSION_NUM='<what you put in MVHub.pm>'
 		
-		__ update changelog
-			$EDITOR Changes
-       
 	___ commit changes
 
-		bzr commit -m 'RELEASE: updated Changelog , set $VERSION for CPAN'
-
+           bzr commit -m "RELEASE tag: $RELEASE_TAG version: $VERSION_NUM"
+		
 	___ Tag the most recent revision as release
 	
 		bzr tag $RELEASE_TAG
 	
-		# Push the release branch to Launchpad
+		# Push to Launchpad
 	 	bzr push
 
-___ Export the release as a tarball
-	
-	bzr export ../mvhub_$RELEASE_TAG.tar.gz -rtag:$RELEASE_TAG
-
-___ Create a Release on Launchpad.net
-	
-	Firefox: https://launchpad.net/mvhub/trunk/+addrelease
-	# Fill out information for release, picking the appropriate
-	# Milestone or creating a new one if an appropriate one doesn't
-	# already exists.
-
-
-___ Attach tarball to Release on Launchpad.net
-
-	Firefox: https://launchpad.net/mvhub/trunk
-	# Click on the Release name you just created near the bottom of 
-	# the screen. On the next page click the "Add download File" link.
-	# Fill out the forms and navigate to the location of the tarball
-	# that was created previously. Click 'upload' to finish.
-	
-
 ___ Test the release in Staging
 
 	___ Pull the new release into Staging
@@ -88,78 +53,19 @@
 		cd /var/www/mvhub/www-data/source-code/trunk
 		sudo su www-data -c "bzr pull"
 
-	___  put production data into staging database
-
-		ssh csl-db-02.inside
-		cd
-		
-		# determine latest backup
-		# files are dumped in pattern
-		#	yyyy-mm-dd-Fri_mvh_production_db.dump		
-		# 	yyyy-mm-dd-Fri_mvh_production_db.sql
-		# where yyyy is year mm is 2 digit month, etc, etc
-		ls /var/backups/postgres/
-		
-		scp /var/backups/postgresql/<latest dump file>.sql pengiun.inside
-
-		ssh staging.inside
-		# import production data
-        
-        psql -h localhost -U www-data -d www-data.nsp -f \
-             $LATEST_DUMP_FILE.sql > /dev/null
-		
-		# After executing the previous command, you may recieve three
-		# error messages concerning the public schema. These can be
-		# ignored. 
-
-	____ handle schema changes
-
-	____run mv_setup to handle conf file changes
-		sudo su www-data -l
-		cdw
-		
-		# DO NOT DESTROY DATABASE. That will undo the import of the
-		# production data in previous step.
-		mv_setup
-		
-	____ (***IF*** apache conf has changed) test new apache conf w/ staging user 
-
-		cd 
-		sudo cp app-mvhub/setup/etc/apache2/sites-available/mvhub.conf \
-    	        /etc/apache2/sites-available/mvhub.conf
-
-    	___ Restart apache 
-	    	sudo /etc/init.d/apache2 restart
-
-___ Run tests
-
-    cdw
-    sudo app-mvhub/project-tools/bin/mv_su_test www-data
-		
+       ___make new trunk live on staging 
+		sudo app-mvhub/project-tools/bin/mv_update_staging
 
 ____ move to production
 
 	___ update release branch in production
+
 		ssh production.inside
 		cd  /var/www/mvhub/www-data/source-code/trunk/
 		sudo su www-data -c 'bzr pull'
 	
-	___ run mv_setup to handle conf file changes
-		sudo su www-data -l
-		cdw
-		
-		# DO NOT DESTROY DATABASE. IT WILL NUKE PRODUCTION DATA!
-		mv_setup
-		
-	___ (if needed) replace apache config
-	      cdw
-	      sudo cp app-mvhub/setup/etc/apache2/sites-available/mvhub.conf \
-                  /etc/apache2/sites-available/mvhub3.conf
-
-		  # Remove link to test config
-		  sudo rm /etc/apache2/sites-enabled/mvhub-test.conf
-
-	     sudo apache2ctl graceful
+       ___make new trunk live on production
+		sudo app-mvhub/project-tools/bin/mv_update_production
 
 	____ test by hand in web browser
 		# a. can do agency search 
@@ -167,13 +73,7 @@
 		# c. can login as admin
 		# d. can login as agency
 		# e. can browse
-
-	# *** DO NOT **** 
-	# run tests as
-	# if they are buggy
-	# they will have distructive
-	# side effects on production system
-
+	
 ___ perform IMPORTANT hand cleanup
 
   # follow comments to make

=== modified file 'app-mvhub/project-tools/templates/template.conf'
=== modified file 'app-mvhub/setup/database/sql/004_remove_unused_tables_and_seq.sql'
--- app-mvhub/setup/database/sql/004_remove_unused_tables_and_seq.sql	2010-06-23 18:39:04 +0000
+++ app-mvhub/setup/database/sql/004_remove_unused_tables_and_seq.sql	2010-07-01 15:32:31 +0000
@@ -1,3 +1,4 @@
+<<<<<<< TREE
 BEGIN;
 
 INSERT INTO version_log ( version,note ) 
@@ -8,3 +9,16 @@
 DROP TABLE user_type, log_category_search, web_requests CASCADE;
      
 COMMIT;
+=======
+--add version number and note before you add the other sql
+BEGIN;
+
+INSERT INTO version_log ( version,note ) 
+	VALUES (4,'Remove user_type, log_category_search, and web_request tables.');
+
+DROP TABLE user_type, log_category_search, web_requests CASCADE;
+
+DROP SEQUENCE user_type_type_id_seq, log_category_search_search_id_seq, web_requests_id_seq;
+     
+COMMIT;
+>>>>>>> MERGE-SOURCE

=== modified file 'app-mvhub/setup/database/sql/005_synonym_cat_functions.sql'
--- app-mvhub/setup/database/sql/005_synonym_cat_functions.sql	2010-06-18 19:40:06 +0000
+++ app-mvhub/setup/database/sql/005_synonym_cat_functions.sql	2010-07-01 15:32:31 +0000
@@ -1,3 +1,4 @@
+<<<<<<< TREE
 BEGIN;
 INSERT INTO version_log (version, note ) 
 	VALUES (5,'adding two functions to return concatenated synonyms');
@@ -22,3 +23,27 @@
     stype = text
 );
 COMMIT;
+=======
+BEGIN;
+INSERT INTO version_log (version, note ) 
+	VALUES (5,'adding two functions to return concatenated 
+synonyms');
+/* Returns the concatenation of its 2 arguments, separated by a comma and a space. */
+CREATE OR REPLACE FUNCTION  our_concat(text, text) RETURNS text AS 
+$$
+    SELECT $1 || ', ' || $2;
+ $$  LANGUAGE sql
+  STABLE
+  RETURNS NULL ON NULL INPUT;
+
+
+/* Returns a concatenation of all of the values in a grouped column, 
+   delimited by a comma and a space. 
+*/
+CREATE AGGREGATE our_aggregate_concat (
+    sfunc = our_concat,
+    basetype = text,
+    stype = text
+);
+COMMIT;
+>>>>>>> MERGE-SOURCE

=== removed file 'lib-mvhub/Changes'
--- lib-mvhub/Changes	2010-05-04 13:52:59 +0000
+++ lib-mvhub/Changes	1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-Revision history for MVHub
- 
-0.02 - January 8th, 2010 release. Includes new NorthShorePort template, unified searchbar, and various small bugfixes.
-0.03 - February 3rd, 2010 release. Includes pdf generation, new developer directory structure, and some small bugfixes.
-0.04 - April 5th, 2010 release. 23 merges, includes email reminders, unification of the MVHub/Northshoreport codebases, test that simulates adding a new agency to the database, and various bugfixes.
-0.05 - May 4th, 2010 release. Added database schema updater and various bug fixes.

=== modified file 'lib-mvhub/lib/MVHub/CGIAppBase.pm'
=== modified file 'lib-mvhub/lib/MVHub/Utils/Setup.pm'
=== modified file 'lib-mvhub/t/conf/all.conf'