-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
81 lines (67 loc) · 1.53 KB
/
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
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
#!/bin/bash
#Setting up some colors for helping read the demo output
bold=$(tput bold); red=$(tput setaf 1); green=$(tput setaf 2); yellow=$(tput setaf 3); blue=$(tput setaf 4); cyan=$(tput setaf 6); reset=$(tput sgr0)
#export http_proxy="http://192.168.254.13:8000"
#export https_proxy=$http_proxy
#export HTTP_PROXY=$http_proxy
#export HTTPS_PROXY=$http_proxy
set -euo pipefail
function s () {
echo -e $@
}
function _() {
local -n _r=$1
shift
echo ${@}
_r=$(buildah ${@})
echo $_r
}
function _fl() {
local -n _r="$1"
shift
args=()
for i in ${!_r[@]}; do
args+=( --$i=${_r[$i]} )
# echo -e "\t$i=${_r[$i]}"
done
echo ${args[@]} ${@}
buildah ${args[@]} ${@}
}
packages=(
node-red-contrib-http-logger
node-red-contrib-boolean-logic
node-red-node-swagger
node-red-contrib-dsm
node-red-contrib-http-logger
node-red-node-swagger
node-red-contrib-sendurl
node-red-contrib-uibuilder
node-red-contrib-actionflows
node-red-contrib-lgtv
node-red-node-email
node-red-contrib-boolean-logic
node-red-contrib-dsm
node-red-contrib-config
node-red-contrib-notification-center
)
npm_config=(
# proxy $http_proxy
# https-proxy $http_proxy
)
declare -A bcfg
bcfg=(
["cmd"]=/app/node_modules/.bin/node-red
)
_ nc from "clearlinux/node"
_ root mount $nc
_ _ run $nc mkdir /app
_ _ config --workingdir /app $nc
echo "{}" > $root/app/package.json
#set ${npm_config[@]}
#while [[ ${1:-} ]]; do
# _ _ run $nc npm config -g set $1 $2
#shift 2
#done
_fl bcfg config $nc
_ _ run $nc -- npm install node-red ${packages[@]}
_ _ commit --rm $nc nr