Skip to content

Commit

Permalink
Run with erl daemon rather than launchd
Browse files Browse the repository at this point in the history
  • Loading branch information
klaus993 committed Aug 26, 2024
1 parent ea04501 commit 4d1d429
Showing 1 changed file with 2 additions and 118 deletions.
120 changes: 2 additions & 118 deletions devops/deploy-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,121 +28,5 @@ fi
rm -rf ${HOME}/arena/mirra_backend
mv /tmp/mirra_backend ${HOME}/arena/

mkdir -p ${HOME}/.config/systemd/user/

cat <<EOF >${HOME}/Library/LaunchAgents/${RELEASE}.plist
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.lambdaclass.${RELEASE}</string>
<key>ServiceDescription</key>
<string>Arena</string>
<key>Program</key>
<string>${HOME}/arena/mirra_backend/devops/entrypoint-macos.sh</string>
<key>WorkingDirectory</key>
<string>${HOME}/arena/mirra_backend</string>
<key>StandardOutputPath</key>
<string>${HOME}/arena/arena.log</string>
<key>StandardErrorPath</key>
<string>${HOME}/arena/arena.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>PHX_HOST</key>
<string>
${PHX_HOST}
</string>
<key>DATABASE_URL</key>
<string>
${DATABASE_URL}
</string>
<key>PHX_SERVER</key>
<string>
${PHX_SERVER}
</string>
<key>SECRET_KEY_BASE</key>
<string>
${SECRET_KEY_BASE}
</string>
<key>JWT_PRIVATE_KEY_BASE_64</key>
<string>
${JWT_PRIVATE_KEY_BASE_64}
</string>
<key>PORT</key>
<string>
${PORT}
</string>
<key>RELEASE_NODE</key>
<string>
${RELEASE_NODE}
</string>
<key>GATEWAY_URL</key>
<string>
${GATEWAY_URL}
</string>
<key>METRICS_ENDPOINT_PORT</key>
<string>
${METRICS_ENDPOINT_PORT}
</string>
<key>OVERRIDE_JWT</key>
<string>
${OVERRIDE_JWT}
</string>
<key>GOOGLE_CLIENT_ID</key>
<string>
${GOOGLE_CLIENT_ID}
</string>
<key>BOT_MANAGER_PORT</key>
<string>
${BOT_MANAGER_PORT}
</string>
<key>BOT_MANAGER_HOST</key>
<string>
${BOT_MANAGER_HOST}
</string>
<key>CONFIGURATOR_HOST</key>
<string>
${CONFIGURATOR_HOST}
</string>
<key>CONFIGURATOR_GOOGLE_CLIENT_ID</key>
<string>
${CONFIGURATOR_GOOGLE_CLIENT_ID}
</string>
<key>CONFIGURATOR_GOOGLE_CLIENT_SECRET</key>
<string>
${CONFIGURATOR_GOOGLE_CLIENT_SECRET}
</string>
<key>RELEASE</key>
<string>
${RELEASE}
</string>
<key>TARGET_SERVER</key>
<string>
${TARGET_SERVER}
</string>
<key>LOADTEST_EUROPE_HOST</key>
<string>
${LOADTEST_EUROPE_HOST}
</string>
<key>LOADTEST_BRAZIL_HOST</key>
<string>
${LOADTEST_BRAZIL_HOST}
</string>
</dict>
<key>RunAtLoad</key>
<false />
</dict>
</plist>
EOF

launchctl unload ${HOME}/Library/LaunchAgents/${RELEASE}.plist || true
launchctl load ${HOME}/Library/LaunchAgents/${RELEASE}.plist
launchctl start com.lambdaclass.${RELEASE}
/Users/lambdaclass/arena/mirra_backend/_build/prod/rel/arena/bin/arena stop
/Users/lambdaclass/arena/mirra_backend/_build/prod/rel/arena/bin/arena daemon

0 comments on commit 4d1d429

Please sign in to comment.