Build the Docker image

Since only Windows and macOS tools are officially available, we found a third-party executable tool for Linux, cytle/wechat_web_devtools❤️❤️❤️.

Dockerfile

FROM registry.hub.docker.com/canyoutle/wxdt:latest

# You may need to override the node version, which comes with 8.x
RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
RUN sudo apt-get install -y nodejs
RUN rm /wxdt/bin/node
RUN ln -s /usr/bin/nodejs /wxdt/bin/node

Install YARN if required
# RUN npm install yarn -g

# If you use taro, you can build in @tarojs/cli
# RUN yarn add global @tarojs/cli

Copy the code

Build to upload

docker build -t wechat-dev-tools -f ./Dockerfile .
docker tag wechat-dev-tools your-registry-of-docker.com:you-remote-image-name
docker push  your-registry-of-docker.com:you-remote-image-name
Copy the code

gitlab-ci

Each time, you need to scan the code for login and upload the code. For other CLI commands, refer to the cli tool of wechat

cli -l --login-qr-output

cli -u your-version@/your/project/location
Copy the code

Some core CI.yaml

images: your-registry-of-docker.com:you-remote-image-name

.

deploy:
  .
  script:
    - .
    - cli -l --login-qr-output
    - cli -u your-version@/your/project/location
Copy the code