Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update things related to some package manager influencing setup process #7578

Merged
merged 3 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.12.0
14.16.1
15 changes: 1 addition & 14 deletions script/setup
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,28 @@ RED='\033[0;31m'
NO_COLOR='\033[0m'

RUBY_VERSION=$(cat .ruby-version)
NODE_VERSION=$(cat .node-version)

# Check ruby version
if ! ruby --version | grep $RUBY_VERSION > /dev/null; then
printf "${RED}Open Food Network requires ruby ${RUBY_VERSION}${NO_COLOR}. Have a look at: https://github.com/rbenv/rbenv\n"
exit 1
fi

# Check node version
if ! node --version | grep $NODE_VERSION > /dev/null; then
printf "${RED}Open Food Network requires node ${NODE_VERSION}${NO_COLOR}. Have a look at: https://github.com/nodenv/nodenv\n"
exit 1
fi

# Set up Ruby dependencies via Bundler
if ! command -v bundle > /dev/null; then
./script/install-bundler
fi

# Install all dependencies
bundle check || bundle install
npm install
yarn install

# Set up configurable environment variables
if [ ! -f config/application.yml ]; then
cp config/application.yml.example config/application.yml
printf "${YELLOW}Copied config/application.yml Make sure to fill it with the appropriate configuration values.\n\n${NO_COLOR}"
fi

# Set up newrelic.yml for development environment, used by the newrelic_rpm gem
if [ ! -f config/newrelic.yml ]; then
cp config/newrelic.yml.example config/newrelic.yml
printf "${YELLOW}Copied config/newrelic.yml which configures the development environment for the newrelic_rpm gem.\n\n${NO_COLOR}"
fi

# Set up the database for both development and test
# Confirming the default user and password
printf '\n\n' | bundle exec rake db:setup db:test:prepare
Expand Down