-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh.old
executable file
·48 lines (33 loc) · 1.27 KB
/
entrypoint.sh.old
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
40
41
42
43
44
45
46
47
48
#!/bin/sh
set -o errexit
# Referenced:
# https://docs.aws.amazon.com/lambda/latest/dg/runtimes-walkthrough.html
env
while true
do
# HEADERS="$(mktemp)"
# Get an event. The HTTP request will block until one is received
# EVENT_DATA=$(curl -sS -LD "$HEADERS" -X GET "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/next")
# Extract request ID by scraping response headers received above
# REQUEST_ID=$(grep -Fi Lambda-Runtime-Aws-Request-Id "$HEADERS" | tr -d '[:space:]' | cut -d: -f2)
###############################
# Start Farese church updater #
###############################
# echo test
cd $(mktemp -d)
git clone --depth=2 --branch=prod https://github.com/prbc/farese.git
cd farese
git config user.name "Farese Updater"
git config user.email "[email protected]"
echo "$EVENT_DATA" | jq .body | base64 -d > map/data.json
# echo "$EVENT_DATA" | jq > map/data.json
cat map/data.json
git add -A
git commit -m 'test commit'
git show
#############################
# End Farese church updater #
#############################
# Send the response
# curl -s -X POST "http://${AWS_LAMBDA_RUNTIME_API}/2018-06-01/runtime/invocation/$REQUEST_ID/response" -d "{"StatusCode": 200,"ExecutedVersion": "$LATEST"}"
done