Skip to content
Snippets Groups Projects
Verified Commit 3e3196e5 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Add BUILD_ACM to pipeline

parent 2e5b4785
No related branches found
No related tags found
2 merge requests!42Release 0.2.0,!40F dot in username
Pipeline #24973 failed
...@@ -84,7 +84,8 @@ test: ...@@ -84,7 +84,8 @@ test:
script: script:
- mkdir build - mkdir build
- cd build - cd build
- conan install .. -s "compiler.libcxx=libstdc++11" - VERSION="$(conan inspect --raw version ..)"
- conan install -s "compiler.libcxx=libstdc++11" -o build_acm=True .. "caosdb/$VERSION"
- cmake -DCMAKE_BUILD_TYPE=Debug .. - cmake -DCMAKE_BUILD_TYPE=Debug ..
- cmake --build . -j - cmake --build . -j
- cmake --build . -j --target unit_test_coverage - cmake --build . -j --target unit_test_coverage
......
...@@ -46,7 +46,9 @@ using boost::program_options::positional_options_description; ...@@ -46,7 +46,9 @@ using boost::program_options::positional_options_description;
using boost::program_options::store; using boost::program_options::store;
using boost::program_options::value; using boost::program_options::value;
using boost::program_options::variables_map; using boost::program_options::variables_map;
#ifdef BUILD_ACM
using caosdb::acm::Role; using caosdb::acm::Role;
#endif
auto print_version(bool print) -> void { auto print_version(bool print) -> void {
if (print) { if (print) {
...@@ -98,6 +100,7 @@ auto execute_query(std::string query) -> void { ...@@ -98,6 +100,7 @@ auto execute_query(std::string query) -> void {
} }
} }
#ifdef BUILD_ACM
auto list_roles() -> void { auto list_roles() -> void {
std::cout << "Known roles:" << std::endl; std::cout << "Known roles:" << std::endl;
const auto &connection = caosdb::connection::ConnectionManager::GetDefaultConnection(); const auto &connection = caosdb::connection::ConnectionManager::GetDefaultConnection();
...@@ -125,6 +128,7 @@ auto delete_role(std::string name) { ...@@ -125,6 +128,7 @@ auto delete_role(std::string name) {
connection->DeleteSingleRole(name); connection->DeleteSingleRole(name);
std::cout << "OK" << std::endl; std::cout << "OK" << std::endl;
} }
#endif
auto main(int argc, const char *argv[]) -> int { auto main(int argc, const char *argv[]) -> int {
try { try {
...@@ -137,10 +141,14 @@ auto main(int argc, const char *argv[]) -> int { ...@@ -137,10 +141,14 @@ auto main(int argc, const char *argv[]) -> int {
"retrieve", value<std::string>()->notifier(retrieve_entity_by_id), "retrieve", value<std::string>()->notifier(retrieve_entity_by_id),
"Retrieve an entity by id and print its JSON representation.")( "Retrieve an entity by id and print its JSON representation.")(
"execute-query", value<std::string>()->notifier(execute_query), "execute-query", value<std::string>()->notifier(execute_query),
"Execute a query and print the results")("list-roles", "List all known roles")( "Execute a query and print the results")
#ifdef BUILD_ACM
("list-roles", "List all known roles")(
"retrieve-role", value<std::string>()->notifier(retrieve_role), "Retrieve a role by name")( "retrieve-role", value<std::string>()->notifier(retrieve_role), "Retrieve a role by name")(
"create-role", value<std::string>()->notifier(create_role), "Create a new role")( "create-role", value<std::string>()->notifier(create_role), "Create a new role")(
"delete-role", value<std::string>()->notifier(delete_role), "Create a new role"); "delete-role", value<std::string>()->notifier(delete_role), "Create a new role")
#endif
;
parser.options(desc); parser.options(desc);
...@@ -158,6 +166,7 @@ auto main(int argc, const char *argv[]) -> int { ...@@ -158,6 +166,7 @@ auto main(int argc, const char *argv[]) -> int {
} else if (vm["version"].as<bool>()) { } else if (vm["version"].as<bool>()) {
} else if (vm.count("test-connection")) { } else if (vm.count("test-connection")) {
test_connection(); test_connection();
#ifdef BUILD_ACM
} else if (vm.count("list-roles")) { } else if (vm.count("list-roles")) {
list_roles(); list_roles();
} else if (vm.count("retrieve-role")) { } else if (vm.count("retrieve-role")) {
...@@ -165,6 +174,7 @@ auto main(int argc, const char *argv[]) -> int { ...@@ -165,6 +174,7 @@ auto main(int argc, const char *argv[]) -> int {
} else if (vm.count("create-role")) { } else if (vm.count("create-role")) {
} else if (vm.count("delete-role")) { } else if (vm.count("delete-role")) {
} else if (vm.count("execute-query")) { } else if (vm.count("execute-query")) {
#endif
} else { } else {
print_version(true); print_version(true);
test_connection(); test_connection();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment