未验证 提交 67646f79 编写于 作者: P Peter Pan 提交者: GitHub

build: stablize build process (#588)

上级 6a8d29f0
from node:12
from node:12-alpine
# Create app directory
WORKDIR /usr/src/app
......@@ -17,4 +17,4 @@ COPY public public
COPY ecosystem.config.js ecosystem.config.js
EXPOSE 8999
CMD ["yarn", "start"]
ENTRYPOINT ["yarn", "start"]
......@@ -15,7 +15,21 @@ build_frontend_from_source() {
build_frontend() {
local PACKAGE_NAME="visualdl"
echo "Donwloading npm package, please wait..."
local PACKAGE=`(cd $BUILD_DIR && npm pack ${PACKAGE_NAME}@latest)`
local SHA1SUM=`npm view ${PACKAGE_NAME}@latest dist.shasum`
if [ "$?" -ne "0" ]; then
echo "Cannot get sha1sum"
exit 1
fi
echo "${SHA1SUM} ${PACKAGE}" > "$BUILD_DIR/${PACKAGE}.sha1"
(cd $BUILD_DIR && sha1sum -c "${PACKAGE}.sha1")
if [ "$?" -ne "0" ]; then
echo "Check sum failed, download may not finish correctly."
exit 1
else
echo "Check sum pass."
fi
tar zxf "$BUILD_DIR/$PACKAGE" -C "$BUILD_DIR"
}
......@@ -48,6 +62,7 @@ clean_env() {
rm -rf $BUILD_DIR/temp*
rm -rf $BUILD_DIR/scripts*
rm -rf $BUILD_DIR/*.tgz
rm -rf $BUILD_DIR/*.sha1
rm -rf $BUILD_DIR/package
}
......
......@@ -109,6 +109,7 @@ scripts = ['visualdl/server/visualdl', 'demo/vdl_create_scratch_log']
if platform == 'win32':
scripts.append('visualdl/server/visualDL.bat')
def frontend_package_files(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
......@@ -116,6 +117,7 @@ def frontend_package_files(directory):
paths.append(os.path.join(path, filename))
return paths
setup(
name="visualdl",
version=VERSION_NUMBER,
......@@ -126,12 +128,9 @@ setup(
long_description=read('README.md'),
install_requires=install_requires,
package_data={
'visualdl.server':
[s[len('visualdl/server/'):] for s in frontend_package_files('visualdl/server/dist')],
'visualdl':
libraries,
'visualdl.python':
libraries + ['dog.jpg', 'testing.wav']
'visualdl': libraries,
'visualdl.server': [s[len('visualdl/server/'):] for s in frontend_package_files('visualdl/server/dist')],
'visualdl.python': libraries + ['dog.jpg', 'testing.wav']
},
packages=packages,
ext_modules=[Extension('_foo', ['stub.cc'])],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册