Skip to content

Commit

Permalink
Feature/lga 2849 pingdom alerting (#50)
Browse files Browse the repository at this point in the history
* Add pingdom URL

* Update deploy dev

* Change the helm

* Join list

* Update pingdom ip

* Change to ben address

* Update whitelist build

* Change parsing of pingdom ips

* Add list

* Change range to ips

* Update name
  • Loading branch information
TawneeOwl authored Oct 21, 2024
1 parent e938748 commit 444eccc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ jobs:
# Pull ranges from shared LAA IP ranges and then remove spaces,
# replace linebreaks with commas, remove last comma, and escape commas for helm input
SHARED_IP_RANGES_LAA=$(curl -s https://raw.githubusercontent.com/ministryofjustice/laa-ip-allowlist/main/cidrs.txt | tr -d ' ' | tr '\n' ',' | sed 's/,/\\,/g' | sed 's/\\,$//')
PINGDOM_IPS=$(curl -s https://my.pingdom.com/probes/ipv4 | tr -d ' ' | tr '\n' ',' | sed 's/,/\\,/g' | sed 's/\\,$//')
echo "PINGDOM_IPS=$PINGDOM_IPS" >> $GITHUB_ENV
echo "SHARED_IP_RANGES_LAA=$SHARED_IP_RANGES_LAA" >> $GITHUB_ENV
- name: Upgrade the Helm chart
Expand All @@ -80,5 +82,6 @@ jobs:
--set ingress.hosts[0].host=${HOST_NAME} \
--set ingress.tls[0].hosts[0]=${HOST_NAME} \
--set sharedIPRangesLAA=$SHARED_IP_RANGES_LAA \
--set pingdomIPs=$PINGDOM_IPS \
--force \
--install
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ jobs:
kubectl config set-context ${KUBE_CLUSTER} --cluster=${KUBE_CLUSTER} --user=deploy-user --namespace=${KUBE_NAMESPACE}
kubectl config use-context ${KUBE_CLUSTER}
- name: Fetch and set SHARED_IP_RANGES_LAA environment variable
- name: Fetch and set whitelist IP environment variables
run: |
# Pull ranges from shared LAA IP ranges and then remove spaces,
# replace linebreaks with commas, remove last comma, and escape commas for helm input
SHARED_IP_RANGES_LAA=$(curl -s https://raw.githubusercontent.com/ministryofjustice/laa-ip-allowlist/main/cidrs.txt | tr -d ' ' | tr '\n' ',' | sed 's/,/\\,/g' | sed 's/\\,$//')
PINGDOM_IPS=$(curl -s https://my.pingdom.com/probes/ipv4 | tr -d ' ' | tr '\n' ',' | sed 's/,/\\,/g' | sed 's/\\,$//')
echo "PINGDOM_IPS=$PINGDOM_IPS" >> $GITHUB_ENV
echo "SHARED_IP_RANGES_LAA=$SHARED_IP_RANGES_LAA" >> $GITHUB_ENV
- name: Upgrade the Helm chart
Expand All @@ -71,5 +73,6 @@ jobs:
--set image.repository=${REGISTRY}/${REPOSITORY} \
--set image.tag=${IMAGE_TAG} \
--set sharedIPRangesLAA=$SHARED_IP_RANGES_LAA \
--set pingdomIPs=$PINGDOM_IPS \
--force \
--install
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If release name contains chart name it will be used as a full name.
{{- end }}

{{- define "laa-access-civil-legal-aid.whitelist" -}}
{{ join "," .Values.sharedIPRangesLAA}}
{{ join "," (list .Values.sharedIPRangesLAA .Values.pingdomIPs)}}
{{- end -}}

{{/*
Expand Down

0 comments on commit 444eccc

Please sign in to comment.