| #!/bin/ash |
| |
| # Copyright (C) 2018 The Android Open Source Project |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http:#www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| GERRIT_DAEMON_OPTS="--console-log --enable-httpd" |
| |
| IS_REPLICA=$(git config -f /var/gerrit/etc/gerrit.config --get container.replica) |
| if [[ "$IS_REPLICA" == "true" ]]; then |
| GERRIT_DAEMON_OPTS="$GERRIT_DAEMON_OPTS --replica" |
| fi |
| |
| JAVA_OPTIONS=$(git config --file /var/gerrit/etc/gerrit.config --get-all container.javaOptions) |
| JAVA_OPTIONS="$JAVA_OPTIONS -Djava.security.properties=/var/jvm/etc/security.properties" |
| JAVA_OPTIONS="$JAVA_OPTIONS -Dgerrit.instanceId=$POD_NAME" |
| java ${JAVA_OPTIONS} -jar /var/gerrit/bin/gerrit.war daemon \ |
| -d /var/gerrit \ |
| $GERRIT_DAEMON_OPTS |