-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·41 lines (41 loc) · 1.94 KB
/
build
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
#!/bin/bash
export PATH=$PATH:$(pwd);
[[ -n $MICROSERVICES ]] && PROXY=1 BUS=1 QUEUE=1
if [[ -n $BUILD ]]; then
which powscript || {
wget "https://raw.githubusercontent.com/coderofsalvation/powscript/master/powscript"
chmod 755 powscript
}
[[ ! -f install/install ]] && powscript --compile install/src/install.pow > install/install
[[ ! -f install/boot ]] && powscript --compile install/src/boot.pow > install/boot
[[ ! -f install/podtail ]] && powscript --compile install/src/podtail.pow > install/podtail
chmod 755 install/*
docker build --no-cache -t nodepod .
fi
if [[ -n $RUN ]]; then
set -x
[[ -n $CLEAN && -n $MICROSERVICES ]] && rm -rf srv/apps/{bus,queue,proxy}
[[ -n $MICROSERVICES ]] && PODRC=.podrc.microservices || PODRC=.podrc
[[ -n $LOGIN ]] && BG="d" || BG=""
docker kill nodepod && docker rm nodepod;
docker run -it$BG \
--volume=$(pwd)/srv:/srv \
--volume=$(pwd)/.ssh:/home/nodejs/.ssh \
--volume=$(pwd)/$PODRC:/home/nodejs/.podrc \
--volume=$(pwd)/.ssh.etc:/etc/ssh \
--env=MICROSERVICES=$MICROSERVICES \
--env=NPM_MODULES="$NPM_MODULES" \
--env=ROOTPASSWD=test \
--env=PASSWD=test \
--env=HOSTNAME=nodepod \
--env=CONFIGPROXY_AUTH_TOKEN=test \
-p 23:22 \
-p 81:8080 \
-p 89:8989 \
-p 19999:19999 \
--name=nodepod \
nodepod
if [[ -n $LOGIN ]]; then
docker exec -it nodepod /bin/bash
fi
fi