From 985552c9956048617c206b351aef7d155cb1567f Mon Sep 17 00:00:00 2001
From: Eesaan Atluri <atlurie@uab.edu>
Date: Tue, 29 Oct 2024 02:43:51 -0400
Subject: [PATCH] feat: Run clusterhooks at deploy time for proxies

We are providing hooks into the cluster we need at deploy time rather
than baking them at build time.
This will enable us to build once and deploy across multiple clusters.
Otherwise, we need to build image whenever you need to deploy to a
different cluster.
---
 .gitlab-ci.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 092d212..e52aa29 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -149,6 +149,11 @@ deploy_http_proxy_node:
       cat > user_data.txt <<EOF
       #!/bin/bash
       echo "$DEV_KEY" >> /root/.ssh/authorized_keys
+      git clone ${CI_REPOSITORY_URL} /tmp/${CI_PROJECT_NAME}
+      cd /tmp/${CI_PROJECT_NAME}
+      git checkout ${CI_COMMIT_REF_NAME}
+      ansible-playbook -c local -i 127.0.0.1, ansible/cheaha.yml | tee -a ansible.log
+      rm -rf /tmp/${CI_PROJECT_NAME}
       EOF
     - >
       export HTTP_PROXY_INSTANCE_ID=$(openstack server create
@@ -185,6 +190,11 @@ deploy_ssh_proxy_node:
       cat > user_data.txt <<EOF
       #!/bin/bash
       echo "$DEV_KEY" >> /root/.ssh/authorized_keys
+      git clone ${CI_REPOSITORY_URL} /tmp/${CI_PROJECT_NAME}
+      cd /tmp/${CI_PROJECT_NAME}
+      git checkout ${CI_COMMIT_REF_NAME}
+      ansible-playbook -c local -i 127.0.0.1, ansible/cheaha.yml | tee -a ansible.log
+      rm -rf /tmp/${CI_PROJECT_NAME}
       EOF
     - >
       export SSH_PROXY_INSTANCE_ID=$(openstack server create
-- 
GitLab