diff --git a/data/common/common.yaml b/data/common/common.yaml --- a/data/common/common.yaml +++ b/data/common/common.yaml @@ -1870,6 +1870,19 @@ - /1/private/[^/]+/[^/]+/[^/]+ - /1/private/deposits/ + # e2e vault +swh::deploy::vault::e2e::webapp: "%{alias('swh::deploy::webapp::url')}" + +# e2e save code now +swh::deploy::savecodenow::e2e::origins: + - name: parmap + origin: https://github.com/rdicosmo/parmap + type: git + - name: cran-scrabble + origin: https://github.com/cran/SCRABBLE + type: svn +swh::deploy::savecodenow::e2e::webapp: "%{alias('swh::deploy::webapp::url')}" + # e2e checks on deposit swh::deploy::deposit::e2e::server: "%{hiera('swh::deploy::deposit::url')}/1" swh::deploy::deposit::e2e::user: swh diff --git a/data/deployments/production/common.yaml b/data/deployments/production/common.yaml --- a/data/deployments/production/common.yaml +++ b/data/deployments/production/common.yaml @@ -21,6 +21,8 @@ swh::deploy::search::index: origin-production +swh::deploy::webapp::url: "https://archive.softwareheritage.org" + # e2e checks on vault swh::deploy::vault::e2e::storage: "http://saam.internal.softwareheritage.org:%{hiera('swh::remote_service::storage::port')}" -swh::deploy::vault::e2e::webapp: "https://archive.softwareheritage.org" + diff --git a/data/deployments/staging/common.yaml b/data/deployments/staging/common.yaml --- a/data/deployments/staging/common.yaml +++ b/data/deployments/staging/common.yaml @@ -328,8 +328,9 @@ - objects - indexed +swh::deploy::webapp::url: "https://webapp.staging.swh.network" + swh::deploy::vault::e2e::storage: "%{alias('swh::remote_service::storage0::url')}" -swh::deploy::vault::e2e::webapp: "https://webapp.staging.swh.network" swh::config::keycloak::realm_name: SoftwareHeritageStaging diff --git a/site-modules/profile/manifests/icinga2/objects/e2e_checks_savecodenow.pp b/site-modules/profile/manifests/icinga2/objects/e2e_checks_savecodenow.pp new file mode 100644 --- /dev/null +++ b/site-modules/profile/manifests/icinga2/objects/e2e_checks_savecodenow.pp @@ -0,0 +1,33 @@ +# swh save_code_now end-to-end checks on the icinga master +define profile::icinga2::objects::e2e_checks_savecodenow ( + String $server_webapp, + String $origin_name, + String $origin_url, + String $origin_type, + String $environment, +) { + include ::profile::icinga2::objects::e2e_checks_base + + $check_command_prefix = "${environment}-check-savecodenow" + $zonename = lookup('icinga2::master::zonename') + + ::icinga2::object::checkcommand {"${check_command_prefix}-cmd-${origin_name}-${origin_type}": + import => ['plugin-check-command'], + command => [ + '/usr/bin/swh', 'icinga_plugins', 'check-savecodenow', + '--swh-web-url', $server_webapp, + 'origin_url', $origin_url, '--visit-type', $origin_type + ], + target => $::profile::icinga2::objects::e2e_checks_base::check_file, + require => Package[$::profile::icinga2::objects::e2e_checks_base::packages], + } + + ::icinga2::object::service {"${check_command_prefix}-service-${origin_name}-${origin_type}": + import => ['generic-service-check-e2e'], + service_name => "${environment} Check save-code-now ${origin_name} with type ${origin_type} end-to-end", + check_command => $check_command, + target => "/etc/icinga2/zones.d/${zonename}/${::fqdn}.conf", + host_name => "${::fqdn}", + } + +} diff --git a/site-modules/profile/manifests/swh/deploy/webapp/icinga_checks.pp b/site-modules/profile/manifests/swh/deploy/webapp/icinga_checks.pp --- a/site-modules/profile/manifests/swh/deploy/webapp/icinga_checks.pp +++ b/site-modules/profile/manifests/swh/deploy/webapp/icinga_checks.pp @@ -99,4 +99,15 @@ tag => 'icinga2::exported', } } + + $origins = lookup('swh::deploy::savecodenow::e2e::origins') + each($origins) | $entry | { + @@profile::icinga2::objects::e2e_checks_savecodenow {"End-to-end SaveCodeNow Check - ${entry['name']} with type ${entry['type']} in ${environment}": + server_webapp => lookup('swh::deploy::savecodenow::e2e::webapp'), + origin_name => $entry['name'], + origin_url => $entry['origin'], + origin_type => $entry['type'], + environment => $environment, + } + } }