203 | | |
204 | | |
| 203 | == Project deployment == |
| 204 | For the purpose of deploying Grails projects in a particular environment, a deploy script has been created (/home/tomcat/scripts/deploy.sh): |
| 205 | |
| 206 | {{{ |
| 207 | tomcat@nmcdsp ~/scripts $ ./deploy.sh |
| 208 | Usage: ./deploy.sh <projectname> <type> |
| 209 | where type is one of ci, nmcdsptest, www or dbnptest, dbnpdemo |
| 210 | tomcat@nmcdsp ~/scripts $ |
| 211 | }}} |
| 212 | |
| 213 | So, to deploy a new production instance of gscf you should issue the following command: |
| 214 | |
| 215 | {{{ |
| 216 | tomcat@nmcdsp ~/scripts $ ./deploy.sh gscf www |
| 217 | }}} |
| 218 | |
| 219 | === Continuous integration === |
| 220 | Continuous integration is basically automated deployment. The deploy script checks if the local workspace (in /home/tomcat/workspace/projectname) is older that svn HEAD and -if so- creates a new build and deploys it on the ci tomcat instance: |
| 221 | |
| 222 | {{{ |
| 223 | tomcat@nmcdsp ~ $ crontab -l |
| 224 | # m h dom mon dow command |
| 225 | |
| 226 | # Continuous Integration |
| 227 | * * * * 1-5 /home/tomcat/scripts/deploy.sh gscf ci >> /home/tomcat/logs/gscf_continuous_integration.log 2>&1 |
| 228 | * * * * 1-5 /home/tomcat/scripts/deploy.sh gscf4animaldb ci >> /home/tomcat/logs/gscf4animaldb_continuous_integration.log 2>&1 |
| 229 | */5 8-19 * * 1-5 /home/tomcat/scripts/deploy.sh sam ci >> /home/tomcat/logs/sam_continuous_integration.log 2>&1 |
| 230 | */5 8-19 * * 1-5 /home/tomcat/scripts/deploy.sh nmcdsp ci >> /home/tomcat/logs/nmcdsp_continuous_integration.log 2>&1 |
| 231 | ... |
| 232 | }}} |
| 233 | |
| 234 | |
| 235 | |