-
Clone the ISPyB repository:
git clone https://github.com/ispyb/ISPyB.git
-
ISPyB needs the third-party libraries provided in the
dependencies
directory. These don't exist in a public repository, so install them to the local Maven repository so that Maven can find them:cd dependencies && mvn initialize
-
Build ISPyB using Maven:
mvn clean install
By default, ISPyB builds for the
GENERIC
site and thedevelopment
environment. These can be changed with theispyb.site
andispyb.env
system properties. For example, to build for theESRF
site and thetest
environment:mvn -Dispyb.site=ESRF -Dispyb.env=test clean install
If the build succeeds, a summary message will be printed like this:
[INFO] Reactor Summary: [INFO] [INFO] ispyb-parent ...................................... SUCCESS [0.251s] [INFO] ispyb-ejb3 ........................................ SUCCESS [10.243s] [INFO] ispyb-ws .......................................... SUCCESS [1.751s] [INFO] ispyb-ui .......................................... SUCCESS [7.212s] [INFO] ispyb-ear ......................................... SUCCESS [5.048s] [INFO] ispyb-bcr ......................................... SUCCESS [2.217s] [INFO] ispyb-bcr-ear ..................................... SUCCESS [1.806s]
Run the following creation scripts from the ispyb-ejb
module (note
that this requires the pxadmin
database user to exist and have full
permissions):
-
ispyb-ejb/db/scripts/pyconfig.sql
: This corresponds to the menu options and contains both structure and data. -
ispyb-ejb/db/scripts/pydb.sql
: This corresponds to the ISPyB metadata and contains only the database structure. -
ispyb-ejb/db/scripts/schemastatus.sql
: This corresponds to theSchemaStatus
table and contains both structure and data. The entries indicate which update scripts have been run. -
ispyb-ejb/db/scripts/ispybAutoprocAttachment.sql
: This corresponds to the type and names of different autoPROC attachments.
The creation scripts are normally updated for each tag, but if you are
using the master branch, you may have to run the update scripts in
ispyb-ejb/db/scripts/ahead
.
Check the entries in the SchemaStatus
table to know which scripts
to execute. The scripts already run for the current tag are in
ispyb-ejb/db/scripts/passed
.
The first line must be:
insert into SchemaStatus (scriptName, schemaStatus) values ('2017_06_06_blabla.sql','ONGOING');
Then comes the actual updates of the script:
-- SQL statements here
And the last line must be:
update SchemaStatus set schemaStatus = 'DONE' where scriptName = '2017_06_06_blabla.sql';
The last line updates the SchemaStatus
table to mark the script as
having been run.
A patch or commit that changes the database schema must be accompanied by a corresponding change to the schema file to keep it up to date. This file can be edited using MySQL Workbench (a free tool from MySQL).