====== SVN structure for scripts======
===== Requirement =======
Store all the deployment related script and process files under SVN
===== Directory structure =======
1. Create the following folder structure under svn tools directory
**a. Existing repo:**
https://repos.exphosted.com/svnrepos/tools/
**b. Add the below struture in the existing repo**
https://repos.exphosted.com/svnrepos/tools/scripts/product_name1/deployment
https://repos.exphosted.com/svnrepos/tools/scripts/product_name1/database_backup
https://repos.exphosted.com/svnrepos/tools/scripts/product_name1/services
https://repos.exphosted.com/svnrepos/tools/scripts/product_name1/[additional scripts goes here with proper folder name]
**Eg: 1. Recordexa**
1. Deployment script
RepoURL: https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/deployment/
deployment/
development/
tincan/
Capfile
config/
lib/
runcap.sh
staging/
tincan/
Capfile
config/
lib/
runcap.sh
production/
tincan/
Capfile
config/
lib/
runcap.sh
2. Database backup script
RepoURL: https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/database_backup/
database_backup/
development/
runbackup.sh
staging/
runbackup.sh
production/
runbackup.sh
3. Services script
RepoURL: https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/services/
services/
status_of_services.sh
tomcat_sss.sh
development/
god.sh
staging/
god.sh
production/
god.sh
Note: god.sh goes under environments specific as this script has environment variable (RAILS_ENV=development) if this can be passed dynamically then this can be set global for all environments
**Eg: 2. Learnexa**
1. Deployment script
RepoURL: https://repos.exphosted.com/svnrepos/tools/scripts/learnexa/deployment/
deployment/
development/
crossbow/
Capfile
config/
lib/
runcap.sh
staging/
crossbow/
Capfile
config/
lib/
runcap.sh
production/
crossbow/
Capfile
config/
lib/
runcap.sh
2. Database backup script
RepoURL: https://repos.exphosted.com/svnrepos/tools/scripts/learnexa/database_backup/
database_backup/
development/
runbackup.sh
staging/
runbackup.sh
production/
runbackup.sh
3. Services script
RepoURL: https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/services/
#Add all services
2. Add other scripts and process files in the same structure based on the product
3. First time - Checkout the code based on the product and it's environment as a app user, So that those folders/files will be under svn,
Following each individual folder(deployment, database_backup, services) has to be checked-out, We should not checkout by the top level directory, As in our server we don't have such directory structure(product_name1/deployment, product_name1/database_backup, product_name1/services) we only have the inner level structure.
https://repos.exphosted.com/svnrepos/tools/scripts/product_name1/deployment
https://repos.exphosted.com/svnrepos/tools/scripts/product_name1/database_backup
https://repos.exphosted.com/svnrepos/tools/scripts/product_name1/services
**eg:**
**a. Checkout by folder**
cd /home/expdev01
svn co https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/deployment/production
**b. Checkout by specific files**
cd /deploy/systasks
svn co https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/services/production/god.sh
4. In future if you modify any of this folder/files mention it in the release specification in wiki, Before the deployment this has to be updated by doing 'svn up' and then normal deployment steps has to be followed
a. **Checkout by specific files** (If you have changes in specific file the do svn up for the specific file by navigating to the specific directory structure)
cd /deploy/systasks
svn export https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/services/production/god.sh (or svn co https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/services/production/god.sh
b. **Checkout by folder**
cd /home/expdev01
svn co https://repos.exphosted.com/svnrepos/tools/scripts/recordexa/deployment/production