-
Notifications
You must be signed in to change notification settings - Fork 2
/
mac_build.sh
executable file
·40 lines (35 loc) · 1.25 KB
/
mac_build.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
# Check if Homebrew is installed
if ! command -v brew &> /dev/null; then
echo "BUILD: homebrew is not installed. installing homebrew.."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "BUILD: found brew"
fi
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo "BUILD: docker is not installed. installing docker.."
brew install docker
else
echo "BUILD: found docker. skipping install"
fi
# Check if Colima is installed. This is a Docker run alternative
if ! command -v colima &> /dev/null; then
echo "BUILD: colima is not installed. installing colima.."
brew install colima
else
echo "BUILD: found colima. skipping install"
fi
# Check if nerdctl is installed. nerdctl provides functionality to manage contrainers as an alternative for docker cli
if ! command -v nerdctl &> /dev/null; then
echo "BUILD: nerdctl is not installed. running `colima nerdctl install`.."
colima nerdctl install
else
echo "BUILD: found nerdctl. skipping install"
fi
if pgrep -x "colima" > /dev/null; then
echo "BUILD: colima is already running."
else
echo "BUILD: colima is not running. starting colima now"
colima start
fi
docker-compose up --build