These are some quick hacks to help facilitate redeploying the Great Reading Adventure software. During use of the software, administrators utilizing the Control Room can upload files to the site (images) and customize files saved on the site (resources and CSS). These files might be accidentally overwritten upon deployment unless care is taken. This project contains scripts to help automate the deployment process to ensure those files are not lost.
The expected use of this process is for developers who are making code and database enhancements actively while reading programs are running. It's a much better idea to just deploy the latest release if that is possible. If you are not actively making changes to the source code, the deployment instructions in the manual are the best approach to follow.
Obviously, you want to do this during lower-activity hours or use a blue-green deployment strategy to minimize or eliminate downtime.
Of course you'll want to change the paths in these scripts. You can use UNC paths if you are building and deploying to different servers.
- Back up current database
- Back up current production site code
- Open
Great Reading Adventure.sln
in Visual Studio - Right-click on the
GRA.Database
project and selectSchema Compare
- Leave the
GRA.Database
project selected on the left and select the production database on the right - Click the gear in the toolbar, expand
Application-scoped
and deselectDatabase Roles
andUsers
- Click
Compare
- If there are differences, click the script icon (to the right of the
Update
button) to generate a migration script and save it - Right-click on the
SRP
project and run publish to a local directory:c:\deployments\gra\
- Open PowerShell
- Run:
preserve-and-prep.ps1
- (Optional) verify files are as they should be for deployment - see the paths in the
preserve-and-prep.ps1
script for more deatils - Did you really back up the database and files in the first two steps? If not, this is your last chance. Do it!
- Run:
deploy-gra.ps1
- Run: SQL migration script if one was generated above - remember to ensure you are in
SQLCMD
mode (in SSMS it's in theQuery
menu) - Smoke test: log into the Control Room, see programs and badges list successfully
- Smoke test: log in as Patron
The scripts and information in this repository are distributed under The MIT License.