-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-runner.sh
More file actions
74 lines (50 loc) · 1.41 KB
/
install-runner.sh
File metadata and controls
74 lines (50 loc) · 1.41 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
echo "Entering ${ACTIONS_RUNNER_DIR} ... "
echo
cd ${ACTIONS_RUNNER_DIR}
echo 'Current working directory is ...'
echo
pwd
echo
echo "##### BEGIN INSTALLING \"${GITHUB_RUNNER_NAME}\" ACTIONS RUNNER #####"
echo
echo "Installing actions runner under : "
pwd
echo
echo "Downloading and installing the actions-runner for ${GITHUB_REPO_URL} : "
echo
curl -o ${ACTIONS_RUNNER_INSTALL_FILENAME} -L ${ACTIONS_RUNNER_DOWNLOAD_URL}
echo
echo "Downloading \"${ACTIONS_RUNNER_INSTALL_FILENAME}\" completed ... "
echo "Begin unpacking the package ... "
echo
tar xzf ./${ACTIONS_RUNNER_INSTALL_FILENAME}
echo
echo "Installation package unpacked."
echo
echo
echo 'Creating answering file (answers.txt): '
echo
touch answers.txt
echo ${GITHUB_RUNNER_GROUP} >> answers.txt
echo ${GITHUB_RUNNER_NAME} >> answers.txt
echo ${GITHUB_RUNNER_LABELS} >> answers.txt
echo ${GITHUB_RUNNER_WORK_FOLDER} >> answers.txt
echo
echo 'answers.txt created: '
echo
cat answers.txt
echo
echo
./config.sh --url ${GITHUB_REPO_URL} --token ${GITHUB_REPO_TOKEN} < answers.txt
echo
echo "Changing all files under ${ACTIONS_RUNNER_DIR} to user ${RUNNER_USER_ID} :"
echo
sudo chown -R ${RUNNER_USER_ID}:${RUNNER_USER_ID} ${ACTIONS_RUNNER_DIR}
echo
echo "Verifying file ownership and permissions under ${ACTIONS_RUNNER_DIR} :"
echo
ls -al ${ACTIONS_RUNNER_DIR}
echo
echo "##### INSTALLING \"${GITHUB_RUNNER_NAME}\" ACTIONS RUNNER COMPLETED #####"
echo