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

fix: adds heroes seeding to the makefile #878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
14 changes: 13 additions & 1 deletion zubhub_backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,19 @@ add-theme:
docker-compose -f docker-compose.yml exec web bash -c "rm /theme.sh"
.PHONY: add-theme

init: .env start migrate admin-user add-theme ## Initialize docker-compose containers
seed-heroes:
@echo "==="
@echo "== Seed heroes to the database =="
@echo "==="
docker-compose -f docker-compose.yml exec web bash -c "echo 'echo \"from zubhub.models import Hero; \
Hero.objects.create(title=\\\"Share your creations with others.\\\", description=\\\"Get inspired by our collection of ideas. Tinker with materials and tools around you.\\\", image_url=\\\"https://zubhub.sfo2.digitaloceanspaces.com/hero_images/hero-kidsjpg-4aac9c\\\", activity_url=\\\"https://zubhub.unstructured.studio/challenge\\\") if not Hero.objects.filter(title=\\\"Share your creations with others.\\\").exists() else print(\\\"Hero already exists\\\")\" | python /zubhub_backend/zubhub/manage.py shell' > /hero.sh"

docker-compose -f docker-compose.yml exec web bash /hero.sh
docker-compose -f docker-compose.yml exec web bash -c "rm /hero.sh"
.PHONY: seed-heroes


init: .env start migrate admin-user add-theme seed-heroes## Initialize docker-compose containers
.PHONY: init

search-index:
Expand Down