-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
118 lines (79 loc) · 3.07 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
_SHELL="$(ps -p $$ -o comm=)"; # bash || sh || zsh
_SHELL="$(basename ${_SHELL//-/})"
case ${_SHELL} in
zsh)
_DIR="$( cd "$( dirname "${(%):-%N}" )" && pwd -P )"
;;
sh)
_DIR="$( cd "$( dirname "${0}" )" && pwd -P )"
;;
*)
_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P )"
;;
esac
ROOT="${_DIR}"
# let's not enable it here
# because some scripts here will use node some only in CI
# and by fixing this export here additional logs will appear in CI mode
# Debugger listening on ws://127.0.0.1:35133/beec5c79-0b8f-43c1-b83a-f9ebc185d9a9
# For help, see: https://nodejs.org/en/docs/inspector
# let's individual sh files called from here decide if they need this export or not
# export NODE_OPTIONS=""
set -e
if [ ! -f ".env" ]; then
echo "${0} error: file .env doesn't exist"
exit 1
fi
source ".env"
if [ ! -f ".env.sh" ]; then
echo "${0} error: file .env doesn't exist"
exit 1
fi
/bin/bash bash/exportsource.sh ".env"
eval "$(/bin/bash bash/exportsource.sh ".env")"
source ".env.sh"
if [ "${PROJECT_NAME}" = "" ]; then
echo "env var PROJECT_NAME is not defined";
exit 1
fi
if [ "${GITSTORAGE_CORE_REPOSITORY}" = "" ]; then
echo "env var GITSTORAGE_CORE_REPOSITORY is not defined";
exit 1
fi
if [ "${GITHUB_SOURCES_PREFIX}" = "" ]; then
echo "env var GITHUB_SOURCES_PREFIX is not defined";
exit 1
fi
if [ "${EXPOSE_EXTRA_ENV_VARIABLES}" = "" ]; then
echo "env var EXPOSE_EXTRA_ENV_VARIABLES is not defined";
exit 1
fi
node pages/portsregistry/lists/ports-generator.js
# call those together in this order vvv
/bin/bash uglify.sh
/bin/bash template.sh
# call those together in this order ^^^
node libs/preprocessor.js
node node_modules/.bin/webpack
/bin/bash esbuild.sh
# /bin/bash remove-not-changed-builds.sh # not needed since I'm building and releasing that build in github actions
# /bin/bash pages/kubernetes/compress.sh
/bin/bash bash/substitute-variables-bash.sh gitstorage-core.sh -- \
GITSTORAGE_CORE_REPOSITORY "${GITSTORAGE_CORE_REPOSITORY}" \
PROD_SCHEMA "${PROD_SCHEMA}" \
PROD_PORT "${PROD_PORT}" \
PROD_HOSTNAME "${PROD_HOSTNAME}"
# NOTICE: remember it will not process if --run not passed or CI env var is not present
# I'm deliberately suppressing error to continue if above is not provided for local dev environment
/bin/bash .github/urlwizzard.sh
# NOTICE: remember it will not process if --run not passed or CI env var is not present
# I'm deliberately suppressing error to continue if above is not provided for local dev environment
/bin/bash .github/sha384.sh
node node_modules/.bin/prettier --config prettier.config.cjs --write . 1> >(/bin/bash bash/dlogger.sh o prettier) 2> >(/bin/bash bash/dlogger.sh e prettier)
# this one after style_fix
# inject special blocking code
# NOTICE: remember it will not process if --run not passed or CI env var is not present
# I'm deliberately suppressing error to continue if above is not provided for local dev environment
/bin/bash .github/clicksecure.sh
/bin/bash .github/injector.sh
/bin/bash pages/bash/xx/xx.inverse.postprocessor.sh