Changes between Initial Version and Version 1 of OpenSpecimen HowTo Build from Source Code


Ignore:
Timestamp:
06/14/16 09:11:45 (8 years ago)
Author:
Richard Bramley
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OpenSpecimen HowTo Build from Source Code

    v1 v1  
     1= OpenSpecimen HowTo Build from Source Code
     2
     3Tags: [[OpenSpecimen Summary]] [[HowTo]]
     4
     5This is the procedure for building the `war` file.  The [[Gradle]] build script can also be used to deploy OpenSpecimen to a local instance, but that is not covered here.
     6
     7== Prerequisites
     8
     9- Java JDK v1.8
     10- Gradle 2.0
     11- git
     12- node.js 10+
     13- npm
     14- bower - `npm install -g bower`
     15- grunt - `npm install -g grunt-cli`
     16- `$JAVA_HOME` set to the JDK directory
     17
     18=== Gotchas
     19
     201. The first time I build OpenSpecimen using this method I had to upgrade node and npm before installing bower and grunt.
     212. Gradle could not find node because on Ubuntu it is called nodejs so I had to create a symbolic link `sudo ln -s nodejs node` in the directory `/usr/local/bin/`.
     22
     23
     24== Procedure
     25
     261. Download the source code from the [[https://github.com/krishagni/openspecimen.git|Open Specimen Github Repository]] - **Make sure to get the correct branch for the required version**
     272. Edit the `build.properties` file with the correct values.  Here are the values for the university LAMP servers.  The other values not in this list can be deleted:
     28    {{{
     29#!java
     30        app_home = /local/openspecimen_{version_number}/app
     31        app_data_dir = /local/openspecimen_{version_number}/app/osdata
     32        datasource_jndi = java:/comp/env/jdbc/openspecimen
     33        deployment_type = upgrade
     34        database_type = mysql
     35        show_sql = false
     36        plugin_dir = /local/openspecimen_{version_number}/app/plugins
     37    }}}
     383. `cd` into the `www` directory
     394. Run the command `npm install`
     405. Run the command `bower install`
     416. `cd ..`
     427. Run the command `gradle build`
     43
     44== Deploying to [[Tomcat]]
     45
     461. Copy the `war` file to the [[Tomcat]] `webapps` directory.
     472. Amend the file in the Tomcat directory `conf/context.xml` to set up the resource:
     48{{{
     49#!xml
     50<Resource name="jdbc/openspecimen" auth="Container" type="javax.sql.DataSource"
     51     maxActive="100" maxIdle="30" maxWait="10000"
     52     username="{database_username}" password="{database_password}" driverClassName="com.mysql.jdbc.Driver"
     53     url="jdbc:mysql://localhost:3306/openspecimen"
     54     validationInterval="3600"
     55     testOnBorrow="true"
     56     validationQuery="Select 1 from dual"
     57/>
     58}}}