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

Install profile #160

Merged
merged 30 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ffba761
Nerfing make demo so I can get through to actually using the install …
dannylamb Apr 15, 2021
f1388e8
Finding profile and blowing up on not finding the theme
dannylamb Apr 16, 2021
90ab2ae
Finally installing
dannylamb Apr 23, 2021
1766a65
Making it so you can build from images on dockerhub
dannylamb Apr 23, 2021
025e39e
Updating makefile
dannylamb Apr 27, 2021
bc36645
updating buildkit hash
dannylamb May 6, 2021
7a8b18b
Make local works
dannylamb May 6, 2021
430d577
Confirm on clean
May 6, 2021
624cb73
Adding REPOSITORY to make local
dannylamb May 17, 2021
504a4fc
Bumping buildkit hash
dannylamb May 17, 2021
e35e7ea
Adds the config/sync directory if it doesn't already exist and chowns it
May 17, 2021
65cc504
Getting ready to pull in upstream
dannylamb Jul 16, 2021
7aed31a
Temp edit - islandora_profile in packagist
noahwsmith Jul 28, 2021
48d4bf9
patching Makefile for d9
noahwsmith Aug 1, 2021
01e5d9c
cleanup on install
noahwsmith Aug 2, 2021
60a859f
Bringing make local and make demo codebases into alignment
dannylamb Aug 3, 2021
3a7cca3
incremental improvements to install profile, including cleaning up su…
noahwsmith Oct 25, 2021
1d4f5a9
clean up output from Make commands
noahwsmith Oct 25, 2021
90c0558
freeze Context module commit hash
noahwsmith Oct 25, 2021
91e2b1c
changing the node owner for d9
noahwsmith Nov 2, 2021
0102068
adding composer_update
noahwsmith Nov 2, 2021
c4c9306
make local works with the install profile
dannylamb Nov 19, 2021
c9df948
Reverting make demo and local and renaming to -install-profile variants
dannylamb Nov 23, 2021
189f900
Updating TAG in sample.env
dannylamb Nov 23, 2021
4ac9157
Git clone main branch of sandbox for local-install-profile.
rosiel Dec 14, 2021
dc3ff8a
Update buildkit commit in TAG variable.
rosiel Dec 14, 2021
7ca3f82
Update homepage.json
Natkeeran Feb 3, 2022
d3f8728
Update homepage.json
Natkeeran Feb 4, 2022
2163ced
Update Makefile
Natkeeran Feb 7, 2022
8e0783b
Removing duplicate "confirm" function
noahwsmith Mar 23, 2022
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
70 changes: 65 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ update-settings-php:
update-config-from-environment:
-docker-compose exec -T drupal with-contenv bash -lc "for_all_sites configure_islandora_module"
-docker-compose exec -T drupal with-contenv bash -lc "for_all_sites configure_jwt_module"
-docker-compose exec -T drupal with-contenv bash -lc "for_all_sites configure_islandora_default_module"
-docker-compose exec -T drupal with-contenv bash -lc "for_all_sites configure_search_api_solr_module"
-docker-compose exec -T drupal with-contenv bash -lc "for_all_sites configure_matomo_module"
-docker-compose exec -T drupal with-contenv bash -lc "for_all_sites configure_openseadragon"
-docker-compose exec -T drupal with-contenv bash -lc "for_all_sites configure_islandora_default_module"
Expand Down Expand Up @@ -230,6 +232,10 @@ endif
docker cp $(SRC) $$(docker-compose ps -q drupal):/tmp/public-files.tgz
docker-compose exec -T drupal with-contenv bash -lc 'tar zxvf /tmp/public-files.tgz -C /var/www/drupal/web/sites/default/files && chown -R nginx:nginx /var/www/drupal/web/sites/default/files && rm /tmp/public-files.tgz'

# Composer Update
composer_update:
docker-compose exec -T drupal with-contenv bash -lc 'composer update'

# Dump fcrepo.
fcrepo-export:
ifndef DEST
Expand Down Expand Up @@ -339,10 +345,59 @@ local: generate-secrets
$(MAKE) hydrate ENVIRONMENT=local
$(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIROMENT=local

.PHONY: demo-install-profile
.SILENT: demo-instal-profile
demo-install-profile: generate-secrets
$(MAKE) download-default-certs ENVIROMENT=demo
$(MAKE) -B docker-compose.yml ENVIROMENT=demo
$(MAKE) pull ENVIROMENT=demo
mkdir -p $(CURDIR)/codebase
docker-compose up -d --remove-orphans
@echo "\n Sleeping for 10 seconds to wait for Drupal to finish initializing.\n"
sleep 10
$(MAKE) install
$(MAKE) update-settings-php ENVIROMENT=demo
$(MAKE) hydrate ENVIROMENT=demo
docker-compose exec -T drupal with-contenv bash -lc 'drush --root /var/www/drupal/web -l $${DRUPAL_DEFAULT_SITE_URL} upwd admin $${DRUPAL_DEFAULT_ACCOUNT_PASSWORD}'
docker-compose exec -T drupal with-contenv bash -lc 'drush migrate:rollback islandora_defaults_tags,islandora_tags'
$(MAKE) initial_content
$(MAKE) login

.PHONY: local-install-profile
.SILENT: local-install-profile
local-install-profile: generate-secrets
$(MAKE) download-default-certs ENVIROMENT=local
$(MAKE) -B docker-compose.yml ENVIRONMENT=local
$(MAKE) pull ENVIRONMENT=local
mkdir -p $(CURDIR)/codebase
if [ -z "$$(ls -A $(CURDIR)/codebase)" ]; then \
docker container run --rm -v $(CURDIR)/codebase:/home/root $(REPOSITORY)/nginx:$(TAG) with-contenv bash -lc 'git clone https://github.com/islandora-devops/islandora-sandbox /tmp/codebase; mv /tmp/codebase/* /home/root;'; \
fi
$(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIROMENT=local
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 ENVIROMENT=local
$(MAKE) install ENVIRONMENT=local
$(MAKE) hydrate ENVIRONMENT=local
# The - at the beginning is not a typo, it will allow this process to failing the make command.
-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`:101 /var/www/drupal'
docker-compose exec -T drupal with-contenv bash -lc 'drush migrate:rollback islandora_defaults_tags,islandora_tags'
$(MAKE) initial_content
$(MAKE) login

.PHONY: initial_content
initial_content:
curl -u admin:$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD) -H "Content-Type: application/json" -d "@demo-data/homepage.json" https://${DOMAIN}/node?_format=json
curl -u admin:$(shell cat secrets/live/DRUPAL_DEFAULT_ACCOUNT_PASSWORD) -H "Content-Type: application/json" -d "@demo-data/browse-collections.json" https://${DOMAIN}/node?_format=json

# Destroys everything beware!
.PHONY: clean
.SILENT: clean
## Destroys everything beware!
clean:
echo "**DANGER** About to rm your SERVER data subdirs, your docker volumes and your codebase/web"
$(MAKE) confirm
-docker-compose down -v
sudo rm -fr codebase certs secrets/live/*
git clean -xffd .
Expand All @@ -361,11 +416,16 @@ up:
down:
-docker-compose down --remove-orphans

GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
TARGET_MAX_CHAR_NUM=20
.PHONY: login
.SILENT: login
login:
echo "\n\n=========== LOGIN ==========="
docker-compose exec -T drupal with-contenv bash -lc "drush uli --uri=$(DOMAIN)"
echo "=============================\n"

.phony: confirm
confirm:
@echo -n "Are you sure you want to continue and drop your data? [y/N] " && read ans && [ $${ans:-N} = y ]

.PHONY: help
.SILENT: help
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Drupal container. This lets you update code using the IDE of your choice on you
changes are automatically reflected on the Drupal container. Simply place any exported Drupal site as
the `codebase` folder in `isle-dc` and you're good to go.

If you don't provide a codebase, you'll be given a vanilla Drupal 9 instance with the Islandora module
If you don't provide a codebase, you'll be given a basic setup from vanilla Drupal 9 instance with the Islandora module
installed and the bare minimum configured to run. This is useful if you want to build your repository
from scratch and avoid `islandora_defaults`.

Expand Down
28 changes: 28 additions & 0 deletions demo-data/browse-collections.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"type": [
{
"target_id": "page",
"target_type": "node_type"
}
],
"status": [
{
"value": true
}
],
"title": [
{
"value": "Browse Collections"
}
],
"path": [
{
"alias": "/browse-collections"
}
],
"field_display_title": [
{
"value": "Browse Collections"
}
]
}
8 changes: 4 additions & 4 deletions demo-data/drupal.sql

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions demo-data/homepage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": [
{
"target_id": "home_page",
"target_type": "node_type"
}
],
"status": [
{
"value": true
}
],
"title": [
{
"value": "Islandora Sandbox"
}
],
"body": [
{
"value": "<div class=\"node__links\">\r\n<ul class=\"links inline\">\r\n\t<li class=\"node-readmore\"><span class=\"node-readmore__link-wrapper\"><a aria-label=\"Browse all collections\" class=\"node-readmore__link\" href=\"/browse-collections\" hreflang=\"en\" rel=\"tag\" title=\"Browse our collections\">Browse All Collections<span class=\"visually-hidden\"> Browse All Collections</span></a></span></li>\r\n</ul>\r\n</div>\r\n\r\n<p>Welcome to the Islandora Community! (Note that all communication in Islandora is subject to our <a href=\"https://islandora.ca/codeofconduct\">code of conduct</a>).</p>\r\n\r\n<p>This demo is loaded with sample content and configurations to demonstrate features of Islandora and provide a starting point for development.&nbsp;&nbsp;Additional information is provided on the <a href=\"http://islandora.ca/\">Islandora Website</a>.&nbsp;</p>\r\n\r\n<p>The <a href=\"https://groups.google.com/g/islandora\">Islandora Google groups mailing list</a> is open to Islandora users who connect to share information. <a href=\"https://join.slack.com/t/islandora/shared_invite/zt-x7e0jj1x-C1pNzKrR7Fvs4QdQziPZ~g\">Join Islandora Slack</a> to ask questions and learn more about community events where you can learn more about Islandora. <a href=\"https://www.drupal.org/slack\">Drupal also maintains a Slack community</a> where you can ask more general questions about Drupal configuration.&nbsp;</p>\r\n\r\n<p>We welcome you to visit and edit <a href=\"https://islandora.github.io/documentation/\">Islandora documentation</a> or submit issues and code to Islandora via repositories in our <a href=\"https://github.com/Islandora\">Github organization. &nbsp;</a></p>\r\n\r\n<p>Thanks, and happy building!</p>\r\n\r\n<p> <a href=\"https://github.com/Islandora/documentation/wiki/Sandbox.Islandora.ca-online-credentials\"> login credentials </a></p>\r\n",
"format": "full_html",
"processed": "<div class=\"node__links\">\n<ul class=\"links inline\">\n\t<li class=\"node-readmore\"><span class=\"node-readmore__link-wrapper\"><a aria-label=\"Browse all collections\" class=\"node-readmore__link\" href=\"/browse-collections\" hreflang=\"en\" rel=\"tag\" title=\"Browse our collections\">Browse All Collections<span class=\"visually-hidden\"> Browse All Collections</span></a></span></li>\n</ul>\n</div>\n\n<p>Welcome to the Islandora Community! (Note that all communication in Islandora is subject to our <a href=\"https://islandora.ca/codeofconduct\">code of conduct</a>).</p>\n\n<p>This demo is loaded with sample content and configurations to demonstrate features of Islandora and provide a starting point for development.  Additional information is provided on the <a href=\"http://islandora.ca/\">Islandora Website</a>. </p>\n\n<p>The <a href=\"https://groups.google.com/g/islandora\">Islandora Google groups mailing list</a> is open to Islandora users who connect to share information. <a href=\"https://join.slack.com/t/islandora/shared_invite/zt-x7e0jj1x-C1pNzKrR7Fvs4QdQziPZ~g\">Join Islandora Slack</a> to ask questions and learn more about community events where you can learn more about Islandora. <a href=\"https://www.drupal.org/slack\">Drupal also maintains a Slack community</a> where you can ask more general questions about Drupal configuration. </p>\n\n<p>We welcome you to visit and edit <a href=\"https://islandora.github.io/documentation/\">Islandora documentation</a> or submit issues and code to Islandora via repositories in our <a href=\"https://github.com/Islandora\">Github organization.  </a></p>\n\n<p>Thanks, and happy building!</p>\n\n<p> <a href=\"https://github.com/Islandora/documentation/wiki/Sandbox.Islandora.ca-online-credentials\"> login credentials </a></p>\n",
"summary": ""
}
],
"field_display_title": [
{
"value": "Islandora Sandbox"
}
]
}
1 change: 1 addition & 0 deletions docker-compose.drupal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
DRUPAL_DEFAULT_FCREPO_PORT: 8081
DRUPAL_DEFAULT_MATOMO_URL: https://${DOMAIN}/matomo/
DRUPAL_DEFAULT_SITE_URL: http://${DOMAIN} # Make sure this is just http and not https!
DRUPAL_DEFAULT_PROFILE: ${DRUPAL_INSTALL_PROFILE}
PHP_MEMORY_LIMIT: ${PHP_MEMORY_LIMIT}
PHP_POST_MAX_SIZE: ${PHP_POST_MAX_SIZE}
PHP_UPLOAD_MAX_FILESIZE: ${PHP_UPLOAD_MAX_FILESIZE}
Expand Down
4 changes: 2 additions & 2 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ REPOSITORY=islandora

# The version of the isle-buildkit images, non isle-buildkit images have
# their versions specified explicitly in their respective docker-compose files.
TAG=1.0.0-alpha-12
TAG=aed5adc95784c1dd24589a0f77c3bbb063c92113

###############################################################################
# Exposed Containers & Ports
Expand Down Expand Up @@ -124,7 +124,7 @@ PHP_MAX_EXECUTION_TIME=30

# If you're just demoing or are starting from scratch, use this.
INSTALL_EXISTING_CONFIG=false
DRUPAL_INSTALL_PROFILE=standard
DRUPAL_INSTALL_PROFILE=islandora_install_profile_demo

# If you're installing from an existing codebase, uncomment this
#INSTALL_EXISTING_CONFIG=true
Expand Down