This repository was archived by the owner on Mar 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entypoint.sh
More file actions
executable file
·86 lines (78 loc) · 2.82 KB
/
docker-entypoint.sh
File metadata and controls
executable file
·86 lines (78 loc) · 2.82 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# _____ __
# | \.-----.----.| |--.-----.----.
# | -- | _ | __|| <| -__| _|
# |_____/|_____|____||__|__|_____|__|
# ______ __ __ __
# | __ \.--.--.|__| |.--| |
# | __ <| | || | || _ |
# |______/|_____||__|__||_____|
# _______ __ __
# | __|.----.----.|__|.-----.| |_
# |__ || __| _|| || _ || _|
# |_______||____|__| |__|| __||____|
# |__|
###########################################################################
###########################################################################
###########################################################################
# This script serves as an entrypoint to using docker to build the theme variants and not clog the local system with its artifacts.
# First output candy for the script's echo statements
cr="$(tput setaf 1)"
cg="$(tput setaf 2)"
cy="$(tput setaf 3)"
cm="$(tput setaf 5)"
sb="$(tput bold)"
sn="$(tput sgr0)"
print() {
case "$1" in
t | title)
shift
printf "%s\n" "${sb}${cg}[###]$*${sn}"
;;
s | step)
shift
printf "%s\n" "${sb}${cm}[===]$*${sn}"
;;
e | error)
shift
printf "%s\n" "${sb}${cr}[!!!]$*${sn}"
exit 1
;;
w | warning)
shift
printf "%s\n" "${sb}${cy}[:::]$*${sn}"
;;
*)
printf '%s\n' "$*"
;;
esac
}
print t "Docker Entrypoint Script"
print s "---------------------------------"
print s "---------------------------------"
print s "---------------------------------"
print s "Building GTK Theme Within Docker Container"
# Builds the GTK theme variants and dumps them in /out
#
mkdir -p "$PWD"/out
DOCKER_BUILDKIT=1 docker build --output type=tar,dest=out.tar .
#sudo docker cp dhumavati:latest:/dist "$PWD"/out
print s "The files from the build should be available within the out directory"
print s "---------------------------------"
print s "---------------------------------"
print s "---------------------------------"
print s "Changing permissions of the output files."
# Because within the container, everything was built by root, this enables the use of the themes in the user repository and my ability to release them on Github
#
tar -xvf out.tar -C ./out
sudo chown -Rv 777 "$PWD"/out
print s "---------------------------------"
print s "---------------------------------"
print s "---------------------------------"
print s "Installing the theme locally"
## This will go into the directory that the files were dumped into and run the Makefile's install command
cd "$PWD"/out/dist/Dhumavati-Theme && sudo make install
print s "---------------------------------"
print s "---------------------------------"
print s "---------------------------------"
print t "The themes should now be installed and ready for use locally."