forked from ungleich-public/cdist
migrate web publishing to makefile
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
parent
9b9f34eb00
commit
24bb4aa481
2 changed files with 58 additions and 12 deletions
59
Makefile
59
Makefile
|
@ -26,13 +26,16 @@ MANDIR=docs/man
|
||||||
SPEECHDIR=docs/speeches
|
SPEECHDIR=docs/speeches
|
||||||
TYPEDIR=cdist/conf/type
|
TYPEDIR=cdist/conf/type
|
||||||
|
|
||||||
|
WEBSRCDIR=docs/web
|
||||||
|
|
||||||
WEBDIR=$$HOME/www.nico.schottelius.org
|
WEBDIR=$$HOME/www.nico.schottelius.org
|
||||||
WEBBLOG=$(WEBDIR)/blog
|
WEBBLOG=$(WEBDIR)/blog
|
||||||
WEBTOPDIR=$(WEBDIR)/software
|
WEBBASE=$(WEBDIR)/software/cdist
|
||||||
WEBBASE=$(WEBTOPDIR)/cdist
|
|
||||||
WEBPAGE=$(WEBBASE).mdwn
|
WEBPAGE=$(WEBBASE).mdwn
|
||||||
|
|
||||||
CHANGELOG_VERSION=$(shell $(helper) changelog-version)
|
CHANGELOG_VERSION=$(shell $(helper) changelog-version)
|
||||||
|
CHANGELOG_FILE=docs/changelog
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Manpages
|
# Manpages
|
||||||
#
|
#
|
||||||
|
@ -87,13 +90,20 @@ man: $(MANTYPEALL) $(MANREFALL) $(MANSTATICALL)
|
||||||
# Manpages #5: release part
|
# Manpages #5: release part
|
||||||
MANWEBDIR=$(WEBBASE)/man/$(CHANGELOG_VERSION)
|
MANWEBDIR=$(WEBBASE)/man/$(CHANGELOG_VERSION)
|
||||||
|
|
||||||
release-man: man
|
man-git: man
|
||||||
rm -rf "${MANWEBDIR}"
|
rm -rf "${MANWEBDIR}"
|
||||||
mkdir -p "${MANWEBDIR}/man1" "${MANWEBDIR}/man7"
|
mkdir -p "${MANWEBDIR}/man1" "${MANWEBDIR}/man7"
|
||||||
cp ${MAN1DSTDIR}/*.html ${MAN1DSTDIR}/*.css ${MANWEBDIR}/man1
|
cp ${MAN1DSTDIR}/*.html ${MAN1DSTDIR}/*.css ${MANWEBDIR}/man1
|
||||||
cp ${MAN7DSTDIR}/*.html ${MAN7DSTDIR}/*.css ${MANWEBDIR}/man7
|
cp ${MAN7DSTDIR}/*.html ${MAN7DSTDIR}/*.css ${MANWEBDIR}/man7
|
||||||
cd ${MANWEBDIR} && git add . && git commit -m "cdist manpages update: $(CHANGELOG_VERSION)"
|
cd ${MANWEBDIR} && git add . && git commit -m "cdist manpages update: $(CHANGELOG_VERSION)"
|
||||||
|
|
||||||
|
man-fix-link:
|
||||||
|
# Fix ikiwiki, which does not like symlinks for pseudo security
|
||||||
|
ssh tee.schottelius.org \
|
||||||
|
"cd /home/services/www/nico/www.nico.schottelius.org/www/software/cdist/man && rm -f latest && ln -sf "$(CHANGELOG_VERSION)" latest"
|
||||||
|
|
||||||
|
man-release: man web-release
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Speeches
|
# Speeches
|
||||||
#
|
#
|
||||||
|
@ -109,18 +119,42 @@ $(SPEECHDIR)/%.pdf: $(SPEECHDIR)/%.tex
|
||||||
|
|
||||||
speeches: $(SPEECHES)
|
speeches: $(SPEECHES)
|
||||||
|
|
||||||
release-speeches: speeches
|
speeches-release: speeches
|
||||||
rm -rf "${SPEECHESWEBDIR}"
|
rm -rf "${SPEECHESWEBDIR}"
|
||||||
mkdir -p "${SPEECHESWEBDIR}"
|
mkdir -p "${SPEECHESWEBDIR}"
|
||||||
cp ${SPEECHES} "${SPEECHESWEBDIR}"
|
cp ${SPEECHES} "${SPEECHESWEBDIR}"
|
||||||
cd ${SPEECHESWEBDIR} && git add . && git commit -m "cdist speeches updated"
|
cd ${SPEECHESWEBDIR} && git add . && git commit -m "cdist speeches updated"
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
CHECKS=check-version check-date
|
# Website
|
||||||
|
#
|
||||||
|
|
||||||
|
BLOGFILE=$(WEBBLOG)/cdist-$(CHANGELOG_VERSION)-released.mdwn
|
||||||
|
|
||||||
|
$(BLOGFILE): $(CHANGELOG_FILE)
|
||||||
|
$(helper) blog $(CHANGELOG_VERSION) $(BLOGFILE)
|
||||||
|
|
||||||
|
web-blog: $(BLOGFILE)
|
||||||
|
|
||||||
|
web-doc:
|
||||||
|
# Go to top level, because of cdist.mdwn
|
||||||
|
rsync -av "$(WEBSRCDIR)/" "${WEBBASE}/.."
|
||||||
|
cd "${WEBBASE}/.." && git add cdist* && git commit -m "cdist doc update" cdist* || true
|
||||||
|
|
||||||
|
web-pub: web
|
||||||
|
cd "${WEBDIR}" && make pub
|
||||||
|
|
||||||
|
web-release: web-blog web-doc
|
||||||
|
cd "${WEBDIR}" && make pub
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Release && release check
|
||||||
|
#
|
||||||
|
CHECKS=check-version check-date check-unittest
|
||||||
|
|
||||||
DIST=dist-tag dist-branch-merge
|
DIST=dist-tag dist-branch-merge
|
||||||
|
|
||||||
RELEASE=release-web release-man release-pypi release-archlinux-makepkg
|
RELEASE=web-release release-man release-pypi release-archlinux-makepkg
|
||||||
RELEASE+=release-blog release-ml
|
RELEASE+=release-blog release-ml
|
||||||
RELEASE+=release-freecode release-archlinux-aur-upload
|
RELEASE+=release-freecode release-archlinux-aur-upload
|
||||||
|
|
||||||
|
@ -137,6 +171,17 @@ $(versionfile):
|
||||||
$(DIST): dist-check
|
$(DIST): dist-check
|
||||||
$(RELEASE): $(DIST) $(CHECKS)
|
$(RELEASE): $(DIST) $(CHECKS)
|
||||||
|
|
||||||
|
# Code that is better handled in a shell script
|
||||||
|
check-%:
|
||||||
|
$(helper) $@
|
||||||
|
|
||||||
|
# Pub is Nico's "push to all git remotes" thing
|
||||||
|
pub:
|
||||||
|
for remote in "" github sf; do \
|
||||||
|
echo "Pushing to $$remote" \
|
||||||
|
git push --mirror $$remote \
|
||||||
|
done
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# dist code
|
# dist code
|
||||||
#
|
#
|
||||||
|
@ -166,8 +211,6 @@ release-blog: blog
|
||||||
release-ml: release-blog
|
release-ml: release-blog
|
||||||
release-pub: man
|
release-pub: man
|
||||||
|
|
||||||
release-web: web-doc
|
|
||||||
|
|
||||||
PKGBUILD: PKGBUILD.in
|
PKGBUILD: PKGBUILD.in
|
||||||
./PKGBUILD.in
|
./PKGBUILD.in
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,9 @@ case "$option" in
|
||||||
blog)
|
blog)
|
||||||
version=$1; shift
|
version=$1; shift
|
||||||
blogfile=$1; shift
|
blogfile=$1; shift
|
||||||
|
dir=${blogfile%/*}
|
||||||
|
file=${blogfile##*/}
|
||||||
|
|
||||||
|
|
||||||
cat << eof > "$blogfile"
|
cat << eof > "$blogfile"
|
||||||
[[!meta title="Cdist $version released"]]
|
[[!meta title="Cdist $version released"]]
|
||||||
|
@ -97,17 +100,17 @@ Here's a short overview about the changes found in version ${version}:
|
||||||
|
|
||||||
eof
|
eof
|
||||||
|
|
||||||
$0 changelog-changes >> "$blogfile"
|
$0 changelog-changes "$version" >> "$blogfile"
|
||||||
|
|
||||||
cat << eof >> "$blogfile"
|
cat << eof >> "$blogfile"
|
||||||
For more information visit the [[cdist homepage|software/cdist]].
|
For more information visit the [[cdist homepage|software/cdist]].
|
||||||
|
|
||||||
[[!tag cdist config unix]]
|
[[!tag cdist config unix]]
|
||||||
eof
|
eof
|
||||||
cd "$WEBBLOG"
|
cd "$dir"
|
||||||
git add "$file"
|
git add "$file"
|
||||||
git commit -m "New cdist version (blogentry): $version" "$blogfile"
|
# Allow git commit to fail if there are no changes
|
||||||
git push
|
git commit -m "cdist blog update: $version" "$blogfile" || true
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue