-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·26 lines (21 loc) · 886 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·26 lines (21 loc) · 886 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
#!/bin/sh
set -e
echo "Getting API specs..."
rm -rf /tmp/OPP-common
git clone -b main --depth 1 https://github.com/OpenParkProject/OPP-common.git /tmp/OPP-common
echo "Adding localhost to servers"
sed -i 's/servers:/servers:\n - url: http:\/\/localhost:8090\/api\/v1\n description: Local server/' /tmp/OPP-common/openapi.yaml
echo "Generating API..."
cd src
mkdir -p api
cp -a /tmp/OPP-common/openapi.yaml api/openapi.yaml
go generate && echo "API generated" || echo "API generation failed"
echo "Building app..."
go build -buildvcs=false -o /go/bin/opp-auth .
mkdir -p /root/keys && \
openssl genrsa -out /root/keys/private.pem 4096 && \
openssl rsa -in /root/keys/private.pem -pubout -out /root/keys/public.pem
export PRIVATE_KEY=$(cat /root/keys/private.pem | base64 -w 0)
export PUBLIC_KEY=$(cat /root/keys/public.pem | base64 -w 0)
echo "Starting app..."
/go/bin/opp-auth