diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/mod-ci-github.cxx | 11 | ||||
-rw-r--r-- | mod/mod-ci-github.hxx | 4 | ||||
-rw-r--r-- | mod/mod-ci.hxx | 2 | ||||
-rw-r--r-- | mod/module.cli | 7 |
4 files changed, 13 insertions, 11 deletions
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx index ce2e4ec..6816e5a 100644 --- a/mod/mod-ci-github.cxx +++ b/mod/mod-ci-github.cxx @@ -71,7 +71,7 @@ namespace brep ci_github:: ci_github (const ci_github& r, tenant_service_map& tsm) - : handler (r), + : database_module (r), ci_start (r), options_ (r.initialized_ ? r.options_ : nullptr), tenant_service_map_ (tsm) @@ -95,9 +95,12 @@ namespace brep // Prepare for the CI requests handling, if configured. // - if (options_->ci_github_app_webhook_secret_specified ()) + if (options_->build_config_specified () && + options_->ci_github_app_webhook_secret_specified ()) { ci_start::init (make_shared<options::ci_start> (*options_)); + + database_module::init (*options_, options_->build_db_retry ()); } } @@ -108,8 +111,8 @@ namespace brep HANDLER_DIAG; - if (!options_->ci_github_app_webhook_secret_specified ()) - throw invalid_request (404, "GitHub CI request submission disabled"); + if (build_db_ == nullptr) + throw invalid_request (501, "GitHub CI submission not implemented"); // Process headers. // diff --git a/mod/mod-ci-github.hxx b/mod/mod-ci-github.hxx index 6bb01e3..946a326 100644 --- a/mod/mod-ci-github.hxx +++ b/mod/mod-ci-github.hxx @@ -7,8 +7,8 @@ #include <libbrep/types.hxx> #include <libbrep/utility.hxx> -#include <mod/module.hxx> #include <mod/module-options.hxx> +#include <mod/database-module.hxx> #include <mod/ci-common.hxx> #include <mod/tenant-service.hxx> @@ -17,7 +17,7 @@ namespace brep { - class ci_github: public handler, + class ci_github: public database_module, private ci_start, public tenant_service_build_queued, public tenant_service_build_building, diff --git a/mod/mod-ci.hxx b/mod/mod-ci.hxx index bd91e99..e4a343c 100644 --- a/mod/mod-ci.hxx +++ b/mod/mod-ci.hxx @@ -40,7 +40,7 @@ namespace brep public tenant_service_build_building, public tenant_service_build_built #ifdef BREP_CI_TENANT_SERVICE_UNLOADED - , tenant_service_build_unloaded + , public tenant_service_build_unloaded #endif #endif { diff --git a/mod/module.cli b/mod/module.cli index 7246ecf..f85861e 100644 --- a/mod/module.cli +++ b/mod/module.cli @@ -845,11 +845,10 @@ namespace brep { }; - class ci_github: repository_url, - ci_start, ci_cancel, + class ci_github: ci_start, ci_cancel, build, build_db, - handler, - openssl_options + repository_url, + handler { // GitHub CI-specific options. // |