-
Notifications
You must be signed in to change notification settings - Fork 60
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
Starter site integration #287
Changes from 5 commits
d912e06
13020e6
8ffdb66
6565817
9f44038
29e2561
848c8f7
b82e6de
dbbf07a
ecb139d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,7 @@ run-islandora-migrations: | |
#docker-compose exec -T drupal with-contenv bash -lc "for_all_sites import_islandora_migrations" | ||
# this line can be reverted when https://github.com/Islandora-Devops/isle-buildkit/blob/fae704f065435438828c568def2a0cc926cc4b6b/drupal/rootfs/etc/islandora/utilities.sh#L557 | ||
# has been updated to match | ||
docker-compose exec -T drupal with-contenv bash -lc 'drush -l $(SITE) migrate:import islandora_defaults_tags,islandora_tags' | ||
docker-compose exec -T drupal with-contenv bash -lc 'drush -l $(SITE) migrate:import $(MIGRATE_IMPORT_USER_OPTION) islandora_defaults_tags,islandora_tags' | ||
|
||
.PHONY: solr-cores | ||
## Creates solr-cores according to the environment variables. | ||
|
@@ -518,4 +518,50 @@ fix_masonry: | |
## This fixes a know issues with views when using the make local build. The error must be triggered before this will work. | ||
fix_views: | ||
docker cp scripts/patch_views.sh $$(docker ps --format "{{.Names}}" | grep drupal):/var/www/drupal/patch_views.sh | ||
docker-compose exec -T drupal with-contenv bash -lc "bash /var/www/drupal/patch_views.sh ; rm /var/www/drupal/patch_views.sh ; drush cr" | ||
docker-compose exec -T drupal with-contenv bash -lc "bash /var/www/drupal/patch_views.sh ; rm /var/www/drupal/patch_views.sh ; drush cr" | ||
|
||
.PHONY: starter | ||
## Make a local site with codebase directory bind mounted, using starter site. | ||
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;'; \ | ||
fi | ||
$(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIROMENT=starter | ||
docker-compose up -d --remove-orphans | ||
docker-compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx .' | ||
$(MAKE) starter-finalize ENVIROMENT=starter | ||
|
||
.PHONY: starter_dev | ||
## Make a local site with codebase directory bind mounted, using cloned starter site. | ||
starter_dev: QUOTED_CURDIR = "$(CURDIR)" | ||
starter_dev: generate-secrets | ||
$(MAKE) starter-init ENVIRONMENT=starter_dev | ||
if [ -z "$$(ls -A $(QUOTED_CURDIR)/codebase)" ]; then \ | ||
docker container run --rm -v $(CURDIR)/codebase:/home/root $(REPOSITORY)/nginx:$(TAG) with-contenv bash -lc 'git clone -b main https://github.com/Islandora/islandora-starter-site /home/root;'; \ | ||
fi | ||
$(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIROMENT=starter_dev | ||
docker-compose up -d --remove-orphans | ||
docker-compose exec -T drupal with-contenv bash -lc 'composer install' | ||
docker-compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx .' | ||
$(MAKE) starter-finalize ENVIROMENT=starter_dev | ||
|
||
|
||
.PHONY: starter-init | ||
starter-init: generate-secrets | ||
$(MAKE) download-default-certs | ||
$(MAKE) -B docker-compose.yml | ||
$(MAKE) pull | ||
mkdir -p $(CURDIR)/codebase | ||
|
||
.PHONY: starter-finalize | ||
starter-finalize: | ||
$(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 -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' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for reference, this |
||
#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' | ||
Comment on lines
+565
to
+566
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copypasta from the |
||
$(MAKE) login |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Container does not perform any initialization aside from importing env-vars from `confd`. | ||
# Users are expected to manually set up their site using a combination of the following: | ||
# - Makefile targets | ||
# - composer requires / install | ||
# - Drush commands | ||
# - Manual changes to the codebase directory | ||
version: "3.7" | ||
networks: | ||
default: | ||
internal: true | ||
gateway: | ||
external: true | ||
volumes: | ||
drupal-sites-data: | ||
solr-data: | ||
services: | ||
drupal: | ||
restart: ${RESTART_POLICY:-unless-stopped} | ||
image: ${REPOSITORY:-islandora}/drupal:${TAG:-latest} | ||
volumes: | ||
- ../../codebase:/var/www/drupal:delegated | ||
- drupal-sites-data:/var/www/drupal/web/sites/default/files | ||
- solr-data:/opt/solr/server/solr | ||
environment: | ||
DRUPAL_DEFAULT_INSTALL_EXISTING_CONFIG: ${INSTALL_EXISTING_CONFIG} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This (and |
||
DRUPAL_DEFAULT_PROFILE: ${DRUPAL_INSTALL_PROFILE} | ||
depends_on: | ||
# Requires a the very minimum a database. | ||
- ${DRUPAL_DATABASE_SERVICE} | ||
# Extends docker-compose.solr.yml | ||
solr: | ||
volumes: | ||
# On a production site you may not want to take this approach but instead refer to each of the cores | ||
# data directories specifically and maintain the configuration as part of a customized image, where | ||
# in your configuration is Solr managed under source control somewhere. | ||
- solr-data:/opt/solr/server/solr |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Container does not perform any initialization aside from importing env-vars from `confd`. | ||
# Users are expected to manually set up their site using a combination of the following: | ||
# - Makefile targets | ||
# - composer requires / install | ||
# - Drush commands | ||
# - Manual changes to the codebase directory | ||
version: "3.7" | ||
networks: | ||
default: | ||
internal: true | ||
gateway: | ||
external: true | ||
volumes: | ||
drupal-sites-data: | ||
solr-data: | ||
services: | ||
drupal: | ||
restart: ${RESTART_POLICY:-unless-stopped} | ||
image: ${REPOSITORY:-islandora}/drupal:${TAG:-latest} | ||
volumes: | ||
- ../../codebase:/var/www/drupal:delegated | ||
- drupal-sites-data:/var/www/drupal/web/sites/default/files | ||
- solr-data:/opt/solr/server/solr | ||
environment: | ||
DRUPAL_DEFAULT_INSTALL_EXISTING_CONFIG: ${INSTALL_EXISTING_CONFIG} | ||
DRUPAL_DEFAULT_PROFILE: ${DRUPAL_INSTALL_PROFILE} | ||
depends_on: | ||
# Requires a the very minimum a database. | ||
- ${DRUPAL_DATABASE_SERVICE} | ||
# Extends docker-compose.solr.yml | ||
solr: | ||
volumes: | ||
# On a production site you may not want to take this approach but instead refer to each of the cores | ||
# data directories specifically and maintain the configuration as part of a customized image, where | ||
# in your configuration is Solr managed under source control somewhere. | ||
- solr-data:/opt/solr/server/solr |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,7 @@ CODE_SERVER_PORT=8443 | |
############################################################################### | ||
|
||
DOMAIN=islandora.traefik.me | ||
SITE=https://${DOMAIN} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given this is provided to many(/most?) |
||
DISABLE_SYN=false | ||
FEDORA_6=true | ||
RESTART_POLICY=unless-stopped | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the
MIGRATE_IMPORT_USER_OPTION
variable is not otherwise specified,$(MIGRATE_IMPORT_USER_OPTION)
should just give the empty string, which should continue to run this as it was... but can now specify the variable (as something likeMIGRATE_IMPORT_USER_OPTION=--userid=1
(as is being done under thestarter-finalize
make target)) in order to have it perform themigrate:import
command as a particular user, of whom we can assure thefedoraAdmin
role is present.