#buildCompleted
Event
The buildCompleted
Event is fired when a Build completes. The Event contains a result
key which is either 'succeeded'
, 'failed'
, or 'canceled'
. This Event does not expect any response body.
import cms from 'static-cms-addon'
let app = cms.createServer()
app.on('buildCompleted', e => {
if (e.result == 'succeeded') {
// tell some external service to index the new site
}
e.send()
})
app.listenToEvents('/api/events')
app.listen(cms.getPort())