Skip to content

Instantly share code, notes, and snippets.

@dgitman
Last active August 24, 2019 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgitman/d42def493fcfc08fb943dbe9aec597d9 to your computer and use it in GitHub Desktop.
Save dgitman/d42def493fcfc08fb943dbe9aec597d9 to your computer and use it in GitHub Desktop.
files:
/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn.sh:
content: |-
#!/usr/bin/env bash
set -xe
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_APP_STAGING_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir)
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
# Install nodejs
echo "install nodejs"
curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -
yum -y install nodejs
echo "install yarn"
# install yarn
wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo;
yum -y install yarn;
# yarn install
cd $EB_APP_STAGING_DIR
yarn
# mkdir /home/webapp
mkdir -p /home/webapp
chown webapp:webapp /home/webapp
chmod 700 /home/webapp
group: root
mode: "000755"
owner: root
@dgitman
Copy link
Author

dgitman commented Aug 24, 2019

Second try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment