PageRenderTime 49ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/release/make_deb.sh

https://bitbucket.org/jarrettchisholm/oscar
Shell | 484 lines | 222 code | 98 blank | 164 comment | 2 complexity | 4be1f93c0a560c242dff65ec4a1ce33f MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0
  1. #!/bin/bash
  2. # release/make_beta.sh
  3. # makes a debian installer release from source
  4. #===================================================================
  5. # Copyright Peter Hutten-Czapski 2012-2015 released under the GPL v2
  6. #===================================================================
  7. # for OSCAR 14
  8. # v 1 - pre-release
  9. # v 2 - added in oscar_documents incoming docs directories needed
  10. # - added in code to set the billingcenter
  11. # removed Replaces: oscar-mcmaster from control
  12. # replaced oscar-mcmaster with oscar-emr in templates etc
  13. # v 3 - added x86_64 detection for wkhtmltopdf
  14. # v 4 - updates for may 2014 alpha
  15. # v 5 - directed to trunk for testing
  16. # v 6 - huge number of bug fixes
  17. # v 7 - added in a few schema changes
  18. # v 8 - changed db switch to useOldAliasMetadataBehavior=true & jdbcCompliantTruncation=false
  19. # v 9 - switched from trunk to true oct2014AlphaMaster
  20. # v 10 - removed the external perscriber settings
  21. # v 11 - updated drugref data to Nov 22, 2014
  22. # v 12 - fixed config to echo url for hcv service, and adjusted min stack to 256k
  23. # v 13 - changed wget to ./wget older version and substituted in TEST PATIENT into the demo and undemo.sql
  24. # v 14 - ported lintian fixes from v63 of the 12_1 release installation script and added wkhtmltopdf dependency
  25. # v 15 - switched to tomcat7, updated drugref to Feb 10 2015, cleaned changelog and disabled updating
  26. # v 16 - added Rourke eForm installation under liscence
  27. # for OSCAR 15
  28. # v 0 - fixed the Rourke unzip and copy and sent its console output to the install log
  29. # v 1 - fixed patch.sql to reference oscar_15 fixed oscar.properties to match latest and draw from OSCAR 15 branch
  30. # v 2 - added DEMOGRAPHIC_PATIENT_CLINIC_STATUS=true (REALLY who wants it turned off as default?)
  31. # v 3 - fixed oscar_12_1_1_to_oscar_15.sql, or at least removed the duplicates!
  32. # v 4 - updated schema definitions to update-2015-04-24.sql applied
  33. # v 5 - Now drawing on the OSCAR's RELEASE_15_BETA and update-2015-04-29.sql applied and Jenkins port changed temporarily
  34. # v 6 - Jenkins port reverted to 11042, drugref schema tweaked/updated to May 2015, added ALT_PATIENT_DETAILS_UI property
  35. # v 7 - updated drugref2 to last stable build on Jenkins which now can handle HC zip change May 5 2015
  36. # v 8 - fixed nsert typo in the sql's
  37. # v 9 - fixed oscar_14 to oscar_15 references in the conversion script
  38. # - modified SQL to reflect update-2015-05-15.sql
  39. # - added more debug to purge script
  40. # - Set SINGLE_PAGE_CHART=true to Show link to single page chart in classic appointment screen
  41. # v 10 - added sort_down_mfg_tagged_generics generic drug flag to drugref properties and, June 24 new API for drugs by DIN in drugref
  42. # v 11 - added cipher settings for server.xml
  43. # v 12 - altered drugref properties file to drugref2.properties and made them use the packaged sql as update with added indices
  44. # - database updates appended in OscarON15 OscarBC15 and oscar_12_1_1_to_oscar_15 sqls to update-2015-07-08.sql
  45. # v 13 - added unzip as dependency
  46. # v 14 - updated drugref war and drugref and oscar schemas to Oct 7, 2015
  47. # v 15 - substituted new backup.sh, reviewed prerm, config, now will upgrade previous 15 debs without rewriting properties
  48. # v 16 - updated demo and undemo sql's
  49. # v 17 - updated sql's to update-2015-12-08 and update-2015-11-24
  50. # v 18 - updated sql's to update-2016-01-25 and tweaked the quicklist for appts for GP (recalled)
  51. # v 19 - bugfixes to the 12.1 to 15 conversion script and corrected WKHTMLTOPDF command property and removed its dependency as deb
  52. # v 20 - more sql tweaking and addition of legacyMyISAM.sql for upgrade purposes
  53. # v 21 - Fixed demo.sql to properly enroll both demo patients
  54. # v 22 - Changed output to rename as ~, fixed HL7 labs to view, vacancy table fix
  55. # v 23 - Switched this script to standard curl from our hacked wget for accessing files from the web
  56. # v 24 - Updated reOscar to reOscar2.sh, added ichppccode table, missig HRMDocuments column and many indices to patch.sql
  57. # v 25 - More indices added to patch.sql and web.xml added to OscarDocuments and moved OscarDocuments to prevent webshell exploit
  58. # v 26 - Updated Rich Text Letter and moved OscarDocuments to prevent webshell exploit
  59. # v 27 - Bypassed confirmation screen for upgrades so that they can run unattended
  60. # v 28 - Fixes in patch.sql
  61. # v 29 - Changed OscarDocuments to the <context> and added BORN eforms to Ontario Installs, new source for GEOIP data
  62. # v 30 - Updated backup2.sh to use new document directory
  63. # - oscar.properties to use master Mar 17, 2016
  64. # - added sed entries to config to normalise paths in the properties file
  65. # - removed a lot of redundant echo to properties file in config
  66. # - area code lookup to handle space in city name
  67. # - tickler_update forcing to status to ABD in conversion script
  68. # - Rourke 2014 updated to latest as of April 15, 2016
  69. # v 31 - added reOscar to config and changed way to test/set backup scripts
  70. # - Rourke 2014 updated to latest as of April 17, 2016
  71. # v 32 - Switched config to set BASE_DOCUMENT_DIR
  72. # - added weekly tomcat restart cronjob to config
  73. # v 33 - added gateway.cron to oscar-emr and in config
  74. # v 34 - updated drugref to current on 2016-04-22
  75. # - added default data to faxconfig so it would work out of the box
  76. # - fixed /etc/default/tomcat7 to use Oracle java
  77. # v 35 - sanity check to ensure setting tomcat to look for an actual Oracle Java
  78. # v 36 - updated OscarDocuments editControl.js to provide backwards compatibility for old RTL May 16, 2016
  79. # - added Ontario Lab eform
  80. # v 37 - fixed OscarBC15.sql to at least load!
  81. # v 38 - added mariadb-server as alternate dependency to mysql in control
  82. # v 39 - fixed bug 4385 lastdate spelling line 221 postinst
  83. # v 40 - deleting tailing zero doses and adding leading 0 to decimal doses
  84. # - added tallMAN scripts for optional use
  85. # - updated drugref to current on 2016-07-26
  86. # v 41 - adjusted permissions on scripts and oscar.properties
  87. # v 42 - DEB update now updates drugref and the older Rourke installed prior to v 30
  88. # v 43 - fixed missing consent tables for build 437 oscar_emr15-42~437.deb and oscar_mcmaster.properties to match
  89. # v 44 - temporary patch to tickler to get rid of NULL's in catgeory_id REVERTED
  90. # v 45 - added run_rxquery.sh for Medispan reporting without configuring or adding to crontab
  91. # v 46 - switched from repo drugref.sql to one in local directory
  92. # v 47 - outdated property indivica_rx_enhance removed
  93. # - rx_enhance set to false
  94. # - fixed patch.sql for ichpicc
  95. # v 48 - moved up table definition `indicatorTemplate` in patch to fix fresh install bug
  96. # - probing eth1 instead of eth0 for local ip
  97. # v 49 - disabled plugin requirement for root user
  98. # - removed a tailing / in the properties file for tomcat
  99. # - updated drugref data to Jan 18, 2017
  100. # - updated area code lookup to use https
  101. # v 50 - Fixed backupscript to daily delete stale Full backups if $COMPLETE_BACKUP
  102. # - and to trigger Full backups every $DAYS_TO_KEEP if not
  103. # v 51 - updated patch with missing update-2015-12-07.sql and 2017-01-25.sql
  104. # v 52 - updated patch with UNIQUE constrained temp indices
  105. # - added latebreaking properties, at least for consult module
  106. # - drugref2 to build 12
  107. # v 53 - added missing properties
  108. # v 54 - updated drugref to Feb 17, 2017 and removed addition of index in postinst
  109. # v 55 - fixed order in patch.sql to add LookupList.listTitle prior to filling it
  110. # v 56 - fixed spelling mistake in patch.sql for hort_term
  111. # v 57 - migrated to jenkins/bitbucket pointing to the stable release branch
  112. DEB_SUBVERSION=57
  113. PROGRAM=oscar
  114. PACKAGE=oscar-emr
  115. # The database should be in the oscar_ series, MySQL conventions don't allow . in db_names
  116. db_name=oscar_15
  117. ## database switches are needed to provide expected behavior for OSCAR 15
  118. ## enforce UTF-8 encoding so that foreign characters are stored 一種語言永遠不夠
  119. ## handle 0000-00-00 date errors by rounding to 0001-01-01
  120. ## allow hibernate to alter column names
  121. ## tolerate fields without default values that are not named in the query
  122. db_switch=\'?characterEncoding=UTF-8\\\&zeroDateTimeBehavior=round\\\&useOldAliasMetadataBehavior=true\\\&jdbcCompliantTruncation=false\'
  123. # Debian versioning conventions don't allow _ so use .
  124. VERSION=15
  125. PREVIOUS=12_1
  126. # ... and of course Jenkins is using another convention
  127. WGET_VERSION=oscar-stable
  128. # and the target of mvn 3 has to be different than for mvn 2 so
  129. # for TRUNK and 15 BETA oscar-14.0.0-SNAPSHOT.war
  130. TARGET=oscar-14.0.0-SNAPSHOT.war
  131. echo "grep the build from Jenkins"
  132. ##curl --insecure -SSLv3 -o lastStableBuild https://demo.oscarmcmaster.org:11042/job/$WGET_VERSION/lastStableBuild/
  133. curl -o lastStableBuild http://jenkins.oscar-emr.com:8080/job/$WGET_VERSION/lastStableBuild/
  134. ##TEMPORARILY USE THE LAST BUILD REGARDLESS OF STABILITY WHILE CONGURATION CHANGES ARE MADE
  135. ##curl -o lastStableBuild http://jenkins.oscar-emr.com:8080/job/$WGET_VERSION/lastBuild/
  136. ## <title>may2014alphaMaster #13 [Jenkins]</title>
  137. # oct2014AlphaMaster #1 [Jenkins]
  138. BUILD=$(grep '<title>' lastStableBuild | head -n 1 | sed "s/<title>$WGET_VERSION #\([0-9]*\).*/\1/;s/^[[:space:]]*//;s/[[:space:]]*$//")
  139. echo "+++++++++++++++++++++++"
  140. echo build=$BUILD
  141. buildDateTime=$(grep ' (' lastStableBuild | head -n 1 |sed 's/^[[:space:]]*(//;s/)[[:space:]]*$//')
  142. echo buildDateTime=$buildDateTime
  143. SHA1=$(grep 'Revision' lastStableBuild | head -n 1 |sed 's/.*Revision.* \(.*\)/\1/')
  144. echo SHA1=$SHA1
  145. # you can tick up when a newer build of the installer is made
  146. # or when the release tag needs to change eg beta to RC
  147. # TRUNK
  148. REVISION=${DEB_SUBVERSION}~${BUILD}
  149. echo REVISION=$REVISION
  150. ICD=9
  151. # For simplicity lets pick Tomcat 7
  152. TOMCAT=tomcat7
  153. C_HOME=/usr/share/${TOMCAT}/
  154. C_BASE=/var/lib/${TOMCAT}/
  155. # FILEREPO=~/Documents/release/
  156. tomcat_path=${C_HOME}
  157. TODAY=$(date)
  158. # used to pick up virgin properties file and if building a deb directly from source
  159. SRC=~/git/oscar
  160. # TODO Check the dir from which you are being called
  161. DEBNAME="oscar_emr$VERSION-$REVISION"
  162. if [ -d "$DEBNAME" ]; then
  163. echo prexisting directory with this build found
  164. SKIP_NEW_WAR=true
  165. rm -R ./${DEBNAME}/
  166. else
  167. rm *.war
  168. fi
  169. echo "cleaning up"
  170. rm changes
  171. rm tmp*
  172. rm -R -f ./oscar_documents
  173. # echo "loading documents"
  174. mkdir -p ./${DEBNAME}/usr/share/doc/${PACKAGE}/
  175. cp -R copyright ./${DEBNAME}/usr/share/doc/${PACKAGE}/
  176. # echo "loading control scripts"
  177. mkdir -p ./${DEBNAME}/DEBIAN/
  178. echo "changelog"
  179. curl -o changes http://jenkins.oscar-emr.com:8080/job/oscar-stable/changes
  180. sed \
  181. -e 's/yyy-1.0/'"$VERSION"'-'"$BUILD"'/' \
  182. -e 's/package/'"$PROGRAM"'/' \
  183. -e 's/releasedate/'"$TODAY"'/' \
  184. changestemplate > tmp
  185. head -n 1 tmp > tmp2
  186. #grep "^ [a-zA-Z#]" changes | tail -n +3 |sed 's/&039\;/'/;s/^[[:space:]]*/ * /;s/[[:space:]]*$//' > tmp3
  187. #grep "^ [ a-zA-Z#]" changes | tail -n +13 |sed 's/&#039\;//;s/&nbsp\;/ /;s/&quot\;/\"/;s/&quot\;/\"/;s/&quot\;/\"/;s/&quot\;/\"/;s/id:\;//;s/ID://;s/ID \#//;s/Bug \#//;s/Bug ID //;s/Oscar Host - //;s/\#//;s/^[[:space:]]*/ * /;s/[[:space:]]*$//' >tmp3
  188. # lots of cleanup to extract the pith from the changes and then truncate at 80 columns as per DEBIAN requirement
  189. grep "<\/h2>" changes | sed 's/^[[:space:]]*/ * /;s/, [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] [A|P]M//;s/<\/a><\/h2><ol><li>//;s/OSCAREMR-//;s/[[:space:]]*$//' > tmp3
  190. sed -r 's/(^.{80}).*/\1/' tmp3 > tmp4
  191. tail -n 1 tmp > tmp5
  192. cat tmp2 \
  193. tmp4 \
  194. tmp5 \
  195. > changelog.Debian
  196. curl -o drugrefChanges http://jenkins.oscar-emr.com:8080/job/drugref2/changes
  197. #grep "^ [ a-zA-Z#]" drugrefChanges | sed 's/&#039\;//;s/&nbsp\;/ /;s/&quot\;/\"/;s/&quot\;/\"/;s/&quot\;/\"/;s/&quot\;/\"/;s/id:\;//;s/ID://;s/ID \#//;s/Bug \#//;s/Bug ID //;s/Oscar Host - //;s/\#//;s/^[[:space:]]*/ * /;s/[[:space:]]*$//' >drugrefChangesClean
  198. grep "<\/h2>" drugrefChanges | sed 's/^[[:space:]]*/ * /;s/, [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] [A|P]M//;s/<\/a><\/h2><ol><li>//;s/OSCAREMR-//;s/[[:space:]]*$//' > drugrefChangesClean
  199. echo "+++++++++++++++++++++++"
  200. echo build=$BUILD
  201. buildDateTime=$(grep ' (' lastStableBuild | head -n 1 |sed 's/^[[:space:]]*(//;s/)[[:space:]]*$//')
  202. echo buildDateTime=$buildDateTime
  203. SHA1=$(grep 'Revision' lastStableBuild | head -n 1 |sed 's/.*Revision.* \(.*\)/\1/')
  204. echo SHA1=$SHA1
  205. echo DEBNAME=${DEBNAME}
  206. echo ""
  207. echo "OSCAR changes"
  208. head -n 5 changelog.Debian
  209. echo ""
  210. echo "Drugref2 Changes"
  211. cat drugrefChangesClean
  212. echo "+++++++++++++++++++++++"
  213. rm lastStableBuild
  214. rm drugrefChangesClean
  215. gzip -9 changelog.Debian
  216. mv changelog.Debian.gz ./${DEBNAME}/usr/share/doc/${PACKAGE}/
  217. # 6 4 4
  218. # user group world
  219. # r+w r r
  220. # 4+2+0 4+0+0 4+0+0 = 644
  221. #chmod 644 ./${DEBNAME}/DEBIAN/changelog
  222. echo config
  223. sed -e 's/^PROGRAM.*/PROGRAM='"$PROGRAM"'/' \
  224. -e 's/^PACKAGE.*/PACKAGE='"$PACKAGE"'/' \
  225. -e 's/^db_name.*/db_name='"$db_name"'/' \
  226. -e 's/^db_switch.*/db_switch='"$db_switch"'/' \
  227. -e 's/^VERSION.*/VERSION='"$VERSION"'/' \
  228. -e 's/^PREVIOUS.*/PREVIOUS='"$PREVIOUS"'/' \
  229. -e 's/^REVISION.*/REVISION='"$REVISION"'/' \
  230. -e 's/^buildDateTime.*/buildDateTime=\"'"$buildDateTime"'\"/' \
  231. -e 's/^TOMCAT.*/TOMCAT=\"'"$TOMCAT"'\"/' \
  232. -e 's%^C_HOME.*%C_HOME='"$C_HOME"'%' \
  233. -e 's%^C_BASE.*%C_BASE='"$C_BASE"'%' \
  234. -e 's%^tomcat_path.*%tomcat_path='"$tomcat_path"'%' \
  235. config > ./${DEBNAME}/DEBIAN/config
  236. # 7 5 5
  237. # user group world
  238. # r+w+x r+x r+x
  239. # 4+2+1 4+0+1 4+0+1 = 755
  240. chmod 755 ./${DEBNAME}/DEBIAN/config
  241. sed -e 's/Version: 8-x.x/Version: '"$VERSION"'-'"$REVISION"'/' \
  242. control > ./${DEBNAME}/DEBIAN/control
  243. chmod 644 ./${DEBNAME}/DEBIAN/control
  244. sed -e 's/^PROGRAM.*/PROGRAM='"$PROGRAM"'/' \
  245. -e 's/^PACKAGE.*/PACKAGE='"$PACKAGE"'/' \
  246. -e 's/^db_name.*/db_name='"$db_name"'/' \
  247. -e 's/^VERSION.*/VERSION='"$VERSION"'/' \
  248. -e 's/^PREVIOUS.*/PREVIOUS='"$PREVIOUS"'/' \
  249. -e 's/^REVISION.*/REVISION='"$REVISION"'/' \
  250. -e 's/^TOMCAT.*/TOMCAT='"$TOMCAT"'/' \
  251. -e 's/^buildDateTime.*/buildDateTime=\"'"$buildDateTime"'\"/' \
  252. -e 's%^C_HOME.*%C_HOME='"$C_HOME"'%' \
  253. -e 's%^C_BASE.*%C_BASE='"$C_BASE"'%' \
  254. postinst > ./${DEBNAME}/DEBIAN/postinst
  255. chmod 755 ./${DEBNAME}/DEBIAN/postinst
  256. sed -e 's/^PROGRAM.*/PROGRAM='"$PROGRAM"'/' \
  257. -e 's/^PACKAGE.*/PACKAGE='"$PACKAGE"'/' \
  258. -e 's/^db_name.*/db_name='"$db_name"'/' \
  259. -e 's/^VERSION.*/VERSION='"$VERSION"'/' \
  260. -e 's/^PREVIOUS.*/PREVIOUS='"$PREVIOUS"'/' \
  261. -e 's/^REVISION.*/REVISION='"$REVISION"'/' \
  262. -e 's/^TOMCAT.*/TOMCAT=\"'"$TOMCAT"'\"/' \
  263. -e 's/^buildDateTime.*/buildDateTime=\"'"$buildDateTime"'\"/' \
  264. -e 's%^C_HOME.*%C_HOME='"$C_HOME"'%' \
  265. -e 's%^C_BASE.*%C_BASE='"$C_BASE"'%' \
  266. postrm > ./${DEBNAME}/DEBIAN/postrm
  267. chmod 755 ./${DEBNAME}/DEBIAN/postrm
  268. sed -e 's/^PROGRAM.*/PROGRAM='"$PROGRAM"'/' \
  269. -e 's/^PACKAGE.*/PACKAGE='"$PACKAGE"'/' \
  270. -e 's/^db_name.*/db_name='"$db_name"'/' \
  271. -e 's/^VERSION.*/VERSION='"$VERSION"'/' \
  272. -e 's/^PREVIOUS.*/PREVIOUS='"$PREVIOUS"'/' \
  273. -e 's/^REVISION.*/REVISION='"$REVISION"'/' \
  274. -e 's/^TOMCAT.*/TOMCAT=\"'"$TOMCAT"'\"/' \
  275. -e 's%^C_HOME.*%C_HOME='"$C_HOME"'%' \
  276. -e 's%^C_BASE.*%C_BASE='"$C_BASE"'%' \
  277. prerm > ./${DEBNAME}/DEBIAN/prerm
  278. chmod 755 ./${DEBNAME}/DEBIAN/prerm
  279. cp -R templates ./${DEBNAME}/DEBIAN/
  280. chmod 644 ./${DEBNAME}/DEBIAN/templates
  281. # echo "loading utilities and properties"
  282. mkdir -p ./${DEBNAME}/usr/share/${PACKAGE}/
  283. # echo make up the appropriate source.txt for this build
  284. sed -e 's/SHA1/'"$SHA1"'/' \
  285. -e 's/yyy-x.x/'"$VERSION"'-'"$REVISION"'/' \
  286. -e 's/oscarprogram/'"$PROGRAM"'/' \
  287. -e 's/build xxx/build '"$BUILD"'/' \
  288. source.txt > ./${DEBNAME}/usr/share/${PACKAGE}/source.txt
  289. # echo make up the appropriate rebooting script
  290. sed -e 's/^PROGRAM.*/PROGRAM='"$PROGRAM"'/' \
  291. reOscar2.sh > ./${DEBNAME}/usr/share/${PACKAGE}/reOscar.sh
  292. chmod 711 ./${DEBNAME}/usr/share/${PACKAGE}/reOscar.sh
  293. cp gateway.cron ./${DEBNAME}/usr/share/${PACKAGE}/gateway.cron
  294. chmod 755 ./${DEBNAME}/usr/share/${PACKAGE}/gateway.cron
  295. cd NDSS/
  296. zip ../ndss.zip *
  297. cd ../
  298. cd rbr2014/
  299. zip ../rbr2014.zip *
  300. cd ../
  301. cp -R demo.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  302. cp -R drugref.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  303. cp -R OfficeCodes.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  304. cp -R OLIS.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  305. cp -R Oscar11_to_oscar_12.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  306. cp -R oscar10_12_to_Oscar11.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  307. cp -R oscar_12_to_oscar_12_1.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  308. cp -R rbr2014.zip ./${DEBNAME}/usr/share/${PACKAGE}/
  309. cp -R ndss.zip ./${DEBNAME}/usr/share/${PACKAGE}/
  310. cp -R RourkeEform.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  311. cp -R ndss.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  312. cp -R tallMAN.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  313. cp -R tallMANdrugref.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  314. cp -R ontarioLab.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  315. rm ndss.zip
  316. rm rbr2014.zip
  317. chmod 644 ./${DEBNAME}/usr/share/${PACKAGE}/rbr2014.zip
  318. chmod 644 ./${DEBNAME}/usr/share/${PACKAGE}/ndss.zip
  319. cp -R patch.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  320. cp -R oscar_12_1_to_oscar_12_1_1.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  321. cp -R oscar_12_1_1_to_oscar_15.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  322. cp -R legacyMyISAM.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  323. # use the stock properties file as config will fix as needed
  324. # use the specific one for this build from this makers folder
  325. cp -R oscar_mcmaster.properties ./${DEBNAME}/usr/share/${PACKAGE}/oscar_mcmaster.properties
  326. cp -R OscarON${VERSION}.sql ./${DEBNAME}/usr/share/${PACKAGE}/OscarON${VERSION}.sql
  327. cp -R OscarBC${VERSION}.sql ./${DEBNAME}/usr/share/${PACKAGE}/OscarBC${VERSION}.sql
  328. cp -R README.txt ./${DEBNAME}/usr/share/${PACKAGE}/
  329. cp -R RNGPA.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  330. cp -R special.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  331. cp -R unDemo.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  332. cp -R OLIS.sql ./${DEBNAME}/usr/share/${PACKAGE}/
  333. cp -R server.xml ./${DEBNAME}/usr/share/${PACKAGE}/
  334. cp -R run_query.sh ./${DEBNAME}/usr/share/${PACKAGE}/run_rxquery.sh
  335. chmod 711 ./${DEBNAME}/usr/share/${PACKAGE}/run_rxquery.sh
  336. # now the backup scripts
  337. cp -R backup2.sh ./${DEBNAME}/usr/share/${PACKAGE}/oscar_backup.sh
  338. chmod 711 ./${DEBNAME}/usr/share/${PACKAGE}/oscar_backup.sh
  339. mkdir -p ./${DEBNAME}/usr/share/${PACKAGE}/oscar_backup/
  340. cp -R restore2.sh ./${DEBNAME}/usr/share/${PACKAGE}/restore.sh
  341. chmod 711 ./${DEBNAME}/usr/share/${PACKAGE}/restore.sh
  342. echo "getting and loading wars"
  343. mkdir -p ./${DEBNAME}${C_BASE}webapps/
  344. echo "build directory made to receive wars"
  345. if [ "${SKIP_NEW_WAR}" = "true" ] ; then
  346. echo skipping redownloading of wars
  347. else
  348. curl -o drugref2-1.0-SNAPSHOT.war http://jenkins.oscar-emr.com:8080/job/drugref2/lastSuccessfulBuild/org.drugref\$drugref2/artifact/org.drugref/drugref2/1.0-SNAPSHOT/drugref2-1.0-SNAPSHOT.war
  349. echo "drugref war up"
  350. curl -o $TARGET http://jenkins.oscar-emr.com:8080/job/oscar-stable/lastStableBuild/artifact/target/$TARGET
  351. ##TEMPORARILY USE THE LAST BUILD REGARDLESS OF STABILITY WHILE CONGURATION CHANGES ARE MADE
  352. ## curl -o $TARGET http://jenkins.oscar-emr.com:8080/job/oscar-stable/lastBuild/artifact/target/$TARGET
  353. echo "oscar war up"
  354. fi
  355. cp drugref2-1.0-SNAPSHOT.war ./${DEBNAME}${C_BASE}webapps/drugref.war
  356. cp $TARGET ./${DEBNAME}${C_BASE}webapps/$PROGRAM.war
  357. ##cd ../
  358. ##mvn -Dmaven.test.skip=true verify
  359. # send the unpacked war into the webapps folder, then it won't clobber documents when installed
  360. #mkdir -p ./${DEBNAME}${C_BASE}webapps/OscarDocument/
  361. #until git clone git://git.code.sf.net/p/oscarmcmaster/oscar_documents; do
  362. # echo "Git clone disrupted, retrying in 2 seconds..."
  363. # sleep 2
  364. #done
  365. mkdir -p ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/${PROGRAM}/
  366. cp -r OscarDocument/oscar/ ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/
  367. echo "now adding in default inbox directories"
  368. mkdir -p ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/${PROGRAM}/incomingdocs/
  369. mkdir -p ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/${PROGRAM}/incomingdocs/1/Fax
  370. mkdir -p ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/${PROGRAM}/incomingdocs/1/File
  371. mkdir -p ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/${PROGRAM}/incomingdocs/1/Mail
  372. mkdir -p ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/${PROGRAM}/incomingdocs/1/Refile
  373. echo "now adding in Ontario Lab eform"
  374. cp -R labDecisionSupport.js ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/${PROGRAM}/eform/images/
  375. cp -R 4422-84labReq.png ./${DEBNAME}/usr/share/${PACKAGE}/OscarDocument/${PROGRAM}/eform/images/
  376. echo "now invoking dpkg -b ${DEBNAME}"
  377. dpkg -b ${DEBNAME}
  378. echo ""
  379. echo ""
  380. echo "remember to"
  381. echo scp ${DEBNAME}.deb peter_hc@frs.sourceforge.net:\"/home/frs/project/oscarmcmaster/Oscar\\ Debian\\+Ubuntu\\ deb\\ Package/\"
  382. echo ""
  383. echo "they you can"
  384. echo wget http://sourceforge.net/projects/oscarmcmaster/files/Oscar\\ Debian\\+Ubuntu\\ deb\\ Package/${DEBNAME}.deb
  385. echo ""
  386. md5sum ${DEBNAME}.deb