2
2
3
3
# get the dir containing the script
4
4
script_dir=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
5
+ repository_root=" $script_dir /../../../."
5
6
# create a temporary working directory
6
7
working_dir=$( mktemp -d " ${TMPDIR:-/ tmp/ } openmrs-e2e-frontends.XXXXXXXXXX" )
8
+ echo $working_dir
7
9
# get a list of all the apps in this workspace
8
10
apps=$( yarn workspaces list --json | jq -r ' if .location | test("-app$") then .name else empty end' )
9
11
# this array will hold all of the packed app names
20
22
# run yarn pack for our app and add it to the working directory
21
23
yarn workspace " $app " pack -o " $working_dir /$app_name .tgz" > /dev/null;
22
24
done ;
23
- echo " Created packed app archives"
25
+ echo " Created packed app archives"
24
26
25
27
echo " Creating dynamic spa-assemble-config.json..."
26
28
# dynamically assemble our list of frontend modules, prepending the
@@ -38,8 +40,21 @@ jq -n \
38
40
)' | jq ' {"frontendModules": .}' > " $working_dir /spa-assemble-config.json"
39
41
echo " Created dynamic spa-assemble-config.json"
40
42
43
+ echo " Copying tooling, shell and framework..."
44
+ mkdir -p " $working_dir /packages"
45
+ mkdir -p " $working_dir /packages/tooling"
46
+
47
+ cp -r " $repository_root /.yarn" " $working_dir /.yarn"
48
+ cp -r " $repository_root /.yarnrc.yml" " $working_dir /.yarnrc.yml"
49
+ cp -r " $repository_root /packages/tooling" " $working_dir /packages"
50
+ cp -r " $repository_root /packages/shell" " $working_dir /packages"
51
+ cp -r " $repository_root /packages/framework" " $working_dir /packages"
52
+ cp " $repository_root /package.json" " $working_dir /package.json"
53
+ cp " $repository_root /yarn.lock" " $working_dir /yarn.lock"
54
+
41
55
echo " Copying Docker configuration..."
42
56
cp " $script_dir /Dockerfile" " $working_dir /Dockerfile"
57
+ cp " $script_dir /.dockerignore" " $working_dir /.dockerignore"
43
58
cp " $script_dir /docker-compose.yml" " $working_dir /docker-compose.yml"
44
59
45
60
cd $working_dir
0 commit comments