-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
39 lines (32 loc) · 1.01 KB
/
start.sh
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
33
34
35
36
37
38
39
#!/bin/bash
# Git & GitHub setup
if [ -n "$GH_PAT" -a -n "$SSH_KEY" -a -n "$KNOWN_HOSTS" ]; then
# Uncomment to debug SSH
# export GIT_SSH_COMMAND='ssh -Tv'
SSH_DIR="/etc/ssh"
mkdir -p "$SSH_DIR"
echo "$SSH_KEY" > "$SSH_DIR/id_rsa"
echo "$KNOWN_HOSTS" > "$SSH_DIR/known_hosts"
echo "Host *" >> "$SSH_DIR/ssh_config" && echo " StrictHostKeyChecking no" >> "$SSH_DIR/ssh_config"
chmod 700 "$SSH_DIR"
chmod 600 "$SSH_DIR/id_rsa"
chmod 644 "$SSH_DIR/known_hosts"
# Start the ssh-agent and add the private key
eval "$(ssh-agent -s)"
ssh-add "$SSH_DIR/id_rsa"
# gh config set git_protocol ssh --host github.com
# echo "$GH_PAT" | gh auth login --with-token
# gh auth status
git config --global user.name "autogit"
git config --global user.email "[email protected]"
# Uncomment to debug
# echo "GIT CONFIG: "
# git config --list
# echo "GH CONFIG: "
# gh config get git_protocol
else
echo "Environment variables are not set."
exit 1
fi
# Start the server
bun run index.ts