diff --git a/hieradata_aws/class/production/jenkins.yaml b/hieradata_aws/class/production/jenkins.yaml index 64bbd2f0e3..ef14177c3b 100644 --- a/hieradata_aws/class/production/jenkins.yaml +++ b/hieradata_aws/class/production/jenkins.yaml @@ -63,7 +63,6 @@ govuk_jenkins::job_builder::jobs: - govuk_jenkins::jobs::athena_fastly_logs_check - govuk_jenkins::jobs::deploy_app - govuk_jenkins::jobs::deploy_puppet - - govuk_jenkins::jobs::email_alert_check - govuk_jenkins::jobs::passive_checks govuk_jenkins::jobs::deploy_puppet::enable_slack_notifications: true diff --git a/modules/govuk_jenkins/manifests/jobs/email_alert_check.pp b/modules/govuk_jenkins/manifests/jobs/email_alert_check.pp deleted file mode 100644 index 845e0a7bb6..0000000000 --- a/modules/govuk_jenkins/manifests/jobs/email_alert_check.pp +++ /dev/null @@ -1,64 +0,0 @@ -# == Class: govuk_jenkins::jobs::email_alert_check -# -# Create a file on disk that can be parsed by jenkins-job-builder -# -# === Parameters -# -# [*google_oauth_credentials*] -# JSON blob with oauth credentials with access to the googleapi@ email account. -# -# [*google_client_id*] -# Google app client ID. -# -# [*google_client_secret*] -# Google app client secret. -# -# [*sentry_dsn*] -# The URL used by Sentry to report exceptions -# -class govuk_jenkins::jobs::email_alert_check ( - $google_oauth_credentials = undef, - $google_client_id = undef, - $google_client_secret = undef, - $sentry_dsn = undef, -) { - - $deploy_jenkins_domain = hiera('deploy_jenkins_domain') - $medical_safety_check_name = 'medical_safety_email_alert_check' - $medical_safety_service_description = 'Medical Safety Email alert check' - $medical_safety_job_url = "https://${deploy_jenkins_domain}/job/medical-safety-email-alert-check/" - $travel_advice_check_name = 'travel_advice_email_alert_check' - $travel_advice_service_description = 'Travel Advice email alert check' - $travel_advice_job_url = "https://${deploy_jenkins_domain}/job/travel-advice-email-alert-check/" - - file { - '/etc/jenkins_jobs/jobs/medical_safety_email_alert_check.yaml': - ensure => present, - content => template('govuk_jenkins/jobs/medical_safety_email_alert_check.yaml.erb'), - notify => Exec['jenkins_jobs_update']; - '/etc/jenkins_jobs/jobs/travel_advice_email_alert_check.yaml': - ensure => present, - content => template('govuk_jenkins/jobs/travel_advice_email_alert_check.yaml.erb'), - notify => Exec['jenkins_jobs_update']; - } - - @@icinga::passive_check { "${medical_safety_check_name}_${::hostname}": - service_description => $medical_safety_service_description, - host_name => $::fqdn, - freshness_threshold => 5400, # 90 minutes - freshness_alert_level => 'critical', - freshness_alert_message => 'Jenkins job has stopped running or is unstable', - action_url => $medical_safety_job_url, - notes_url => monitoring_docs_url(email-alerts); - "${travel_advice_check_name}_${::hostname}": - service_template => 'govuk_urgent_priority', - service_description => $travel_advice_service_description, - host_name => $::fqdn, - freshness_threshold => 5400, # 90 minutes - freshness_alert_level => 'critical', - freshness_alert_message => 'Jenkins job has stopped running or is unstable', - action_url => $travel_advice_job_url, - notes_url => monitoring_docs_url(email-alerts); - - } -} diff --git a/modules/govuk_jenkins/templates/jobs/medical_safety_email_alert_check.yaml.erb b/modules/govuk_jenkins/templates/jobs/medical_safety_email_alert_check.yaml.erb deleted file mode 100644 index e8116d2095..0000000000 --- a/modules/govuk_jenkins/templates/jobs/medical_safety_email_alert_check.yaml.erb +++ /dev/null @@ -1,63 +0,0 @@ -- job: - name: medical-safety-email-alert-check - display-name: MedicalSafetyEmailAlertCheck - project-type: freestyle - description: "This job checks if medical safety email alerts have been emailed" - logrotate: - numToKeep: 100 - triggers: - - timed: '21,51 * * * *' # every hour on the 21st and 51st minute - properties: - - build-discarder: - days-to-keep: 30 - artifact-num-to-keep: 5 - builders: - - shell: - command: | - ( - git clone https://github.com/alphagov/email-alert-monitoring tmp && - rm -rf email-alert-monitoring && - mv tmp email-alert-monitoring - ) || echo "Cloning failed. Re-using directory from previous run." - - cd email-alert-monitoring - bundle config set --local path "${HOME}/bundles/${JOB_NAME}" - bundle config set --local deployment true - bundle install - bundle exec rake run_medical_alerts - unstable-return: 1 - publishers: - - text-finder: - regexp: "Cloning failed" - also-check-console-output: true - unstable-if-found: true - - trigger-parameterized-builds: - - project: Success_Passive_Check - condition: 'SUCCESS' - predefined-parameters: | - NSCA_CHECK_DESCRIPTION=<%= @medical_safety_service_description %> - NSCA_OUTPUT=<%= @medical_safety_service_description %> success - - project: Failure_Passive_Check - condition: 'FAILED' - predefined-parameters: | - NSCA_CHECK_DESCRIPTION=<%= @medical_safety_service_description %> - NSCA_OUTPUT=<%= @medical_safety_service_description %> failed - wrappers: - - ansicolor: - colormap: xterm - - inject-passwords: - global: false - mask-password-params: true - job-passwords: - - name: GOOGLE_OAUTH_CREDENTIALS - password: - '<%= @google_oauth_credentials %>' - - name: GOOGLE_CLIENT_ID - password: - '<%= @google_client_id %>' - - name: GOOGLE_CLIENT_SECRET - password: - '<%= @google_client_secret %>' - - name: SENTRY_DSN - password: - '<%= @sentry_dsn %>' diff --git a/modules/govuk_jenkins/templates/jobs/travel_advice_email_alert_check.yaml.erb b/modules/govuk_jenkins/templates/jobs/travel_advice_email_alert_check.yaml.erb deleted file mode 100644 index ae38ba414b..0000000000 --- a/modules/govuk_jenkins/templates/jobs/travel_advice_email_alert_check.yaml.erb +++ /dev/null @@ -1,64 +0,0 @@ ---- -- job: - name: travel-advice-email-alert-check - display-name: TravelAdviceEmailAlertCheck - project-type: freestyle - description: "This job checks if travel advice email alerts have been emailed" - logrotate: - numToKeep: 100 - triggers: - - timed: '*/15 * * * *' # every 15 minutes - properties: - - build-discarder: - days-to-keep: 30 - artifact-num-to-keep: 5 - builders: - - shell: - command: | - ( - git clone https://github.com/alphagov/email-alert-monitoring tmp && - rm -rf email-alert-monitoring && - mv tmp email-alert-monitoring - ) || echo "Cloning failed. Re-using directory from previous run." - - cd email-alert-monitoring - bundle config set --local path "${HOME}/bundles/${JOB_NAME}" - bundle config set --local deployment true - bundle install - bundle exec rake run_travel_alerts - unstable-return: 1 - publishers: - - text-finder: - regexp: "Cloning failed" - also-check-console-output: true - unstable-if-found: true - - trigger-parameterized-builds: - - project: Success_Passive_Check - condition: 'SUCCESS' - predefined-parameters: | - NSCA_CHECK_DESCRIPTION=<%= @travel_advice_service_description %> - NSCA_OUTPUT=<%= @travel_advice_service_description %> success - - project: Failure_Passive_Check - condition: 'FAILED' - predefined-parameters: | - NSCA_CHECK_DESCRIPTION=<%= @travel_advice_service_description %> - NSCA_OUTPUT=<%= @travel_advice_service_description %> failed - wrappers: - - ansicolor: - colormap: xterm - - inject-passwords: - global: false - mask-password-params: true - job-passwords: - - name: GOOGLE_OAUTH_CREDENTIALS - password: - '<%= @google_oauth_credentials %>' - - name: GOOGLE_CLIENT_ID - password: - '<%= @google_client_id %>' - - name: GOOGLE_CLIENT_SECRET - password: - '<%= @google_client_secret %>' - - name: SENTRY_DSN - password: - '<%= @sentry_dsn %>'