Last active
June 21, 2022 17:26
-
-
Save kevinlinxc/82044f2674fbc4faf2c517e825b39818 to your computer and use it in GitHub Desktop.
Rubygems.org Database Seeding
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
#!/bin/sh | |
set -e # exit immediately if any command fails | |
# Warning: | |
# Resets the db | |
# Assumptions: | |
# This script is run from rubygems.org root directory | |
# elasticsearch, memcached, and postgresql are running. For me, this meant | |
# docker run -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:7.10.1 | |
# memcached | |
# And the Postgresql initialized throught the Postgres app gui | |
# install all gems before trying any rails commands | |
bundle install | |
# reset db | |
bin/rails db:reset | |
# Download and load the userless data dump, for the gems | |
./script/load-pg-dump -d rubygems_development -c ~/Downloads/public_postgresql.tar | |
# Download Betty's seed user script (with modifications from Kevin) | |
# Normal link: https://github.com/Shopify/rubygems.org/blob/cf874dbaeaf933ec278a7fb293671981595cc28d/lib/tasks/gem_owners.rake | |
curl -H 'Accept: application/vnd.github.v3.raw' -o ./lib/tasks/gem_owners.rake -L https://raw.githubusercontent.com/Shopify/rubygems.org/cf874dbaeaf933ec278a7fb293671981595cc28d/lib/tasks/gem_owners.rake | |
# Run the rake seed task | |
rake gem_owners:seed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment