File: test_script.sh

package info (click to toggle)
gitlab-ci-multi-runner 14.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 31,248 kB
  • sloc: sh: 1,694; makefile: 384; asm: 79; ruby: 68
file content (48 lines) | stat: -rw-r--r-- 815 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
40
41
42
43
44
45
46
47
48
#!/bin/bash

set -e
USER="$1"

status() {
	pidof gitlab-runner
}

echo Checking existence of $USER...
id -u "$USER"

echo Check if /etc/gitlab-runner/config.toml is created...
if [[ -f /etc/gitlab-runner/config.toml ]]; then
	CONFIG=$(ls -al /etc/gitlab-runner | grep config.toml)
	echo $CONFIG | grep "\-rw-------"
	echo $CONFIG | grep "root root"
fi

echo List of processes:
ps auxf
echo

echo Checking if runner is running...
status
echo

echo Testing help...
gitlab-runner --help > /dev/null
echo

echo Stopping runner...
gitlab-runner stop
! status
echo

echo Starting runner...
gitlab-runner start
sleep 1s
status
echo

#echo Registering runner...
#gitlab-runner register -n -u https://ci.gitlab.com/ -r 51cc1fe15c0ac7d3d5564e24ada4d1
#echo

echo Checking su...
echo id | su --shell /bin/bash --login "$USER"