feat: build with docker

This commit is contained in:
msojocs 2024-08-10 13:37:19 +08:00
parent 3d941dbe23
commit 34c27f5d34
6 changed files with 10 additions and 50 deletions

View File

@ -9,7 +9,7 @@ on:
push: push:
tags: tags:
- v* - v*
branches: [ master, dev, 45-snap-version] branches: [ master, dev, ci]
pull_request: pull_request:
branches: [ master ] branches: [ master ]
# # Allows you to run this workflow manually from the Actions tab # # Allows you to run this workflow manually from the Actions tab
@ -53,11 +53,9 @@ jobs:
- name: Build - name: Build
run: | run: |
export ACTION_MODE=true export ACTION_MODE=true
export DOCKER_UID=$UID
export DOCKER_GID=$GID
ls -l ls -l
export WINE=false export WINE=false
docker compose up tools/build-with-docker.sh
- name: Compress Resources - name: Compress Resources
run: | run: |

View File

@ -1,19 +0,0 @@
version: "3"
services:
wechat_devtools:
image: jiyecafe/wechat-devtools-build:v3
# build:
# context: ./docker
# dockerfile: Dockerfile
volumes:
- .:/workspace
- ./cache/.npm:/root/.npm
environment:
- ACTION_MODE=${ACTION_MODE:-false}
# - https_proxy=${https_proxy:-}
- WINE=${WINE:-false}
- LOCAL_USER_ID=${DOCKER_UID:-1000}
- LOCAL_GROUP_ID=${DOCKER_GID:-1000}
- BUILD_VERSION=${BUILD_VERSION:-v0}
entrypoint: /workspace/docker/docker-entrypoint
userns_mode: "host"

View File

@ -1,26 +0,0 @@
#!/bin/bash
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBC
strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_2.2
notice() {
echo -e "\033[36m $1 \033[0m "
}
rm -rf /tmp/vscode-ripgrep-cache-1.13.2/ripgrep-v13.0.0-4-x86_64-unknown-linux-musl.tar.gz
if [ "$(id -u)" -eq '0' ];then
USER_ID=${LOCAL_USER_ID:-1000}
GROUP_ID=${LOCAL_GROUP_ID:-1000}
notice "$USER_ID, $GROUP_ID"
usermod -u ${USER_ID} -g ${GROUP_ID} user > /dev/null 2>&1
chown -R ${USER_ID}:${GROUP_ID} /workspace > /dev/null 2>&1
# ls -l
# cat /etc/passwd
exec gosu user docker/entrypoint
fi
echo "nothing"
# exec /usr/local/bin/gosu user entrypoint

View File

@ -24,6 +24,8 @@ python --version
echo "docker node version: $( node --version )" echo "docker node version: $( node --version )"
cd /workspace cd /workspace
export HOME="/tmp/home"
mkdir -p /tmp/home
# #
# exec ./tools/rebuild-node-modules 0.53.1 # exec ./tools/rebuild-node-modules 0.53.1
./tools/setup-wechat-devtools-bash ./tools/setup-wechat-devtools-bash

6
tools/build-with-docker.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
root_dir=$(cd `dirname $0`/.. && pwd -P)
echo "$(id -u):$(id -g)"
docker run -u "$(id -u):$(id -g)" --rm -i -e "ACTION_MODE=${ACTION_MODE:-false}" -w /workspace -v "$root_dir:/workspace" jiyecafe/wechat-devtools-build:v3 \
bash ./docker/entrypoint

View File

@ -72,7 +72,6 @@ if [ $CURRENT_STEP == $INSTALL_NODE_SUCCESS ];then
npm config set phantomjs_cdnurl http://npmmirror.com/mirrors/phantomjs # phantomjs 二进制包镜像 npm config set phantomjs_cdnurl http://npmmirror.com/mirrors/phantomjs # phantomjs 二进制包镜像
npm config set selenium_cdnurl http://npmmirror.com/mirrors/selenium # selenium 二进制包镜像 npm config set selenium_cdnurl http://npmmirror.com/mirrors/selenium # selenium 二进制包镜像
npm config set node_inspector_cdnurl http://npmmirror.com/mirrors/node-inspector # node-inspector 二进制包镜像 npm config set node_inspector_cdnurl http://npmmirror.com/mirrors/node-inspector # node-inspector 二进制包镜像
# npm cache clean --force # 清空缓存
fi fi
step_switch $INSTALL_NPM_CONFIG_SUCCESS step_switch $INSTALL_NPM_CONFIG_SUCCESS
fi fi