-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathe2e-test-builds.bash
executable file
·215 lines (161 loc) · 5.28 KB
/
e2e-test-builds.bash
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#!/bin/bash
# test all builds
# Fresh test
set -eux
# args:
# * pwd (via $ORIG_REPO_ROOT)
# mmust be executed fromo within a folder in the main implisolid repo
# todo : another version for install-dev
#docker pull frolvlad/alpine-gxx
#docker pull groovy
#docker pull bash
#docker pull emscripten/emsdk
# todo:
# Linux: Using docker bash
# Mac
# Python
# all targets: npm
# move out of ./demos
# e2e
# for latest?
# also can be used for installing (installing dev-environment)
# latest: Pulling from frolvlad/alpine-gxx Digest: sha256:d31e4365fd9e0ec840565259d618bff9d4b8387a4d8c1fdea0eddb6d42f8c95e
# latest: Pulling from library/groovy Digest: sha256:49156d340390d288e2c94403dc78d535a679020f30485ceadafb1b59b8191eca
# latest: Pulling from library/bash Digest: sha256:b3abe4255706618c550e8db5ec0875328333a14dbf663e6f1e2b6875f45521e5
# docker.io/library/bash:latest
# tested on emscripten/emsdk:2.0.22
# tested on emscripten/emsdk:3.1.8 # detected a flaw
function __current_script_dir_func0 () {
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd
}
source $(__current_script_dir_func0)/bash-utils.sh
set -ex
export ORIG_REPO_ROOT=$(git rev-parse --show-toplevel)
echo "ORIG_REPO_ROOT :::: $ORIG_REPO_ROOT"
assert_env_nonempty $ORIG_REPO_ROOT "ORIG_REPO_ROOT=$ORIG_REPO_ROOT implisolid repo not found in current directory $(pwd)"
#cd $ORIG_REPO_ROOT; mkdir e2e-sandbox-temp
E2E=$ORIG_REPO_ROOT/e2e-sandbox-temp
rm -rf $E2E
# #### hard reset done #####
mkdir $E2E
cd $E2E
# only updated after actually pushing => requires branch name! active branch name: hot branch: one neing processed. stil hot
git clone --recurse-submodules [email protected]:sohale/implisolid.git
# todo: from local:
#rsync -r $ORIG_REPO_ROOT $E2E
# recursive
cd implisolid
pwd
find $E2E -maxdepth 2
NEWREPO_BASE="$E2E"
NEW_REPO="$E2E/implisolid"
# NEW_REPO=NEWREPO_ROOT
# CACHE_TEMP=$ORIG_IMPLISOLID/demos/build
# CACHE_TEMP=$ORIG_IMPLISOLID/build
CACHE_TEMP="$ORIG_REPO_ROOT/temp"
mkdir -p "$CACHE_TEMP"
# export SOHALE_IO_REPO=$BASELOC3/sohale.github.io/
# export BASE_MP5_PRIVATE=$BASELOC2/mp5/mp5-private
# Targets:
# 1. for sohale.github.io (uses own repo, aka "remote" or static) -> ./docs/implisolid-build/demo1
# remote/public deploy (to github-pages)
# builds (bakes) into https://github.com/sohale/implisolid-build
# which is a submodule here
# 2. for separate (liquid) (runtime-created) folder (aka local! deploy) -> ./demos/demo1/
# 3. for mp5_private --> /home/$USER/mp5-private/implisolid
# Three alternatives: pre-buillt, and the new-built:
# simplified:
export DEPLOY_LOCATION=$NEW_REPO/docs/implisolid-build/demo1
#export DEPLOY_LOCATION2=$NEW_REPO/demos/demo1
#export DEPLOY_LOCATION="$ORIG_REPO_ROOT/newapp"
# was: export DEPLOY_LOCATION=$NEW_REPO/docs/implisolid-build
pwd
# must run the internal one!
CACHE_TEMP="$CACHE_TEMP" \
IMPLISOLID="$NEW_REPO" \
LIB_FOLDER="$IMPLISOLID/build/lib" BUILD_LOCATION="$IMPLISOLID/build" \
bash ./scripts/build-clonepull.sh
pwd
IMPLISOLID="$NEW_REPO" LIB_FOLDER="$IMPLISOLID/build/lib" \
BUILD_LOCATION="$IMPLISOLID/build" \
bash ./scripts/build-emscripten.sh
pwd
# # not the main one
#IMPLISOLID_REPO="$NEW_REPO" BUILD_LOCATION="$NEW_REPO/build" \
# DEPLOY_LOCATION="$DEPLOY_LOCATION2" \
# bash ./scripts/demos/demo1/demo1-deploy.sh
pwd
# the main one
IMPLISOLID_REPO="$NEW_REPO" BUILD_LOCATION="$NEW_REPO/build" \
DEPLOY_LOCATION="$DEPLOY_LOCATION" \
bash ./scripts/demos/demo1/demo1-deploy.sh
# also runs demos/launch-demo1-local.bash
pwd
APP_RUN_LOCATION="$DEPLOY_LOCATION" \
bash ./scripts/demos/demo1/launch-demo1-local.bash
echo "All successful."
return 0
<< ////
Scripts:
# based on how they can move: 1. e2e/overall 2.
e2e-test-builds.bash
// * is not for demo => not in ./demo
// also do: install-dev
// also a script foor docker? for test under linux
demo1-clonepull.sh
#use the configuration:
* is not for demo => not in ./demo
* demo1-build.sh // no! does not use the configuration of demo
* demo1-deploy.sh
* launch-demo1-local.bash ( demo1-run-local.sh )
* build_configuration.sh
* bash-utils.sh
# deprecated
* base-locations.sh
* macos-specific.bash
folders:
build
demo1
conceptual places (folders):
demo1 (where deploy is copied. no scripts.)
demo2 (potenially other demos1)
e2e
scripts
build (where build is located)
mainrepo
other repos?
how about examples?
build-binary-publish?
two others
python demo
npm
...
export BUILD_LOCATION=$IMPLISOLID_REPO/demos/build
ideal names:
$SCRIPTS_DIR/bash-utils.sh
////
<< ////
base-locations.sh:
# use with `source` only
echo "invalid"
export BASELOC1=
export BASELOC2=
export BASELOC3=
return
# export USER=a9858770
export USER_HOME=/Users/$USER
# Parameters
#export BASELOC1=$USER_HOME/cs/mp5
#export BASELOC2=$USER_HOME/cs/mp5
export BASELOC1=$USER_HOME/cs
export BASELOC2=$USER_HOME/cs
export BASELOC3=$USER_HOME/cs
# $BASELOC1 -> implisolid
# $BASELOC2 -> mp5-private
# $BASELOC3 -> sohale.github.io
# /Users/$USER/cs/mp5/implisolid
# mycomputer-specific
[[ $OSTYPE == 'darwin'* ]] || "Error: MacOS-specific code"
# Base locations for implisolic, mp5-private, sohale.github.io
# Other scrips use this as the seed parameters
////