aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github.hxx
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-03-07 09:49:06 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-06-05 09:12:46 +0200
commit3d98349a733bab29c8f0d78c62b937e72ad826fa (patch)
tree6c27a5ab88846a945eb60c2076080bb033ccd7c3 /mod/mod-ci-github.hxx
parent26d25b4faefdc61c103689840304838c749efc47 (diff)
GitHub CI: add CI support
Diffstat (limited to 'mod/mod-ci-github.hxx')
-rw-r--r--mod/mod-ci-github.hxx30
1 files changed, 26 insertions, 4 deletions
diff --git a/mod/mod-ci-github.hxx b/mod/mod-ci-github.hxx
index 9731881..3b696d7 100644
--- a/mod/mod-ci-github.hxx
+++ b/mod/mod-ci-github.hxx
@@ -10,6 +10,9 @@
#include <mod/module.hxx>
#include <mod/module-options.hxx>
+#include <mod/ci-common.hxx>
+#include <mod/tenant-service.hxx>
+
namespace butl
{
namespace json
@@ -50,6 +53,7 @@ namespace brep
string name;
string full_name;
string default_branch;
+ string clone_url;
explicit
repository (json::parser&);
@@ -109,16 +113,21 @@ namespace brep
operator<< (ostream&, const installation_access_token&);
}
- class ci_github: public handler
+ class ci_github: public handler,
+ private ci_start,
+ public tenant_service_build_queued,
+ public tenant_service_build_building,
+ public tenant_service_build_built
{
public:
- ci_github () = default;
+ explicit
+ ci_github (tenant_service_map&);
// Create a shallow copy (handling instance) if initialized and a deep
// copy (context exemplar) otherwise.
//
explicit
- ci_github (const ci_github&);
+ ci_github (const ci_github&, tenant_service_map&);
virtual bool
handle (request&, response&);
@@ -126,6 +135,17 @@ namespace brep
virtual const cli::options&
cli_options () const {return options::ci_github::description ();}
+ virtual function<optional<string> (const tenant_service&)>
+ build_queued (const tenant_service&,
+ const vector<build>&,
+ optional<build_state> initial_state) const override;
+
+ virtual function<optional<string> (const tenant_service&)>
+ build_building (const tenant_service&, const build&) const override;
+
+ virtual function<optional<string> (const tenant_service&)>
+ build_built (const tenant_service&, const build&) const override;
+
private:
virtual void
init (cli::scanner&);
@@ -133,7 +153,7 @@ namespace brep
// Handle the check_suite event `requested` and `rerequested` actions.
//
bool
- handle_check_suite_request (gh::check_suite_event) const;
+ handle_check_suite_request (gh::check_suite_event);
string
generate_jwt () const;
@@ -145,6 +165,8 @@ namespace brep
private:
shared_ptr<options::ci_github> options_;
+
+ tenant_service_map& tenant_service_map_;
};
}