-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_docker_scripts.sh
More file actions
executable file
·51 lines (41 loc) · 1.12 KB
/
install_docker_scripts.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.12 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
#! /bin/bash
PWD=$(pwd)
REPO_NAME="install_gitlab_ci_centos8"
REPO_VERSION="v0.0.3"
WORK_DIR_NAME="/gitlab_ci_scripts"
function check_dependency () {
if ! command -v $1 &> /dev/null; then
echo "'$1' not found!"
return 1
else
return 0
fi
}
check_dependency git || exit 1
check_dependency python3 || exit 1
check_dependency pip3 || exit 1
rm -rf $REPO_NAME
if ! git clone -b "$REPO_VERSION" https://github.com/A1ex3/"$REPO_NAME.git"; then
echo "Failed to clone the repository!"
exit 1
fi
if cp "$REPO_NAME/dckr/gitlab_ci_docker_scripts.service" /etc/systemd/system/gitlab_ci_docker_scripts.service; then
rm -f "$REPO_NAME/dckr/gitlab_ci_docker_scripts.service"
else
echo "Failed to copy service file!"
exit 1
fi
rm -rf "$WORK_DIR_NAME"
mkdir -p "$WORK_DIR_NAME"
cp -ru "$REPO_NAME/dckr/"* "$WORK_DIR_NAME"
rm -rf "$REPO_NAME"
cd "$WORK_DIR_NAME" || exit 1
if ! python3 -m venv venv; then
echo "Failed to create venv!"
exit 1
fi
if ! ./venv/bin/pip3 install -r requirements.txt; then
echo "Failed to install dependencies for Python!"
exit 1
fi
cd "$PWD" || exit 1