Skip to content
Snippets Groups Projects
Commit 49e225bd authored by Julian's avatar Julian Committed by Julian
Browse files
parents
Branches
Tags
No related merge requests found
Pipeline #18488 waiting for manual action
include:
- project: 'infra/packages/ci-utils'
ref: main
file: 'shared-ci.yml'
- local: 'gitlabci-version.yml'
variables:
PACKAGE_NAME: dokuwiki
autoupdate:
stage: autoupdate
rules:
- if: '$RUN_AUTOUPDATE == "1"'
when: always
dependencies: []
needs: []
script:
- git clone "https://${GITLAB_ACCESS_USER}:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" autoupdate-checkout
- git clone "https://github.com/splitbrain/dokuwiki" upstream-checkout
- cd autoupdate-checkout
- |
git config --global user.email "infra+packages-autoupdate@cccv.de"
git config --global user.name "autoupdater"
git -C ../upstream-checkout tag -l --sort=creatordate | sed -n -E \
-e 's/^(release_stable_([0-9]{4})-([0-9]{2})-([0-9]{2}))$/\1 0.0.\2\3\4/p' \
-e 's/^(release_stable_([0-9]{4})-([0-9]{2})-([0-9]{2})([a-z]*))$/\1 0.0.\2\3\4.\5/p' \
| tail -n 3 | while read upstream_version debian_version; do
if [ "$(git tag -l "$debian_version")" == "" ]; then
printf "variables:\n UPSTREAM_VERSION: ${upstream_version}" > gitlabci-version.yml
git commit -m "[autoupdate] Bump version to ${upstream_version}" gitlabci-version.yml
git tag "v${debian_version}"
fi
done
git tag --list
- git push
- git push --tags
.build:binary:
extends: .build
image: registry.git.cccv.de/infra/packages/docker-images/utility
script:
- mkdir dokuwiki
- wget -O - -q "https://github.com/splitbrain/dokuwiki/archive/${UPSTREAM_VERSION}.tar.gz" | tar -C dokuwiki -xz --strip-components=1
artifacts:
paths:
- dokuwiki
build:binary:bullseye:
extends: .build:binary
package:apt:bullseye:
extends: .package:apt
dependencies:
- build:binary:bullseye
needs:
- build:binary:bullseye
publish:apt:buster:
extends: .publish:apt
variables:
APTLY_DISTRO: buster
APTLY_ARCH: all
dependencies:
- package:apt:bullseye
needs:
- package:apt:bullseye
publish:apt:bullseye:
extends: .publish:apt
variables:
APTLY_DISTRO: bullseye
APTLY_ARCH: all
dependencies:
- package:apt:bullseye
needs:
- package:apt:bullseye
Source: dokuwiki
Section: web
Priority: optional
Maintainer: CCCV <it@cccv.de>
Build-Depends:
debhelper-compat (= 12),
Standards-Version: 4.5.0
Homepage: https://www.dokuwiki.org/
Vcs-Git: https://git.cccv.de/infra/packages/dokuwiki.git
Package: dokuwiki
Architecture: all
Depends:
php (<< 2:8),
Suggests:
php-gd,
Description: Simple to use and highly versatile Open Source wiki software
#! /bin/sh
set -e
# Function to cleanup a wiki data
# (see <https://www.dokuwiki.org/tips:maintenance>)
cleanup() {
# $1 ... full path to data directory of wiki
# $2 ... number of days after which old files are to be removed
# $3 ... whether or not to remove old revision files
data_path="$1"
max_days="$2"
remove_attic="$3"
cd "$data_path"
# Purge files older than $max_days days from attic and media_attic (old revisions)
if [ "$remove_attic" = "true" ]
then
find attic media_attic -type f -mtime "+$max_days" -delete
fi
# remove stale lock files (files which are 1-2 days old)
find locks -name '*.lock' -type f -mtime +1 -delete
# remove empty directories
find attic cache index locks media media_attic media_meta \
meta pages tmp -mindepth 1 -type d -empty -delete
# remove files older than $max_days days from the cache
find cache -type f -mtime "+$max_days" -delete
cd - > /dev/null
}
# Function to update the spam blacklist
# (see <https://www.dokuwiki.org/blacklist>)
update_blacklist() {
temp="$(tempfile -p doku -s blist)"
trap "rm -f -- '$temp'" EXIT
wget -q -O - 'http://meta.wikimedia.org/wiki/Spam_blacklist?action=raw' | grep -vF '<pre>' > "$temp"
mv "$temp" "/etc/dokuwiki/wordblock.local.conf"
trap - EXIT
}
# Get configuration
. /etc/default/dokuwiki
# Set variable default values
run_cleanup="${RUN_CLEANUP:-true}"
cleanup_maxdays="${CLEANUP_MAXDAYS:-180}"
remove_attic="${REMOVE_REVISIONS:-false}"
update_blacklist="${UPDATE_BLACKLIST:-false}"
# If configured, run the purge for files olders than specified (~6 months by
# default)
if [ "$run_cleanup" = "true" ]
then
cd /var/lib/dokuwiki
cleanup data "$cleanup_maxdays" "$remove_attic"
cd - > /dev/null
fi
# If configured, update the spam blacklist
if [ "$update_blacklist" = "true" ] && [ -x /usr/bin/wget ]
then
update_blacklist
fi
# Configuration file for the dokuwiki crontab job
# Comment or set to false to disable daily cleanup
# (see <https://www.dokuwiki.org/tips:maintenance>)
# (default is false)
RUN_CLEANUP="true"
# By default, cache files older than 180 days (~6 months) are removed:
# you can use this variable to change this value according to your
# needs.
# (default is 180)
#CLEANUP_MAXDAYS=180
# Set to true to remove revisions older than $CLEANUP_MAXDAYS
# (default is false)
REMOVE_REVISIONS="false"
# Set to true to enable daily spam blacklist update from Wikipedia
# (see <https://www.dokuwiki.org/blacklist>)
# (default is false)
UPDATE_BLACKLIST="false"
dokuwiki /usr/share
#!/usr/bin/make -f
%:
dh $@
override_dh_install:
dh_install
install -D -d debian/dokuwiki/etc
mv debian/dokuwiki/usr/share/dokuwiki/conf debian/dokuwiki/etc/dokuwiki
ln -s /etc/dokuwiki debian/dokuwiki/usr/share/dokuwiki/conf
install -D -d debian/dokuwiki/var/lib/dokuwiki
mv debian/dokuwiki/usr/share/dokuwiki/data debian/dokuwiki/var/lib/dokuwiki/data
ln -s /var/lib/dokuwiki/data debian/dokuwiki/usr/share/dokuwiki/data
override_dh_strip_nondeterminism:
override_dh_fixperms:
dh_fixperms
chown -R www-data:root debian/dokuwiki/var/lib/dokuwiki/data
chown -R root:www-data debian/dokuwiki/etc/dokuwiki
chmod -R g-w,o-rwx debian/dokuwiki/etc/dokuwiki
variables:
UPSTREAM_VERSION: release_stable_2022-07-31a
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment