Commit 7bed171a by zhangxingmin

push

parent 2bc31c5f
...@@ -47,19 +47,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ...@@ -47,19 +47,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs apt-get install -y nodejs
# 安装 HBuilderX
ARG HBUILDER_VERSION=3.8.12
RUN wget -O HBuilderX.tar.gz https://download1.dcloud.net.cn/download/HBuilderX.${HBUILDER_VERSION}.linux-x64.tar.gz && \
tar -xzf HBuilderX.tar.gz -C /opt && \
rm HBuilderX.tar.gz && \
chmod 755 /opt/HBuilderX/cli && \
chmod 755 /opt/HBuilderX/HBuilderX
# 设置工作目录 # 设置工作目录
WORKDIR /app WORKDIR /app
# 复制项目文件 # 复制项目文件
#COPY jenkins . COPY . .
# 配置 npm 镜像源 # 配置 npm 镜像源
RUN npm config set registry https://registry.npmmirror.com && \ RUN npm config set registry https://registry.npmmirror.com && \
...@@ -69,8 +61,21 @@ RUN npm config set registry https://registry.npmmirror.com && \ ...@@ -69,8 +61,21 @@ RUN npm config set registry https://registry.npmmirror.com && \
# 安装项目依赖 # 安装项目依赖
RUN npm install --no-audit RUN npm install --no-audit
# 登录 HBuilderX (注意:实际使用时请使用更安全的方式管理凭证) # 从宿主机复制已安装的 HBuilderX
RUN /opt/HBuilderX/cli user login --username 15026705202 --password Wo7320017 COPY --from=host /var/jenkins_home/HBuilderX /opt/HBuilderX
# 修复 HBuilderX 权限
RUN chmod 755 /opt/HBuilderX/cli && \
chmod 755 /opt/HBuilderX/HBuilderX && \
find /opt/HBuilderX -name "lib*.so*" -exec chmod 755 {} \;
# 设置 Qt 库路径
ENV LD_LIBRARY_PATH=/opt/HBuilderX:$LD_LIBRARY_PATH
# 登录 HBuilderX
ARG HB_USERNAME
ARG HB_PASSWORD
RUN /opt/HBuilderX/cli user login --username "$HB_USERNAME" --password "$HB_PASSWORD"
# 构建项目 # 构建项目
RUN /opt/HBuilderX/cli publish --platform h5 --project . --output dist RUN /opt/HBuilderX/cli publish --platform h5 --project . --output dist
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment