Skip to content

Commit 4c8a7a8

Browse files
Use local shell to assemble and build E2E environment
1 parent 0120ab0 commit 4c8a7a8

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

e2e/support/github/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# .dockerignore
2+
node_modules

e2e/support/github/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ WORKDIR /app
88

99
COPY . .
1010

11-
RUN npm_config_legacy_peer_deps=true npm install -g openmrs@${APP_SHELL_VERSION:-next}
1211
ARG CACHE_BUST
13-
RUN npm_config_legacy_peer_deps=true openmrs assemble --manifest --mode config --config spa-assemble-config.json --target ./spa
12+
13+
RUN yarn install
14+
RUN npm_config_legacy_peer_deps=true node packages/tooling/openmrs/dist/cli.js assemble --manifest --mode config --config spa-assemble-config.json --target ./spa
15+
RUN npm_config_legacy_peer_deps=true node packages/tooling/openmrs/dist/cli.js build --target ./spa
16+
1417

1518
FROM --platform=$BUILDPLATFORM openmrs/openmrs-reference-application-3-frontend:nightly as frontend
1619
FROM nginx:1.23-alpine

e2e/support/github/run-e2e-docker-env.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
# get the dir containing the script
44
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5+
repository_root="$script_dir/../../../."
56
# create a temporary working directory
67
working_dir=$(mktemp -d "${TMPDIR:-/tmp/}openmrs-e2e-frontends.XXXXXXXXXX")
8+
echo $working_dir
79
# get a list of all the apps in this workspace
810
apps=$(yarn workspaces list --json | jq -r 'if .location | test("-app$") then .name else empty end')
911
# this array will hold all of the packed app names
@@ -20,7 +22,7 @@ do
2022
# run yarn pack for our app and add it to the working directory
2123
yarn workspace "$app" pack -o "$working_dir/$app_name.tgz" >/dev/null;
2224
done;
23-
echo "Created packed app archives"
25+
echo "Created packed app archives"
2426

2527
echo "Creating dynamic spa-assemble-config.json..."
2628
# dynamically assemble our list of frontend modules, prepending the
@@ -38,8 +40,21 @@ jq -n \
3840
)' | jq '{"frontendModules": .}' > "$working_dir/spa-assemble-config.json"
3941
echo "Created dynamic spa-assemble-config.json"
4042

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+
4155
echo "Copying Docker configuration..."
4256
cp "$script_dir/Dockerfile" "$working_dir/Dockerfile"
57+
cp "$script_dir/.dockerignore" "$working_dir/.dockerignore"
4358
cp "$script_dir/docker-compose.yml" "$working_dir/docker-compose.yml"
4459

4560
cd $working_dir

0 commit comments

Comments
 (0)