Skip to content

Commit 89edf99

Browse files
committed
Fix CI
1 parent e99d02a commit 89edf99

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ RUN yarn build --mode ${BUILD_MODE}
88

99
FROM nginx:1.21
1010
ADD ./default.conf /etc/nginx/conf.d/default.conf
11+
ADD ./docker_entrypoint.sh /docker_entrypoint.sh
1112
COPY --from=build /app/dist /usr/share/nginx/html
12-
RUN export APPJS_NAME=$(cd /usr/share/nginx/html && ls js/app.*.js) \
13-
&& sed -i 's|APPJS_NAME|'${APPJS_NAME}'|g' /etc/nginx/conf.d/default.conf
13+
RUN chmod +x /docker_entrypoint.sh && /docker_entrypoint.sh

default.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ server {
99
try_files $uri /index.html;
1010
}
1111

12-
location /js/app.js {
13-
return 302 https://$host/APPJS_NAME;
14-
}
12+
# location /js/app.js {
13+
# return 302 https://$host/APPJS_NAME;
14+
# }
1515

1616
error_page 500 502 503 504 /50x.html;
1717
location = /50x.html {
1818
root /usr/share/nginx/html;
1919
}
20-
}
20+
}

docker_entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
export APPJS_NAME=$(cd /usr/share/nginx/html && ls js/app.*.js)
4+
if [ ! -z ${APPJS_NAME} ]
5+
then
6+
echo 'app.js is ${APPJS_NAME}'
7+
sed -i 's|APPJS_NAME|'${APPJS_NAME}'|g' /etc/nginx/conf.d/default.conf
8+
sed -i 's|# ||g' /etc/nginx/conf.d/default.conf
9+
else
10+
echo 'app.js is app.js, no changes'
11+
fi

0 commit comments

Comments
 (0)