Skip to content

Commit

Permalink
Merge branch 'development' into makefile_additions
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdentremont authored Apr 26, 2023
2 parents 513eef7 + 0743825 commit 4f332ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,27 @@ local: generate-secrets
docker-compose up -d --remove-orphans
docker-compose exec -T drupal with-contenv bash -lc 'composer install; chown -R nginx:nginx .'
$(MAKE) remove_standard_profile_references_from_config drupal-database update-settings-php ENVIRONMENT=local
docker-compose exec -T drupal with-contenv bash -lc "drush si -y islandora_install_profile_demo --account-pass $(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)"
docker-compose exec -T drupal with-contenv bash -lc "drush si -y islandora_install_profile_demo --account-pass '$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)'"
$(MAKE) delete-shortcut-entities && docker-compose exec -T drupal with-contenv bash -lc "drush pm:un -y shortcut"
docker-compose exec -T drupal with-contenv bash -lc "drush en -y migrate_tools"
$(MAKE) hydrate ENVIRONMENT=local
-docker-compose exec -T drupal with-contenv bash -lc 'mkdir -p /var/www/drupal/config/sync && chmod -R 775 /var/www/drupal/config/sync'
#docker-compose exec -T drupal with-contenv bash -lc 'chown -R `id -u`:nginx /var/www/drupal'
#docker-compose exec -T drupal with-contenv bash -lc 'drush migrate:rollback islandora_defaults_tags,islandora_tags'
curl -k -u admin:$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD) -H "Content-Type: application/json" -d "@build/demo-data/homepage.json" https://${DOMAIN}/node?_format=json
curl -k -u admin:$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD) -H "Content-Type: application/json" -d "@build/demo-data/browse-collections.json" https://${DOMAIN}/node?_format=json
curl -k -u admin:'$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)' -H "Content-Type: application/json" -d "@build/demo-data/homepage.json" https://${DOMAIN}/node?_format=json
curl -k -u admin:'$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)' -H "Content-Type: application/json" -d "@build/demo-data/browse-collections.json" https://${DOMAIN}/node?_format=json
$(MAKE) login


.PHONY: starter
## Make a local site with codebase directory bind mounted, using starter site.
## Make a local site with codebase directory bind mounted, using starter site unless other package specified in .env or present already.
starter: QUOTED_CURDIR = "$(CURDIR)"
starter: generate-secrets
$(MAKE) starter-init ENVIRONMENT=starter
if [ -z "$$(ls -A $(QUOTED_CURDIR)/codebase)" ]; then \
docker container run --rm -v $(CURDIR)/codebase:/home/root $(REPOSITORY)/nginx:$(TAG) with-contenv bash -lc 'composer create-project islandora/islandora-starter-site:dev-main /tmp/codebase; mv /tmp/codebase/* /home/root;'; \
docker container run --rm -v $(CURDIR)/codebase:/home/root $(REPOSITORY)/nginx:$(TAG) with-contenv bash -lc 'composer create-project $(CODEBASE_PACKAGE) /tmp/codebase; mv /tmp/codebase/* /home/root;'; \
else \
docker container run --rm -v $(CURDIR)/codebase:/home/root $(REPOSITORY)/nginx:$(TAG) with-contenv bash -lc 'cd /home/root; composer install'; \
fi
$(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=starter
docker-compose up -d --remove-orphans
Expand Down Expand Up @@ -493,7 +495,8 @@ demo_content:
# if prod do this by default
[ -d "islandora_workbench" ] || (git clone https://github.com/mjordan/islandora_workbench)
cd islandora_workbench ; cd islandora_workbench_demo_content || git clone https://github.com/DonRichards/islandora_workbench_demo_content
$(SED_DASH_I) 's/^nopassword.*/password\: $(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD) /g' islandora_workbench/islandora_workbench_demo_content/example_content.yml
$(SED_DASH_I) 's#^host.*#host: $(SITE)/#g' islandora_workbench/islandora_workbench_demo_content/example_content.yml
$(SED_DASH_I) 's/^password.*/password: "$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD | sed s#/#\\\\\\\\/#g)"/g' islandora_workbench/islandora_workbench_demo_content/example_content.yml
cd islandora_workbench && docker build -t workbench-docker .
cd islandora_workbench && docker run -it --rm --network="host" -v $(QUOTED_CURDIR)/islandora_workbench:/workbench --name my-running-workbench workbench-docker bash -lc "./workbench --config /workbench/islandora_workbench_demo_content/example_content.yml"
$(MAKE) reindex-solr
Expand Down Expand Up @@ -571,7 +574,7 @@ starter-init: generate-secrets
starter-finalize:
docker-compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx .'
$(MAKE) drupal-database update-settings-php
docker-compose exec -T drupal with-contenv bash -lc "drush si -y --existing-config minimal --account-pass $(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)"
docker-compose exec -T drupal with-contenv bash -lc "drush si -y --existing-config minimal --account-pass '$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD)'"
docker-compose exec -T drupal with-contenv bash -lc "drush -l $(SITE) user:role:add fedoraadmin admin"
MIGRATE_IMPORT_USER_OPTION=--userid=1 $(MAKE) hydrate
docker-compose exec -T drupal with-contenv bash -lc 'drush -l $(SITE) migrate:import --userid=1 islandora_fits_tags'
Expand Down
4 changes: 4 additions & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ CUSTOM_IMAGE_NAME=${COMPOSE_PROJECT_NAME}_drupal
# when building a custom image with make build
CUSTOM_IMAGE_TAG=latest

# Packagist repo to use when creating a site with make starter
# Change this if you want to build from a different codebase than the starter site
CODEBASE_PACKAGE=islandora/islandora-starter-site:dev-main

# Includes `traefik` as a service, if false assume we are sharing a traefik
# from another project.
INCLUDE_TRAEFIK_SERVICE=true
Expand Down

0 comments on commit 4f332ef

Please sign in to comment.