-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmiddleware-script
More file actions
107 lines (53 loc) · 1.37 KB
/
middleware-script
File metadata and controls
107 lines (53 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
#Author: Caroline
#Date: 20 June 2022
## SonarQube installation Script
## Sonarqube doesnt work when you start it as root user
echo " Make sure you login as a regular user"
# Java installation
# sudo yum update -y
sudo yum install java-11-openjdk-devel -y
sudo yum install java-11-openjdk -y
if [ $? -eq 0 ]
then
echo " Java was installed succesfully"
else
exit 2
echo " Java need to be installed first"
fi
sleep 4
## Download SonarQube latest versions on your server
cd /opt
sudo yum install wget -y
sleep 4
sudo wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.3.0.51899.zip
## Unzipping the previously installed package
sudo unzip /opt/sonarqube-9.3.0.51899.zip
sudo chown -R vagrant:vagrant /opt/sonarqube-9.3.0.51899
if [ $? -eq 0 ]
then
echo " The user and group have been succesfully changed to vagrant"
else
exit 2
echo " User and group need to be changed to vagrant first"
fi
sleep 4
cd /opt/sonarqube-9.3.0.51899/bin/linux-x86-64
./sonar.sh start
if [ $? -eq 0 ]
then
echo "Sonarqube installed and started successfully"
else
exit 2
echo " Sonarqube need to start succesfully to move on"
fi
sleep 4
./sonar.sh status
if [ $? -eq 0 ]
then
echo " Sonarqube is running succesfully"
else exit 1
echo " Sonarqube need to be running successfully to continue"
fi
echo " Java was installed succesfully"
else