Skip to content

Commit

Permalink
Merge pull request #915 from hmcts/ieuanb74-patch-7
Browse files Browse the repository at this point in the history
Move elasticsearch workflow to ADO
  • Loading branch information
ieuanb74 authored Dec 11, 2024
2 parents bd354d5 + a6e1327 commit b7b1e7e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 32 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/elasticsearch-auto-start.yaml

This file was deleted.

47 changes: 47 additions & 0 deletions azure-pipeline-start-elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Start Elasticsearch Service

schedules:
- cron: '45 6 * * 1-5' # Every weekday at 6:45am BST
displayName: Weekdays @ 6:45am
branches:
include:
- master

trigger:
branches:
include:
- master

variables:
timeoutInMinutes: 60
agentPool: 'hmcts-cftptl-agent-pool'
service_connection: 'GA'

stages:
stage: StartElasticsearchService
jobs:
job: StartElasticsearchService
displayName: Start Elasticsearch Service
pool:
name: $(agentPool)

steps:
- checkout: self
clean: true

- task: DownloadSecureFile@1
name: elkprivatekey
inputs:
secureFile: 'elk_private_key'

- script: ./$(System.DefaultWorkingDirectory)/scripts/vm/restart-es-service.sh staging $(elkprivatekey.secureFilePath)
displayName: 'Start Elasticsearch Staging'

- script: ./$(System.DefaultWorkingDirectory)/scripts/vm/restart-es-service.sh demo $(elkprivatekey.secureFilePath)
displayName: 'Start Elasticsearch Demo'

- script: ./$(System.DefaultWorkingDirectory)/scripts/vm/restart-es-service.sh perftest $(elkprivatekey.secureFilePath)
displayName: 'Start Elasticsearch Perftest'

- script: ./$(System.DefaultWorkingDirectory)/scripts/vm/restart-es-service.sh ithc $(elkprivatekey.secureFilePath)
displayName: 'Start Elasticsearch ITHC'
5 changes: 2 additions & 3 deletions scripts/vm/restart-es-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
shopt -s nocasematch

REMOTE_USER="elkadmin"
PRIVATE_KEY="~/.ssh/elk_private_key"
ENVIRONMENT=$1
PRIVATE_KEY=$2

STAGING_HOSTS=("10.96.149.7" "10.96.149.5" "10.96.149.4" "10.96.149.10") # ccd-data-0, ccd-data-1, ccd-data-2, ccd-data-3
DEMO_HOSTS=("10.96.216.4" "10.96.216.7" "10.96.216.5" "10.96.216.6") # ccd-data-0, ccd-data-1, ccd-data-2, ccd-data-3
Expand All @@ -18,8 +19,6 @@ if [ "$#" -ne 1 ]; then
exit 1
fi

ENVIRONMENT=$1

case "${ENVIRONMENT}" in
staging)
REMOTE_HOSTS=("${STAGING_HOSTS[@]}")
Expand Down

0 comments on commit b7b1e7e

Please sign in to comment.