-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
28 lines (23 loc) · 1008 Bytes
/
entrypoint.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
#!/bin/sh
# This script is initialized only once when the container is initially started.
# First, it collects the information about the machine with "asv machine" command.
# Next, it generates a new ssh keypair and prints the public key. The user must
# add this public key to their github account to allow pushes to the porepy-profiling repo.
# When the container is deleted, the keypair is forever gone.
# Finally, it runs the cron service.
# Initialize the machine information
cd ${APP_DIR}
/usr/local/bin/asv machine --yes
# Generate SSH key pair without a passphrase
ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa -N ""
# Setting ssh origin to authorize via the generated key
git remote remove origin && \
git remote add origin [email protected]:pmgbergen/porepy-profiling.git &&\
git branch --track origin main
# Printing the public key
echo "SSH key pair has been generated."
echo "Public key (add to GitHub):"
cat /root/.ssh/id_rsa.pub
echo "\n\n"
service cron start
exec tail -f /var/log/cron.log