이 문서는 Sonarqube 설치에 대한 가이드를 제공한다.
목차 |
---|
CentOS 7 설치
설치버전
- Database : Postgresql 9.3.15
- SonarQube : 5.6.5
...
아이디와 패스워드를 입력합니다. ID : admin / PW : admin
name View file
서비스 등록
CentOS 6
/etc/init.d/sonar 파앨 생성
코드 블럭 |
---|
#!/bin/bash
# SonarQube
#chkconfig: 2345 80 05
#description: SonarQube
RUN_AS_USER=sonar
APPLICATION_HOME=/opt/sonarqube
start() {
echo "Starting SonarQube: "
if [ "x$USER" != "x$RUN_AS_USER" ]; then
su - $RUN_AS_USER -c "$APPLICATION_HOME/bin/linux-x86-64/sonar.sh start"
else
$APPLICATION_HOME/bin/linux-x86-64/sonar.sh start
fi
echo "done."
}
stop() {
echo "Shutting down SonarQube: "
if [ "x$USER" != "x$RUN_AS_USER" ]; then
su - $RUN_AS_USER -c "$APPLICATION_HOME/bin/linux-x86-64/sonar.sh stop"
else
$APPLICATION_HOME/bin/linux-x86-64/sonar.sh stop
fi
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo "Usage: $0 {start|stop}"
esac
exit 0 |
Service 등록
코드 블럭 |
---|
$ chkconfig --add sonar |
CentOS 7
/etc/systemd/system/sonar.service 파일 생성
코드 블럭 |
---|
[Unit]
Description=Atlassian SonarQube Server Service
After=syslog.target network.target crowd.service
[Service]
Type=forking
User=sonar
Environment=JAVA_HOME=/data/java/jdk
ExecStart=/data/sonarqube/bin/linux-x86-64/sonar.sh start
ExecStop=/data/sonarqube/bin/linux-x86-64/sonar.sh stop
[Install]
WantedBy=multi-user.target |
서비스 등록
코드 블럭 |
---|
$ systemctl enable sonar.service |