runtime: Mount new runtime directory

This commit updates the runtime directory to include a couple of utility
scripts. These are mounted into every directory.
This commit is contained in:
Tom Wiesing 2023-09-20 10:10:48 +02:00
parent db67342709
commit 181b474c8f
No known key found for this signature in database
5 changed files with 5 additions and 83 deletions

View file

@ -1,16 +0,0 @@
#!/bin/bash
# This utility script can be used to blindly update all dependencies to their latest versions.
# It does not perform any checking whatsoever.
# update the main modules
cd /var/www/data/project || exit 1
chmod u+rw web/sites/default/
composer update
# update the db
drush -y updatedb
# update the wisski dependencies
cd /var/www/data/project/web/modules/contrib/wisski || exit 1
composer update

View file

@ -1,25 +0,0 @@
#!/bin/sh
set -e
# read user
USER=$1
if [ -z "$USER" ]; then
echo "Usage: create_admin.sh USERNAME"
exit 1
fi
# read password
echo "Enter Password for $USER:"
read -s PASS
echo "Enter the same password again:"
read -s PASS2
if [ "$PASS" != "$PASS2" ]; then
echo "Passwords not equal"
exit 1
fi;
# create the user and add the admin role
cd /var/www/data/project/
drush user:create "$USER" --password="$PASS"
drush user-add-role administrator "$USER"

View file

@ -1,20 +1,7 @@
#!/bin/bash
set -e
# make a temporary directory and cd into it
TEMPDIR=$(mktemp -d)
pushd "$TEMPDIR"
trap 'popd && rm -rf $TEMPDIR' EXIT
# curl the colorbox zip and unpack it
curl -L https://github.com/jackmoore/colorbox/archive/master.zip --output master.zip
unzip master.zip
# make the directory for libraries, and remove the old colorbox installation
chmod u+rw /var/www/data/project/web/sites/default/
mkdir -p /var/www/data/project/web/sites/default/libraries/
rm -rf /var/www/data/project/web/sites/default/libraries/colorbox
# copy over the new installation
mv colorbox-master/ /var/www/data/project/web/sites/default/libraries/colorbox
# make the target directory and install
mkdir -p /var/www/data/project/web/sites/default/libraries/colorbox
curl -L https://raw.githubusercontent.com/jackmoore/colorbox/master/LICENSE.md -o /var/www/data/project/web/sites/default/libraries/colorbox/LICENSE.md
curl -L https://raw.githubusercontent.com/jackmoore/colorbox/master/jquery.colorbox-min.js -o /var/www/data/project/web/sites/default/libraries/colorbox/jquery.colorbox-min.js

View file

@ -1,25 +0,0 @@
#!/bin/bash
set -e
# temporarily extend permissions
chmod 777 web/sites/default
chmod 666 web/sites/default/*settings.php
chmod 666 web/sites/default/*services.yml
# update the core itself
composer require 'drupal/internal/core-recommended:^9' 'drupal/internal/core-composer-scaffold:^9' 'drupal/internal/core-project-message:^9' --update-with-dependencies --no-update
composer update
composer require 'drupal/wisski'
# update requirements for wisski!
pushd web/modules/contrib/wisski || exit 1
composer update
popd || exit 1
# run the update and clear the cache!
drush updatedb --yes
# and reset everything back to normal
chmod 755 web/sites/default
chmod 644 web/sites/default/*settings.php
chmod 644 web/sites/default/*services.yml

View file

@ -37,6 +37,7 @@ services:
# volumes that are mounted
volumes:
- ${RUNTIME_DIR}:/runtime:ro
- ${DATA_PATH}/.composer:/var/www/.composer:rw
- ${DATA_PATH}/data:/var/www/data:rw
- ${DATA_PATH}/home:/var/www:rw