-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacos-builder.sh
More file actions
executable file
·32 lines (22 loc) · 888 Bytes
/
macos-builder.sh
File metadata and controls
executable file
·32 lines (22 loc) · 888 Bytes
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
#!/bin/bash
# this script will automatically build the latest versions of Node.js on macOS
# requires docker-machine, virtualbox and jq to be installed
cd $(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
osascript -e 'display notification "Node.js build started" with title "oznu/alpine-node"'
HOST_CPU=$(sysctl -n hw.ncpu)
HOST_MEMORY=$(sysctl -n hw.memsize)
VM_NAME=node-builder
VM_CORES=$(($HOST_CPU / 2))
VM_MEMORY=$((($HOST_MEMORY / 1024 / 1024) / 2))
docker-machine create \
--driver "virtualbox" \
--virtualbox-memory $VM_MEMORY \
--virtualbox-cpu-count $VM_CORES \
--virtualbox-disk-size 10000 \
--virtualbox-ui-type headless \
--virtualbox-share-folder "$(pwd)/out:$(pwd)/out" \
$VM_NAME
eval $(docker-machine env $VM_NAME)
./build.sh
docker-machine rm -y $VM_NAME
osascript -e 'display notification "Node.js build finished" with title "oznu/alpine-node"'