-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·71 lines (54 loc) · 1.69 KB
/
install.sh
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
#!/bin/bash
TEMP_FOLDER="deuxhuithuit-push-tmp"
function abort {
echo "Installation aborted"
exit 1
}
function hasCurl {
result=$(command -v curl)
if [ "$?" = "1" ]; then
echo "You need curl to install push."
exit 1
fi
}
function hasDocker {
result=$(command -v docker)
if [ "$?" = "1" ]; then
echo "You need Docker Desktop to use push. Please install it for your platform at https://www.docker.com/products/docker-desktop"
exit 1
fi
}
hasCurl
hasDocker
if [[ -z "${OP_AUTH_DOMAIN}" ]]; then
echo "OP_AUTH_DOMAIN is not set in your environement variables."
exit 1;
fi
if [[ -z "${OP_AUTH_EMAIL}" ]]; then
echo "OP_AUTH_EMAIL is not set in your environement variables."
exit 1;
fi
if [[ -z "${OP_AUTH_SECRET_KEY}" ]]; then
echo "OP_AUTH_SECRET_KEY is not set in your environement variables."
exit 1;
fi
if [[ -z "${OP_SVN_ENTRY}" ]]; then
echo "OP_SVN_ENTRY is not set in your environement variables."
exit 1;
fi
# make temp folder
mkdir -p $TEMP_FOLDER
# get dockerfile
curl -s https://raw.githubusercontent.com/DeuxHuitHuit/push/main/Dockerfile > $TEMP_FOLDER/Dockerfile
# get checkout.sh file
curl -s https://raw.githubusercontent.com/DeuxHuitHuit/push/main/checkout.sh > $TEMP_FOLDER/checkout.sh
# copy ssh folder to tmp
cp -R ~/.ssh/. $TEMP_FOLDER/ssh
# remove config since it can cause errors with ssh client
rm -rf $TEMP_FOLDER/ssh/config
# copy subversion folder to tmp
cp -R ~/.subversion/. $TEMP_FOLDER/subversion
# actual docker build
docker build -t deuxhuithuit/push $TEMP_FOLDER --build-arg opdomain="$OP_AUTH_DOMAIN " --build-arg opemail="$OP_AUTH_EMAIL" --build-arg opsecretkey="$OP_AUTH_SECRET_KEY" --build-arg opsvnentry="$OP_SVN_ENTRY"
# cleanup temp file
rm -rf $TEMP_FOLDER