Set Up on macOS
Follow these steps to configure your environment variablesThe BuildNinja Server and Agent rely on environment variables to define their configuration and communication parameters. These variables determine how the server manages builds, connects to the database, and handles aut… on a macOS system.
-
Open a terminal window.
-
Determine your current shell by running:
echo $SHELLnote- If you're using Zsh (default in macOS Catalina and later), proceed with
.zshrc. - If you're using Bash, use
.bash_profileinstead.
- If you're using Zsh (default in macOS Catalina and later), proceed with
-
Edit the appropriate shell configuration file.
nano ~/.zshrc -
Add the environment variables to the end of the file.
# Server
export BN_SERVER_PUBLIC_URL="http://localhost:8800"
export BN_SERVER_PORT=8800
export BN_SERVER_MONGOURI="mongodb://user:pass@localhost:27017/xxcicd_db?authSource=admin"
export BN_SERVER_MONGODB=bn_server_stage
export BN_SERVER_DATA_DIR="/usr/local/buildninja/data"
export BN_SERVER_JWT_SIGN_KEY="s3cure$ecretKey_123!xyz"
export BN_SERVER_CLIENT_PATH="/usr/local/buildninja/webclient"
export BN_SERVER_SSL_CERT="/usr/local/etc/ssl/buildninja.crt"
export BN_SERVER_SSL_KEY="/usr/local/etc/ssl/buildninja.key"
# Agent
export BN_AGENT_NAME="agent-macos-01"
export BN_AGENT_PORT=9500
export BN_AGENT_SERVER_URL="http://192.168.1.100:8800"
export BN_AGENT_SELFURL="http://192.168.1.53:9500"
export BN_AGENT_DATA_DIR="/usr/local/buildninja/agent/data" -
Save and exit the editor. Press Ctrl + X, then Y, and press Enter to confirm.
-
Apply the changes to your shell session.
source ~/.zshrc