mirror of https://github.com/OpenVidu/openvidu.git
deployment: Cache openvidu/openvidu-recording docker image in EC2 from AMI on start to fix first recording failed issue."
parent
5b79f9a0a1
commit
fb7ba4b701
|
@ -90,6 +90,25 @@ Resources:
|
|||
mode: "000755"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
"/usr/local/bin/testRecording.sh":
|
||||
content: |
|
||||
#!/bin/bash -x
|
||||
TEST_RECORDING_DIR="/opt/openvidu/test-recording"
|
||||
|
||||
docker run -d --rm --name=test-recording -e URL=https://openvidu.io/ -v "${TEST_RECORDING_DIR}":/recordings openvidu/openvidu-recording:2.19.0
|
||||
|
||||
# Wait to file to be created
|
||||
while [ ! -f "${TEST_RECORDING_DIR}/video/video.mp4" ]; do sleep 1; done
|
||||
|
||||
# Sleep 30 seconds
|
||||
sleep 30
|
||||
|
||||
# Clean test recording
|
||||
docker rm -f test-recording
|
||||
rm -rf "${TEST_RECORDING_DIR}"
|
||||
mode: "000755"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
"/usr/local/bin/runMediaNode.sh":
|
||||
content: |
|
||||
#!/bin/bash
|
||||
|
@ -126,6 +145,8 @@ Resources:
|
|||
|
||||
/usr/local/bin/runMediaNode.sh || { echo "[OpenVidu] error running Media Node"; exit 1; }
|
||||
|
||||
echo "@reboot /usr/local/bin/testRecording.sh >> /var/log/testRecording.log 2>&1" | crontab
|
||||
|
||||
# sending the finish call
|
||||
/usr/local/bin/cfn-signal -e $? --stack ${AWS::StackId} --resource WaitCondition --region ${AWS::Region}
|
||||
|
||||
|
|
Loading…
Reference in New Issue