wiki:OpenSpecimen HowTo Build from Source Code

Version 6 (modified by Richard Bramley, 8 years ago) ( diff )

--

OpenSpecimen HowTo Build from Source Code

Tags: OpenSpecimen Summary HowTo

This 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.

Prerequisites

  • Java JDK v1.8
  • Gradle 2.0
  • git
  • node.js 10+
  • npm
  • bower - npm install -g bower
  • grunt - npm install -g grunt-cli
  • $JAVA_HOME set to the JDK directory

Gotchas

  1. The first time I build OpenSpecimen using this method I had to upgrade node and npm before installing bower and grunt.
  2. 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/.

Procedure

See: https://openspecimen.atlassian.net/wiki/pages/viewpage.action?pageId=1115955

  1. Download the source code from the releases tab of the Open Specimen Github Repository - Make sure to get the correct branch for the required version
  2. 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:
    app_home = /local/openspecimen_{version_number}/app
    app_data_dir = /local/openspecimen_{version_number}/app/osdata
    datasource_jndi = java:/comp/env/jdbc/openspecimen
    deployment_type = upgrade
    database_type = mysql
    show_sql = false
    plugin_dir = /local/openspecimen_{version_number}/app/plugins
    
  3. cd into the www directory
  4. Run the command npm install
  5. Run the command bower install
  6. cd ..
  7. Run the command gradle build

Deploying to Tomcat

  1. Copy the war file to the Tomcat webapps directory.
  2. Amend the file in the Tomcat directory conf/context.xml to set up the resource:
    <Resource name="jdbc/openspecimen" auth="Container" type="javax.sql.DataSource"
         maxActive="100" maxIdle="30" maxWait="10000"
         username="{database_username}" password="{database_password}" driverClassName="com.mysql.jdbc.Driver"
         url="jdbc:mysql://localhost:3306/openspecimen"
         validationInterval="3600"
         testOnBorrow="true"
         validationQuery="Select 1 from dual"
    />
    

Error: Macro BackLinks(None) failed
'Environment' object has no attribute 'get_db_cnx'

Note: See TracWiki for help on using the wiki.