Re-introduce the possibility of a full-build
continuous-integration/drone/push Build is passing Details

Fixes #852
pull/1323/head
Reinhard Müller 2020-04-23 17:14:47 +02:00
parent ffb1c53bd0
commit df545e72a8
8 changed files with 25 additions and 72 deletions

22
.gitignore vendored
View File

@ -1,13 +1,5 @@
d_year.en.xml
d_month.en.xml
d_day.en.xml
tools/.texts-??.xml
.fundraising.??.xml
.default.xsl
.localmenu.*.xml
.*.xmllist
tags/tagged-*.en.xhtml
tags/.tags.??.xml
look/fsfe.min.css
look/valentine.min.css
events/????/index.??.xhtml
events/????/index.sources
events/????/index.xsl
@ -15,6 +7,10 @@ news/????/index.??.xhtml
news/????/index.sources
news/????/index.xsl
news/*/.*.??.xml
about/printable/archive/printable.en.xml
look/fsfe.min.css
look/valentine.min.css
tools/.texts-??.xml
.fundraising.??.xml
.default.xsl
.localmenu.*.xml
.*.xmllist
tags/tagged-*.en.xhtml
tags/.tags.??.xml

View File

@ -56,22 +56,6 @@ $(SUBDIRS): .FORCE
echo "* Preparing subdirectory $@"
$(MAKE) --silent --directory=$@
# -----------------------------------------------------------------------------
# Timestamp files for regular jobs and XML inclusion in various places
# -----------------------------------------------------------------------------
YEAR := <?xml version="1.0" encoding="utf-8"?><dateset><date year="$(shell date +%Y)" /></dateset>
MONTH := <?xml version="1.0" encoding="utf-8"?><dateset><date month="$(shell date +%Y-%m)" /></dateset>
DAY := <?xml version="1.0" encoding="utf-8"?><dateset><date day="$(shell date +%Y-%m-%d)" /></dateset>
all: d_year.en.xml d_month.en.xml d_day.en.xml
d_day.en.xml: $(if $(findstring $(DAY),$(shell cat d_day.en.xml)),,.FORCE)
printf %s\\n '$(DAY)' >$@
d_month.en.xml: $(if $(findstring $(MONTH),$(shell cat d_month.en.xml)),,.FORCE)
printf %s\\n '$(MONTH)' >$@
d_year.en.xml: $(if $(findstring $(YEAR),$(shell cat d_year.en.xml)),,.FORCE)
printf %s\\n '$(YEAR)' >$@
# -----------------------------------------------------------------------------
# Create XML symlinks
# -----------------------------------------------------------------------------

View File

@ -24,18 +24,6 @@ build_main.sh [options] tree_maker [input_dir] "destination_dir"
Note: if destination_dir is set via previous options, and only one parameter
is given, then this parameter will be interpreted as input_dir
build_main.sh [options] wakeup [date]
News items that are in the future at the time of their commit are not
considered for the content of dependent files (e.g. news.html, index.html).
This function performs a `touch` on all files which are to be released at
the presented date, thus forcing a subsequent buildrun to rebuild dependent
files even though the input files may not have changed their content.
The same goes for events which start today (have to be moved from future to
current events) or ended yesterday (have to be moved from current to past
events).
The date option defaults to the present date, if given it must adhere to
the form YYYY-MM-DD.
OPTIONS
-------

View File

@ -51,10 +51,6 @@ if [ -z "$inc_arguments" ]; then
[ "$#" -gt 0 ] && shift 1 && workfile="$1"
[ "$#" -gt 0 ] && shift 1 && processor="$1"
;;
wakeup)
command="$1$command"
[ "$#" -gt 0 ] && shift 1 && today="$1"
;;
*)
print_error "Unknown option: $1"
exit 1
@ -65,7 +61,6 @@ if [ -z "$inc_arguments" ]; then
tree="${tree:-$basedir}"
stagedir="${stagedir:-$target}"
today="${today:-$(date +%F)}"
readonly tree="${tree:+$(realpath "$tree")}"
readonly stagedir="${stagedir:+$(realpath "$stagedir")}"
readonly basedir="${basedir:+$(realpath "$basedir")}"
@ -83,7 +78,6 @@ if [ -z "$inc_arguments" ]; then
process_file) [ -z "$workfile" ] && die "Need at least input file" ;;
build_xmlstream) [ -z "$workfile" ] && die "Missing xhtml file name" ;;
tree_maker) [ -z "$target" ] && die "Missing target location" ;;
wakeup) true;;
*help*) print_help; exit 0 ;;
*) die "Urecognised command or no command given" ;;
esac

View File

@ -79,5 +79,4 @@ case "$command" in
process_file) process_file "$workfile" "$processor" ;;
build_xmlstream) build_xmlstream "$(get_shortname "$workfile")" "$(get_language "$workfile")" ;;
tree_maker) tree_maker "$tree" "$target" ;;
wakeup) wakeup "$today" ;;
esac

View File

@ -6,7 +6,8 @@ inc_buildrun=true
[ -z "$inc_logging" ] && . "$basedir/build/logging.sh"
[ -z "$inc_misc" ] && . "$basedir/build/misc.sh"
build_into(){
# The actual build
buildrun(){
set -o pipefail
printf %s "$start_time" > "$(logname start_time)"
@ -56,6 +57,7 @@ build_into(){
fi
}
# Update git and then do an actual build
git_build_into(){
forcelog GITchanges; GITchanges="$(logname GITchanges)"
forcelog GITerrors; GITerrors="$(logname GITerrors)"
@ -75,5 +77,17 @@ git_build_into(){
fi
logstatus GITlatest < "$GITchanges"
build_into
buildrun
}
# Clean up everything and then do an actual (full) build
build_into(){
# Clean up source directory.
git -C "${basedir}" clean -dxf
# Remove old stage directory.
rm -rf "${stagedir}"
buildrun
}

View File

@ -22,24 +22,3 @@ dir_maker(){
match "$oldpath" "^$curpath" || mkdir -p "$curpath" "$srcdir"
done
}
wakeup(){
# Performs a `touch` on all files which are to be released at the
# presented date.
today="$1"
# All news with today's date
find "${basedir}/news" -name '*.xml' \
| xargs egrep -l "<[^>]+ date=[\"']${today}[\"'][^>]*>" \
| xargs touch -c 2>&- || true
# All events which start today
find "${basedir}/events" -name '*.xml' \
| xargs egrep -l "<[^>]+ start=[\"']${today}[\"'][^>]*>" \
| xargs touch -c 2>&- || true
# All events which ended yesterday
find "${basedir}/events" -name '*.xml' \
| xargs egrep -l "<[^>]+ end=[\"']$(date -d "${today} -1 day" +%F)[\"'][^>]*>" \
| xargs touch -c 2>&- || true
}

View File

@ -1,4 +1,3 @@
donate/donors/donors-$thisyear:[]
donate/donors/donors-$lastyear:[]
donate/.localmenu:[]
d_day:[]