-
Notifications
You must be signed in to change notification settings - Fork 9
Scripts reference
Script to load all the dependent sub-modules to be able to build and run the whole application stack locally:
.bin/init.sh
Can be skipped if clone was done with --recurse-submodules flag.
Script to pull recent changes from the GUI repository and all dependent sub-modules:
.bin/update-sources.sh
Before building sources for the first time you need to initialize a Docker volume to re-use maven dependencies repository:
server/.bin/init.sh
To build all the backend services use the following script:
server/.bin/build-all.sh
Use the following script to build application GUI:
.bin/build-gui.sh
By default GUI is built to expect API to be available at /api context path.
You can override that before build using .env.production.local file with the following variable:
REACT_APP_API_ROOT=/custom/api
Preparation: before starting stack you need to define environment variables, for that you need to create a script
.bin/set-env.sh which should look like the following:
#!/usr/bin/env bash
export COMPOSE_PROJECT_NAME=veraPDF
export LOCAL_STORAGE_SERVICE_DATABASE_USER=your_user
export LOCAL_STORAGE_SERVICE_DATABASE_PASSWORD=your_password
export JOB_SERVICE_DATABASE_USER=your_user
export JOB_SERVICE_DATABASE_PASSWORD=your_password
export AMQP_SERVER_USER=your_user
export AMQP_SERVER_PASSWORD=your_password
| Variable | Required | Description |
|---|---|---|
| COMPOSE_PROJECT_NAME | Docker Compose project name, will be used as a prefix for all the services in stack | |
| LOCAL_STORAGE_SERVICE_DATABASE_USER | yes | Username for file storage database |
| LOCAL_STORAGE_SERVICE_DATABASE_PASSWORD | yes | Password for file storage database |
| LOCAL_STORAGE_SERVICE_DISK_MIN_SPACE_THRESHOLD | Minimal disk space which should be available to accept new file uploads. Default: 5GB
|
|
| JOB_SERVICE_DATABASE_USER | yes | Username for job service database |
| JOB_SERVICE_DATABASE_PASSWORD | yes | Password for job service database |
| AMQP_SERVER_USER | yes | Username for validation tasks queue |
| AMQP_SERVER_PASSWORD | yes | Password for validation tasks queue |
| GUI_PORT | Port which will be mapped to web server hosting GUI and serving as API gateway. Default: 80
|
Once you defined required environment variables you can use the following script to launch or re-start Docker Compose application stack:
.bin/restart-docker.sh
Sometimes on consequent restarts you might need to purge the data (e.g. if database schema has changed). You can make this using:
.bin/restart-docker.sh --clean
Be careful since it will remove all the named volumes and orphan containers in this case!
To quickly re-build and re-start the whole application you can use the following shorthand script:
.bin/rebuild-all.sh
Use the following scripts sequence to update staging server with recent changes from master branch:
.bin/update-sources.sh
sudo .bin/rebuild-all.sh
- Staging server is mapped to port
8001at the moment and is proxied using another NGINX installed on the server. - New GUI is available under https://verapdf.duallab.com/ and its API under https://verapdf.duallab.com/demo/api.