-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
32 lines (26 loc) · 998 Bytes
/
entrypoint.sh
File metadata and controls
32 lines (26 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
if [ -z "$CASED_SHELL_SECRET" ]; then
echo "CASED_SHELL_SECRET required"
exit 1
fi
# Configure Cased Shell for Heroku
export CASED_SHELL_PORT=$PORT
export CASED_SHELL_TLS=off
export CASED_SHELL_PLUGINS="approval"
export CASED_SHELL_APPROVALS="does-not-exist"
: ${CASED_SHELL_LOG_LEVEL:="error"}
let HEROKU_SSH_PORT=PORT+1 ;
export CASED_SHELL_OAUTH_UPSTREAM=localhost:$HEROKU_SSH_PORT
echo "starting ssh server"
PORT=$HEROKU_SSH_PORT /bin/heroku-ssh heroku https://$CASED_SHELL_HOSTNAME bash -i &
echo "parsing jump config"
ONCE=true /bin/jump /jump.yml /tmp/jump.json
sed -i "s/\$HEROKU_APP_NAME/$HEROKU_APP_NAME/g" /tmp/jump.json
jq --arg placeholder \$HEROKU_SSH_PORT --arg port $HEROKU_SSH_PORT \
'.prompts | map((select(.port == $placeholder) | .port) |= $port) | { prompts: .}' \
/tmp/jump.json > /tmp/prompts.json
export CASED_SHELL_HOST_FILE=/tmp/prompts.json
echo "starting cased shell server"
python -u run.py --logging=$CASED_SHELL_LOG_LEVEL &
ps axjf
wait -n