From ab9fb7d931515b141fd2a50f7c63944f8c99a875 Mon Sep 17 00:00:00 2001
From: Benoit Donneaux <benoit@leastauthority.com>
Date: Wed, 17 Jan 2024 10:26:25 +0100
Subject: [PATCH] Add hro-cloud grid for CD

Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
---
 .gitlab-ci.yml                 | 16 ++++++++++++++++
 ci-tools/known_hosts.hro-cloud |  5 +++++
 ci-tools/update-grid-servers   |  5 +++++
 3 files changed, 26 insertions(+)
 create mode 100644 ci-tools/known_hosts.hro-cloud

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3c24611a..23205d51 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -169,6 +169,22 @@ deploy-to-production:
     name: "production"
     url: "https://monitoring.private.storage/"
 
+# Update the hro-cloud deployment - just like above for production (same branch).
+deploy-to-hro-cloud:
+  <<: *UPDATE_GRID
+
+  # https://docs.gitlab.com/ee/ci/yaml/#rules
+  rules:
+    # https://docs.gitlab.com/ee/ci/yaml/index.html#rulesif
+    # https://docs.gitlab.com/ee/ci/jobs/job_control.html#cicd-variable-expressions
+    # https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
+    - if: '$CI_COMMIT_BRANCH == "production"'
+
+  environment:
+    # See notes in `update-staging`.
+    name: "hro-cloud"
+    url: "https://monitoring.deerfield.leastauthority.com/"
+
 update-nixpkgs:
   <<: *RUN_ON_SCHEDULE
   stage: "build"
diff --git a/ci-tools/known_hosts.hro-cloud b/ci-tools/known_hosts.hro-cloud
new file mode 100644
index 00000000..5ed3a569
--- /dev/null
+++ b/ci-tools/known_hosts.hro-cloud
@@ -0,0 +1,5 @@
+monitoring.deerfield.leastauthority.com,vps-50812a54.vps.ovh.net,51.38.134.175 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOIgegzAxXPhxFK8vglBlUAFTzUoCj5TxqcLS57NaL2l
+payments.deerfield.leastauthority.com,vps-3cbcf174.vps.ovh.net,217.182.78.151 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFI32csriKoUUD3e813gcEAD5CCuf8rUnary70HfJMSr
+storage001.deerfield.leastauthority.com,185.225.209.174 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKX9Ei+WdNVvIncHQZ9CdEXZeSj2zBM/NQEuqmMbep0A
+storage002.deerfield.leastauthority.com,38.170.241.34 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK3TAQj5agAv9AOZQhE95vATQKcNbNZj5Y3xMb5cjzGZ
+storage003.deerfield.leastauthority.com,ns3728736.ip-151-80-28.eu,151.80.28.108 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFsh9No4PT3hHDsY/07kDSRCg1Jse38n7GY0Rk9DnyPe
diff --git a/ci-tools/update-grid-servers b/ci-tools/update-grid-servers
index c5206fd4..734ce6f3 100755
--- a/ci-tools/update-grid-servers
+++ b/ci-tools/update-grid-servers
@@ -61,6 +61,11 @@ update_grid_nodes() {
 	    domain=private.storage
 	    ;;
 
+	"hro-cloud")
+	    grid_dir=./morph/grid/hro-cloud
+	    domain=deerfield.leastauthority.com
+	    ;;
+
 	"staging")
 	    grid_dir=./morph/grid/testing
 	    domain=privatestorage-staging.com
-- 
GitLab