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

Add persistent-directories param to skin/extension YAML files #423

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
APACHE_LOG_DIR=/var/log/apache2

# System setup
RUN set x; \

Check failure on line 18 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`

Check failure on line 18 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL3015 info: Avoid additional packages by specifying `--no-install-recommends`

Check failure on line 18 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL3047 info: Avoid use of wget without progress bar. Use `wget --progress=dot:giga <url>`.Or consider using `-q` or `-nv` (shorthands for `--quiet` or `--no-verbose`).
apt-get clean \
&& apt-get update \
&& apt-get install -y aptitude \
Expand Down Expand Up @@ -90,7 +90,7 @@
&& mkdir -p $MW_VOLUME

# Composer
RUN set -x; \

Check failure on line 93 in Dockerfile

View workflow job for this annotation

GitHub Actions / test

DL4001 warning: Either use Wget or Curl but not both
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer self-update 2.1.3

Expand Down Expand Up @@ -227,6 +227,7 @@
chmod -v +x /*.sh \
&& chmod -v +x /maintenance-scripts/*.sh \
# Sitemap directory
&& mkdir -p $MW_ORIGIN_FILES/sitemap \
&& ln -s $MW_VOLUME/sitemap $MW_HOME/sitemap \
# Comment out ErrorLog and CustomLog parameters, we use rotatelogs in mediawiki.conf for the log files
&& sed -i 's/^\(\s*ErrorLog .*\)/# \1/g' /etc/apache2/apache2.conf \
Expand Down
2 changes: 2 additions & 0 deletions _sources/canasta/getMediawikiSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public function execute() {
SemanticMediaWiki::onExtensionFunction();
$smwId = SMW\Site::id();
$return = $GLOBALS['smw.json'][$smwId]['upgrade_key'] ?? '';
} else {
$return = 'SMW_not_installed';
}
} elseif ( $this->hasOption( 'SWMIncompleteSetupTasks' ) ) {
$extThings = self::getExtensionsThings();
Expand Down
4 changes: 4 additions & 0 deletions _sources/configs/extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ extensions:
- SemanticMediaWiki:
repository: https://github.com/SemanticMediaWiki/SemanticMediaWiki
commit: b5e2afe11991fe21a335cb90426de24b85bc9fe7 # v. 4.1.3
persistent-directories:
- config
- SemanticResultFormats:
repository: https://github.com/SemanticMediaWiki/SemanticResultFormats
commit: d5196722a56f9b65475be68d1e97063d7b975cb9 # v. 4.0.2
Expand Down Expand Up @@ -289,6 +291,8 @@ extensions:
commit: d3d63faa08b89c429a7803b283e9bb685a51b9a0
- Widgets:
commit: 197d429f971b2aebbce29b7a91a194e1f8181e64
persistent-directories:
- compiled_templates
- WikiSEO:
commit: 610cffa3345333b53d4dda7b55b2012fbfcee9de
- WSOAuth:
Expand Down
3 changes: 3 additions & 0 deletions _sources/scripts/create-symlinks.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

rm -f "$MW_HOME"/extensions/*
rm -f "$MW_HOME"/skins/*

echo "Symlinking bundled extensions..."
for bundled_extension_path in $(find $MW_HOME/canasta-extensions/ -maxdepth 1 -mindepth 1 -type d)
do
Expand Down
11 changes: 11 additions & 0 deletions _sources/scripts/extensions-skins.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

$MW_HOME = getenv("MW_HOME");
$MW_VERSION = getenv("MW_VERSION");
$MW_VOLUME = getenv("MW_VOLUME");
$MW_ORIGIN_FILES = getenv("MW_ORIGIN_FILES");
$type = $argv[1];
$path = $argv[2];

Expand All @@ -19,6 +21,15 @@
$commit = $data['commit'] ?? null;
$branch = $data['branch'] ?? null;
$patches = $data['patches'] ?? null;
$persistentDirectories = $data['persistent-directories'] ?? null;

if ($persistentDirectories !== null) {
exec("mkdir -p $MW_ORIGIN_FILES/canasta-$type/$name");
foreach ($directory as $persistentDirectories) {
exec("mv $MW_HOME/canasta-$type/$name/$directory $MW_ORIGIN_FILES/canasta-$type/$name/");
exec("ln -s $MW_VOLUME/canasta-$type/$name/$directory $MW_HOME/canasta-$type/$name/$directory");
}
}

$gitCloneCmd = "git clone ";

Expand Down
4 changes: 2 additions & 2 deletions _sources/scripts/maintenance-scripts/monitor-directories.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ inotifywait -m -e create,moved_to,delete,moved_from --format '%e:%f' -- "$usersk
while IFS=: read -r event file; do
case $event in
CREATE,ISDIR|MOVED_TO,ISDIR)
ln -rsft skins -- "$userskins"/"$file" ;;
ln -rsft "$skins" -- "$userskins"/"$file" ;;
DELETE,ISDIR|MOVED_FROM,ISDIR)
echo "event: ${event} file: ${file}";
ln -rsft skins -- "$canskins"/"$file" || rm -- "$file";
ln -rsft "$skins" -- "$canskins"/"$file" || rm -- "$file";
esac
done
Loading