From caaf0c57ae33aec41c2ac523fe0d0ee606102ec1 Mon Sep 17 00:00:00 2001 From: Syed Imran Hassan <45480841+syedimranhassan@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:30:36 +0500 Subject: [PATCH] chore: Removed Splunk backup job (#1786) --- devops/jobs/BackupSplunkToS3.groovy | 62 ------------------------- devops/resources/backup-splunk-to-s3.sh | 16 ------- 2 files changed, 78 deletions(-) delete mode 100644 devops/jobs/BackupSplunkToS3.groovy delete mode 100644 devops/resources/backup-splunk-to-s3.sh diff --git a/devops/jobs/BackupSplunkToS3.groovy b/devops/jobs/BackupSplunkToS3.groovy deleted file mode 100644 index 7d576902b..000000000 --- a/devops/jobs/BackupSplunkToS3.groovy +++ /dev/null @@ -1,62 +0,0 @@ -package devops.jobs -import static org.edx.jenkins.dsl.Constants.common_logrotator -import static org.edx.jenkins.dsl.Constants.common_wrappers - -class BackupSplunkToS3{ - public static def job = { dslFactory, extraVars -> - dslFactory.job(extraVars.get("FOLDER_NAME","Monitoring") + "/backup-tools-edx-splunk-config-to-s3") { - - logRotator common_logrotator - wrappers common_wrappers - - wrappers { - sshAgent(extraVars.get("SSH_AGENT_KEY")) - } - - parameters{ - stringParam('CONFIGURATION_REPO', extraVars.get('CONFIGURATION_REPO', 'git@github.com:edx/configuration.git'), - 'Git repo containing edX configuration.') - stringParam('CONFIGURATION_BRANCH', extraVars.get('CONFIGURATION_BRANCH', 'master'), - 'e.g. tagname or origin/branchname') - } - - multiscm{ - git { - remote { - url('$CONFIGURATION_REPO') - branch('$CONFIGURATION_BRANCH') - } - extensions { - cleanAfterCheckout() - pruneBranches() - relativeTargetDirectory('configuration') - } - } - } - - triggers{ - cron("H H * * *") - } - - environmentVariables{ - env("s3_bucket", extraVars.get("S3_BUCKET")) - env("host_ip", extraVars.get("HOST_IP")) - env("splunk_host", extraVars.get("SPLUNK_HOST")) - env("splunk_backup_dir", extraVars.get("SPLUNK_BACKUP_DIR")) - } - - steps { - shell(dslFactory.readFileFromWorkspace('devops/resources/backup-splunk-to-s3.sh')) - - } - - if (extraVars.get('NOTIFY_ON_FAILURE')){ - publishers { - mailer(extraVars.get('NOTIFY_ON_FAILURE'), false, false) - } - } - - } - } - -} diff --git a/devops/resources/backup-splunk-to-s3.sh b/devops/resources/backup-splunk-to-s3.sh deleted file mode 100644 index 4ef4f0165..000000000 --- a/devops/resources/backup-splunk-to-s3.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set +u -. /edx/var/jenkins/jobvenvs/virtualenv_tools.sh -# creates a venv with its location stored in variable "venvpath" -create_virtualenv --python=python3.8 --clear -. "$venvpath/bin/activate" -set -u - -cd $WORKSPACE/configuration -pip install -r requirements.txt - -cd $WORKSPACE/configuration/playbooks/edx-east - -ansible-playbook -u splunkbackup -i $host_ip, splunk_config_backup.yml -e "splunk_host_id=$splunk_host \ - splunk_s3_backups_bucket=$s3_bucket splunk_backup_dir=$splunk_backup_dir"