-
-
Save sydneyitguy/5572836 to your computer and use it in GitHub Desktop.
Elastic Beanstalk issue & fixes
This file contains hidden or 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
commands: | |
fix-01: | |
command: mkdir /var/app/ondeck/vendor /var/app/ondeck/public /var/app/support/bundle /var/app/support/assets /var/app/support/cache | |
fix-02: | |
command: ln -s /var/app/support/bundle /var/app/ondeck/vendor | |
fix-03: | |
command: ln -s /var/app/support/assets /var/app/ondeck/public | |
fix-04: | |
command: ln -s /var/app/support/cache /var/app/ondeck/vendor | |
fix-05: | |
command: sed -i 's/"rake/"bundle exec rake/' /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh | |
option_settings: | |
- option_name: BUNDLE_DISABLE_SHARED_GEMS | |
value: "1" | |
- option_name: BUNDLE_PATH | |
value: "vendor/bundle" |
This file contains hidden or 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
#!/usr/bin/env bash | |
mkdir /var/app/ondeck/vendor /var/app/ondeck/public /var/app/support/bundle /var/app/support/assets /var/app/support/cache | |
ln -s /var/app/support/bundle /var/app/ondeck/vendor | |
ln -s /var/app/support/assets /var/app/ondeck/public | |
ln -s /var/app/support/cache /var/app/ondeck/vendor | |
sed -i 's/"rake/"bundle exec rake/' /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh |
This file contains hidden or 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
#!/usr/bin/env bash | |
. /opt/elasticbeanstalk/support/envvars | |
cd /var/app/ondeck | |
bundle pack --all |
This file contains hidden or 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/app.config | |
option_settings: | |
- option_name: RACK_ENV | |
value: staging | |
- option_name: RAILS_ENV | |
value: staging | |
- option_name: BUNDLE_DISABLE_SHARED_GEMS | |
value: 1 | |
- option_name: BUNDLE_BIN | |
value: bin | |
- option_name: BUNDLE_PATH | |
value: vendor/bundle | |
files: | |
/opt/elasticbeanstalk/hooks/appdeploy/pre/01a_bootstrap.sh: | |
mode: "00755" | |
owner: root | |
group: root | |
source: https://s3.amazonaws.com/mybucket/bootstrap.sh | |
/opt/elasticbeanstalk/hooks/appdeploy/pre/10a_bundle_pack.sh: | |
mode: "00755" | |
owner: root | |
group: root | |
source: https://s3.amazonaws.com/mybucket/bundle_pack.sh | |
/opt/elasticbeanstalk/hooks/appdeploy/post/01_update_cache.sh: | |
mode: "00755" | |
owner: root | |
group: root | |
source: https://s3.amazonaws.com/mybucket/update_cache.sh | |
sources: | |
/var/app/support: https://s3.amazonaws.com/mybucket/bundle.tar.gz | |
/var/app/support: https://s3.amazonaws.com/mybucket/assets.tar.gz | |
packages: | |
yum: | |
git: [] | |
container_commands: | |
01_cronjobs: | |
command: "cat .ebextensions/crontab | crontab" | |
leader_only: true |
This file contains hidden or 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
#!/usr/bin/env bash | |
. /opt/elasticbeanstalk/support/envvars | |
if [ "$RAILS_ENV" != "staging" ]; then | |
exit | |
fi | |
cd /var/app/support | |
tar zcf bundle.tar.gz bundle cache | |
s3put -b mybucket -p /var/app/support -g public-read bundle.tar.gz | |
tar zcf assets.tar.gz assets | |
s3put -b mybucket -p /var/app/support -g public-read assets.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment