CircleCI Integration
Fast, deterministic test data for CircleCI workflows.
Prerequisite
You need a Pro License to use the --auto-approve flag required for
non-interactive CI/CD environments.
Setup Guide
1. Add Context or Environment Variable
Go to Project Settings > Environment Variables (or create a Context in Organization Settings).
- Name:
APHELION_LICENSE_KEY - Value: Your Pro license key
2. Configure .circleci/config.yml
version: 2.1
executors:
node-pg:
docker:
- image: cimg/node:18.0
- image: cimg/postgres:14.0
environment:
POSTGRES_USER: root
POSTGRES_DB: test_db
POSTGRES_HOST_AUTH_METHOD: trust
jobs:
test:
executor: node-pg
steps:
- checkout
- run:
name: Download Aphelion CLI
command: |
curl -L "https://algomimic.com/api/download/pro?key=${APHELION_LICENSE_KEY}" \
-o aphelion
chmod +x aphelion
- run:
name: Wait for Postgres
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Clone Database
command: |
./aphelion clone "postgresql://production-read-replica..." \
"postgresql://root@localhost/test_db" \
--auto-approve \
--seed 12345
- run:
name: Run Tests
command: npm test
workflows:
version: 2
build_and_test:
jobs:
- test:
context: aphelion-context # If using contexts
Advanced Configuration
Using Orbs
While we don't have an official Orb yet, you can wrap the install logic in a reusable command:
commands:
install-aphelion:
steps:
- run:
name: Install Aphelion
command: |
# Install script...
echo 'export PATH=$PATH:$(pwd)' >> $BASH_ENV