University of Michigan Library Blogs site is a drupal application (https://www.drupal.org/).
-
If you haven't already, you will need to install Docker or Docker Desktop (https://docs.docker.com/get-docker/) and Git (https://github.com/git-guides/install-git)
-
To start working on it in docker please contact [email protected] to obtain appropriate credentials for files and database.
-
IMPORTANT! If you run Docker with a new non-Intel Apple chip, you may have issues! If you do and find a solution please post it in issues.
- Clone
blogs.lib
.
git clone https://github.com/mlibrary/blogs.lib.git && cd blogs.lib
- Set up s3 credentials.
Add credentials for s3 (NOTE: credentials must be supplied.)
tar -zxf aws-stub && vi .aws/credentials
Add the key and secret supplied and save the credentials file
- Get the data from an s3 bucket (NOTE: credentials must be supplied from prior step.)
sudo docker run --rm -it -v $(pwd)/.aws:/root/.aws -v $(pwd):/aws amazon/aws-cli s3 cp s3://blogs-lib-umich-edu/ ./ --recursive
- Set up files and database settings.
tar -zxf files.tar.gz -C sites/default && cp sites/default/docker.settings.php sites/default/settings.php
- Start the server.
sudo docker-compose build && sudo docker-compose up -d
- Set files permissions to apache
sudo docker exec -it blogslib-drupal-1 chown -R www-data sites/default/files
- Import the openid config for development.
tar -zxf config-yml.tar.gz
sudo docker exec -it blogslib-drupal-1 drush config-import --partial --source=config-yml/
- Open the site. (NOTE: Takes a minute for mariadb to load up.)
Site should load at http://localhost:25647
- Pull the latest from git.
git pull
- **Get fresh data from the s3 bucket (NOTE: credentials must be supplied from initial build.)
sudo docker run --rm -it -v $(pwd)/.aws:/root/.aws -v $(pwd):/aws amazon/aws-cli s3 cp s3://blogs-lib-umich-edu/ ./ --recursive
- Set up refreshed files. (NOTE: you may want to mv sites/default/files sites/default/files- or rm -r sites/default/files)
sudo tar -zxvf files.tar.gz -C sites/default && sudo chown -R www-data sites/default/files
- Rebuild docker with latest stuff.
Remove all associated volumes, images and containers. Download the latest. Note that you may have names other than blogslib-drupal-1 and blogslib-database-1.
sudo docker rm -f blogslib-database-1 && sudo docker rm -f blogslib-drupal-1 && sudo docker volume rm -f blogslib_database && sudo docker image rm -f mariadb:latest && sudo docker image rm -f blogslib_drupal:latest && sudo docker-compose build --no-cache && sudo docker-compose up -d --force-recreate
- Import the openid config for development. (NOTE: you need to wait for database to start up. Should go green.)
tar -zxf config-yml.tar.gz
sudo docker exec -it blogslib-drupal-1 drush config-import --partial --source=config-yml/
Update composer
sudo docker exec -it blogslib-drupal-1 composer update
Run drush commands (status in example, but can be anything)
sudo docker exec -it blogslib-drupal-1 drush status