forked from NodeOS/NodeOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·59 lines (46 loc) · 1.43 KB
/
Copy pathinstall
File metadata and controls
executable file
·59 lines (46 loc) · 1.43 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
#!/usr/bin/env bash
REV=$(tput rev)
BLD=$(tput bold)
GRY="\e[90m"
RED="\e[31m"
GRN="\e[32m"
WHT="\e[37m"
CLR="\e[0m"
if [[ -z "$PLATFORM" ]]; then PLATFORM=docker; fi
function err(){
echo -e "${RED}Error Building Image${CLR}"
exit $1
}
case $PLATFORM in
docker)
# if user is logged into docker index
# automatically prefix their name to built images
name=$(docker info | grep ^Username | awk '{print $2}' )
if [[ -z "$name" ]]; then name=local; fi
NOSN=${name}/nodeos
;;
esac
export PLATFORM
## Build each layer up
#(cd node_modules/nodeos-cross-toolchain npm install ) &&
#(cd node_modules/nodeos-barebones npm install ) &&
#(cd node_modules/nodeos-initramfs npm install ) &&
#(cd node_modules/nodeos-rootfs npm install ) &&
#(cd node_modules/nodeos-usersfs name=${NOSN} npm install ) || err $?
echo -e "${GRY}------------------------------------------${CLR}"
echo -e "${GRN}${BLD}Success!${CLR}"
echo -e "${GRN}You Just Built a Custom NodeOS Image ${WHT}$NOSN${CLR}"
echo -e "${GRY}------------------------------------------${CLR}"
echo
echo -e "- Interactively run your image with:"
case $PLATFORM in
docker)
echo -e "${WHT} docker run -t -i $NOSN${CLR}"
echo
echo -e "- Share your creation with:"
echo -e "${WHT} docker push $NOSN${CLR}"
;;
pc_qemu|raspberry_qemu)
echo -e "${WHT} npm start${CLR}"
;;
esac