File tree 4 files changed +22
-10
lines changed
4 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ services:
82
82
- AUTOGRAPH_KEY=19zd4w3xirb5syjgdx8atq6g91m03bdsmzjifs2oddivswlu9qs
83
83
# set a non-empty value to use the lambda handler
84
84
- LAMBDA_TASK_ROOT=/usr/local/bin/
85
- - AUTOGRAPH_ROOT_HASH
86
85
ports :
87
86
- " 9000:8080"
88
87
links :
@@ -103,7 +102,6 @@ services:
103
102
- AUTOGRAPH_KEY=19zd4w3xirb5syjgdx8atq6g91m03bdsmzjifs2oddivswlu9qs
104
103
# set a non-empty value to use the lambda handler
105
104
- LAMBDA_TASK_ROOT=/usr/local/bin/
106
- - AUTOGRAPH_ROOT_HASH
107
105
ports :
108
106
- " 9001:8080"
109
107
links :
Original file line number Diff line number Diff line change @@ -2,11 +2,14 @@ FROM autograph-app
2
2
3
3
USER root
4
4
5
- RUN cp /app/src/autograph/bin/ test_monitor.sh /usr/local/bin/test_monitor.sh
5
+ ADD test_monitor.sh /usr/local/bin/test_monitor.sh
6
6
RUN curl -Lo /usr/local/bin/aws-lambda-rie \
7
- https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie \
8
- && \
9
- chmod +x /usr/local/bin/aws-lambda-rie /usr/local/bin/test_monitor.sh
7
+ https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie && \
8
+ chmod +x /usr/local/bin/aws-lambda-rie
9
+
10
+ # Use an entrypoint to determine the AUTOGRAPH_ROOT_HASH
11
+ COPY lambda-setup-entrypoint.sh /usr/local/bin/lambda-setup-entrypoint.sh
12
+ ENTRYPOINT ["/usr/local/bin/lambda-setup-entrypoint.sh"]
10
13
11
14
USER app
12
- CMD ["/usr/local/bin/aws-lambda-rie", "/ go/bin/autograph-monitor"]
15
+ CMD ["/go/bin/autograph-monitor"]
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export AUTOGRAPH_ROOT_HASH=$(autograph-client -t "$AUTOGRAPH_URL" -listconfig no
8
8
jq -r ' .cacert' | openssl x509 -outform der | openssl dgst -sha256 -hex | \
9
9
awk ' {print $2}' | tr ' [:lower:]' ' [:upper:]' )
10
10
11
- # invoke a test monitor run in a lambda monitor
12
- MONITOR_ERROR=$( curl -w ' \n' -X POST ' http://localhost:8080/2015-03-31/functions/function/invocations' -d ' {}' )
13
- test " $MONITOR_ERROR = null"
11
+ echo " Autograph instance: $AUTOGRAPH_URL "
12
+ echo " Got Root hash: $AUTOGRAPH_ROOT_HASH "
13
+ echo " Starting lambda: $@ "
14
+ /usr/local/bin/aws-lambda-rie " $@ "
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+ set -o pipefail
5
+
6
+ MONITOR_ENDPOINT=${1:- " http://localhost:8080" }
7
+
8
+ # invoke a test monitor run in a lambda monitor
9
+ MONITOR_ERROR=$( curl -w ' \n' -X POST " $MONITOR_ENDPOINT /2015-03-31/functions/function/invocations" -d ' {}' )
10
+ test " $MONITOR_ERROR = null"
You can’t perform that action at this time.
0 commit comments