summarylogtreecommitdiffstats
path: root/sonarqube-lts.install
blob: 9fe6a7d1162445c952e22a3d52a0b73c83dd259b (plain)
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
#!/usr/bin/env sh
# vim:set ts=4 sw=4 et:

username="sonarqube"

post_install() {
    systemd-sysusers "${username}.conf"
    systemd-tmpfiles --create "${username}.conf"
    chown -R "$username:$username" /etc/webapps/$username /usr/share/webapps/$username

    echo "Copy /usr/share/doc/sonarqube/99-sonarqube.conf to /etc/sysctl.d/99-sonarqube.conf for required sysctl values (vm.max_map_count and fs.file-max)."
    echo "For further information see https://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Linux"
}

pre_upgrade() {
    rm -rf /usr/share/webapps/sonarqube/extensions/plugins/
    echo "Non-default plugins have been deleted. Please re-install the plugins according to the compatibility matrix (https://docs.sonarqube.org/display/PLUG/Plugin+Version+Matrix)."
}

post_upgrade() {
    getent passwd "${username}" >/dev/null 2>&1 || systemd-sysusers "${username}.conf"
    systemd-tmpfiles --create "${username}.conf"
    chown -R "$username:$username" /etc/webapps/$username /usr/share/webapps/$username

    if [ -f /etc/webapps/sonarqube/sonar.properties.pacnew ]; then
        echo "Please check for changes in /etc/webapps/sonarqube/sonar.properties and edit accordingly:"
        echo "$ diff /etc/webapps/sonarqube/sonar.properties /etc/webapps/sonarqube/sonar.properties.pacnew"
    fi

    if [ ! -f /etc/sysctl.d/99-sonarqube.conf ]; then
        echo "Copy /usr/share/doc/sonarqube/99-sonarqube.conf to /etc/sysctl.d/99-sonarqube.conf for required sysctl values (vm.max_map_count and fs.file-max)."
        echo "For further information see https://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Linux"
    fi
}