Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Scripts reference

Yuliya Ivaniukovich edited this page Aug 31, 2020 · 4 revisions

Scripts overview

Initialize Git sub-modules

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.

Update sources recursively

Script to pull recent changes from the GUI repository and all dependent sub-modules:

.bin/update-sources.sh

Build backend sources using maven Docker container

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

Build GUI sources using node Docker container

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

Start/Restart Docker containers stack

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

Supported environment variables

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!

Re-build and re-start application

To quickly re-build and re-start the whole application you can use the following shorthand script:

.bin/rebuild-all.sh

Updating staging server

Use the following scripts sequence to update staging server with recent changes from master branch:

.bin/update-sources.sh
sudo .bin/rebuild-all.sh

Notes: