Created
September 10, 2015 15:43
-
-
Save pofider/d6804761f5e2184bf027 to your computer and use it in GitHub Desktop.
jsreport running on elastic beanstalk and storing data on EBS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .ebextensions/01-ebs.config | |
commands: | |
01clear-if-unmounted: | |
command: if ! mount | grep /media/ebs_volume > /dev/nul; then rm -rf /media/ebs_volume; fi | |
02attach-volume: | |
command: aws ec2 attach-volume --region eu-central-1 --volume-id vol-ddb08e34 --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --device /dev/sdh | |
ignoreErrors: true | |
03wait: | |
command: sleep 10 | |
04trymount: | |
command: | | |
mkdir /media/ebs_volume | |
mount /dev/sdh /media/ebs_volume | |
ignoreErrors: true | |
05format-if-not-already: | |
command: if find /media/ebs_volume/ -maxdepth 0 -empty | read v; then mkfs -t ext3 /dev/sdh; fi | |
06mount-volume: | |
command: | | |
mkdir /media/ebs_volume | |
mount /dev/sdh /media/ebs_volume | |
chown -R nodejs /media/ebs_volume |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment