Next: , Previous: , Up: Targets Specified on the Command Line   [Contents][Index]

2.3.4 The triggers Target

This is a special target intended to be run by the automatic build after the main build and after cvs|svn|bzr commit.

The triggers target currently executes the files named article.lang.html.hook in the server/gnun directory—these files are created during the main build and each of them contains the command to update the timestamp of the prerequisite based on the timestamp of the target that must be rebuilt. Finally, it deletes all those *.hook files.

This is the rule that takes care of actually sending the announcements if ANNOUNCE=yes. Since it is a completely valid scenario to have a new translation which is initially invalid HTML, the canned command sequence for announcements is recorded in *.hook-ann files, and they are treated by triggers in a different way. A newly added .lang.po file may be invalid, in which case the HTML file is not added, and it is not appropriate to announce it as a new translation as it is completely useless for the general public. The triggers rule detects this case, and postpones the announcement to the next build attempt, when the generated HTML translation is supposed to be human-readable.

To summarize, for effective operation GNUN should be invoked automatically as make; cvs|svn|bzr commit -m …; make triggers. To illustrate this, here is a concrete example showing the official job once running at fencepost.gnu.org6:

25 4,12,20 * * *  cd $HOME/projects/www; cvs -q update &>/dev/null; \
                    make -j1 -C server/gnun VCS=yes VALIDATE=yes; \
                    NOTIFY=yes VERBOSE=yes GRACE=5000; ANNOUNCE=yes; \
                    cvs commit -m \
                    "Automatic update by GNUnited Nations."; \
                    make -C server/gnun triggers

The above example is for CVS; if the underlying repository is Subversion, they need to be amended accordingly. If it is GNU Bzr, remember to add a bzr push after commit (in the usual scenario), otherwise changes will be committed only locally. Since a distributed Version Control System can be used in multiple (sometimes radically different) ways, this step cannot be anticipated and therefore cannot be automated. Adding the push command in the makefile rules would not work if a so called “bound branch” is used, for instance.

In the future, this target may be extended further to do other useful things that should be “triggered” after the main build.



These days we run a more complicated script instead of this cron job in order to address some exceptional situations like concurrent builds.

Next: The validate-all Target, Previous: The report Target, Up: Targets Specified on the Command Line   [Contents][Index]