From 1ed0cc96f8c025e01e41ca36274017d2b864105c Mon Sep 17 00:00:00 2001 From: c22122192 <XiaoX16@cardiff.ac.uk> Date: Thu, 3 Apr 2025 12:13:08 +0100 Subject: [PATCH] Merge remote-tracking branch 'origin/main' --- Terraform/serverJenkins.sh | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/Terraform/serverJenkins.sh b/Terraform/serverJenkins.sh index 1a1cd53..2b071c5 100644 --- a/Terraform/serverJenkins.sh +++ b/Terraform/serverJenkins.sh @@ -7,12 +7,12 @@ echo logged in as $USER. echo in directory $PWD -echo "installing MariaDB..." -# sudo yum install mysql -y -sudo dnf install mariadb-server -y -sudo systemctl start mariadb -sudo systemctl status mariadb -sudo systemctl enable mariadb +#echo "installing MariaDB..." +## sudo yum install mysql -y +#sudo dnf install mariadb-server -y +#sudo systemctl start mariadb +#sudo systemctl status mariadb +#sudo systemctl enable mariadb echo "creating mysql_secure_installation.txt..." @@ -41,12 +41,9 @@ sudo dnf update openssh-server openssh-client -y echo "needs to be in root account" cd root -touch .ssh/known_hosts -ssh-keyscan git.cardiff.ac.uk >> .ssh/known_hosts -chmod 644 .ssh/known_hosts echo "now needs to be in rocky user directory" -cd sports-league-application +cd /home/rocky cat << `EOF` >> matrix_keypair.key -----BEGIN OPENSSH PRIVATE KEY----- @@ -88,12 +85,27 @@ TBXGOnjcHM0kCN4cQcT7YgnEtrt1SEt/yVK590Z+hSkaJIgPxUlDrm3UCkHFrKxdT+UCDL /sHf7dEAE5USKzAAAAHElEK2MyMjEyMjE5MkBEU0E4Q0U5RUU2MEFCRjgBAgMEBQY= -----END OPENSSH PRIVATE KEY----- `EOF` -chmod 400 matrix_keypair.key - -ssh-agent bash -c 'ssh-add matrix_keypair.key; git clone git@git.cardiff.ac.uk:c24020257/sports-league-application.git' +sudo chmod 400 matrix_keypair.key +sudo ssh-agent bash -c 'ssh-add matrix_keypair.key' +cd ~/ +sudo touch .ssh/known-hosts +#touch .ssh/known_hosts +sudo ssh-keyscan git.cardiff.ac.uk >> .ssh/known_hosts +sudo chmod 644 .ssh/known_hosts +cd /home/rocky +echo "Cloning Git Repo..." +sudo ssh-agent bash -c 'ssh-add matrix_keypair.key; git clone git@git.cardiff.ac.uk:c24020257/sports-league-application.git' +echo "Entering Git Repo directory..." cd sports-league-application +echo "installing MariaDB..." +# sudo yum install mysql -y +sudo dnf install mariadb-server -y +sudo systemctl start mariadb +sudo systemctl status mariadb +sudo systemctl enable mariadb + mysql -uroot -pcomsc < src/main/resources/sports.sql -- GitLab