This repository contains the Capistrano-based deployment system for the three OntoPortal components:
- OntoPortal Web UI (
ontoportal_web_ui) - Ontologies API (
ontologies_api) - NCBO Cron (
ncbo_cron)
It supports deployment to production and pre-production environments with a simple command-line script.
Note: This is an anonymized template. All secrets, keys, hostnames, emails and organization details have been replaced with
CHANGE_ME_*placeholders (or removed, in the case of private keys and encrypted credentials). Fill them in with your own values before deploying.
From the root of this repository, run:
./deploy.sh <application> <stage># Deploy with full name of apps in production and pre_production servers
./deploy.sh ontoportal_web_ui production
./deploy.sh ontologies_api pre_production
./deploy.sh ncbo_cron production
# Use short aliases (UI, API, CRON)
./deploy.sh UI production
./deploy.sh API pre_production
./deploy.sh CRON productionIf this repository is private, clone it on the server using a Personal Access Token (PAT).
Inside the server do:
# with user ontoportal
git clone https://<PAT_TOKEN>@github.com/your-org/ontoportal_deployment.git
cd ontoportal_deployment
./deploy.sh <application> <stage>.
├── deployment/ # Capistrano project (Ruby-based)
│ ├── Capfile # Capistrano entry point
│ ├── Gemfile # Ruby dependencies
│ └── config/
│ ├── deploy.rb # Main deployment logic
│ ├── apps/ # App-specific settings (repo, etc.)
│ │ ├── ontoportal_web_ui.rb
│ │ ├── ontologies_api.rb
│ │ └── ncbo_cron.rb
│ └── deploy/ # Environment definitions
│ ├── production.rb
│ └── pre_production.rb
├── projects_configs/ # Environment-specific config files
│ ├── ontoportal_web_ui/
│ │ ├── production/config/
│ │ └── pre_production/config/
│ ├── ontologies_api/
│ │ ├── production/config/
│ │ └── pre_production/config/
│ └── ncbo_cron/
│ ├── production/config/
│ └── pre_production/config/
├── deploy.sh # Main deployment script (use this!)
└── README.md
| Directory | Purpose |
|---|---|
deployment/ |
Contains the Capistrano automation code (Ruby) |
projects_configs/ |
Holds environment-specific configuration files that get uploaded during deploy (e.g., database.yml, settings.rb) |
deployment/config/apps/ |
Defines Git repo, app name, and other per-project settings |
deployment/config/deploy/ |
Defines servers, branches, and environment settings (production vs pre_production) |
- You run
./deploy.sh UI production - The script:
- Validates inputs
- Normalizes
UI→ontoportal_web_ui - Changes into
deployment/ - Installs Ruby gems (into
vendor/bundle) - Runs:
APP=ontoportal_web_ui bundle exec cap production deploy
- Capistrano:
- Clones the correct Git repo
- Uploads configs from
projects_configs/ontoportal_web_ui/production/config/ - Symlinks shared files
- Restarts the service (
systemctl restart ontoportal_web_ui.service)
- Ruby 3.1+ (managed via
rbenvon target servers) - SSH access to target servers as the
ontoportaluser - Internet access (to clone Git repos and install gems)
- To add a new application, create:
deployment/config/apps/<app_name>.rbprojects_configs/<app_name>/production/config/projects_configs/<app_name>/pre_production/config/
- To add a new environment, create:
deployment/config/deploy/<env_name>.rb- Update
VALID_STAGESindeploy.sh
- Config files in
projects_configs/are copied as-is to the app’srelease_pathduring deploy.