File: entrypoint

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (39 lines) | stat: -rwxr-xr-x 1,101 bytes parent folder | download
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
#!/bin/bash

set -e

unset BUNDLE_PATH BUNDLE_WITHOUT

if [[ "${WITH_LOAD_BALANCER}" == "true" ]]; then
  gdk config set postgresql.replica.enabled true
  gdk config set postgresql.replica_2.enabled true
  gdk config set load_balancing.enabled true
  gdk reconfigure
fi

if [[ "${QA_GITALY_TRANSACTIONS_ENABLED}" == "true" ]]; then
  gdk config set gitaly.transactions.enabled true
  gdk config set praefect.enabled false
  gdk reconfigure
fi

# Split logs in to multiple files when running in CI
if [ -z "$CI" ]; then
  gdk start

  exec "$@" | tee -a ${HOME}/gitlab-development-kit/gitlab/log/gdk-container.log
else
  logs=("gitaly" "gitlab-workhorse" "postgresql" "rails-background-jobs" "redis" "sshd" "vite" "rails-web" "webpack" "gitlab-http-router")
  for log in "${logs[@]}"; do
    gdk tail $log &>${CI_BUILDS_DIR}/gdk.${log}.log &
  done

  # TODO: Check if we can reconfigure gitlab to write logs directly to `BUILDS_DIR`
  for logfile in ${HOME}/gitlab-development-kit/gitlab/log/*.log; do
    tail -f $logfile &>${CI_BUILDS_DIR}/$(basename $logfile) &
  done

  gdk start

  exec "$@"
fi