Skip to content

Commit

Permalink
fix(miniprogram-ci): minidev install
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Oct 12, 2023
1 parent 2c9e894 commit 98820ee
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 37 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/arch.push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,28 @@ jobs:
push: true

- name: Build and push arch 4
uses: docker/build-push-action@v4
with:
file: conf/arch.dockerfile
target: mp-alipay-ci
tags: ${{ env.REG_HOST }}/node-lts:mp-alipay-ci
platforms: linux/amd64
push: true

- name: Build and push arch 5
uses: docker/build-push-action@v4
with:
file: conf/arch.dockerfile
target: mp-wechat-ci
tags: ${{ env.REG_HOST }}/node-lts:mp-wechat-ci
platforms: ${{ env.platforms }}
push: true

- name: Build and push arch 6
uses: docker/build-push-action@v4
with:
file: conf/arch.dockerfile
target: miniprogram-ci
tags: ${{ env.REG_HOST }}/node-lts:miniprogram-ci
platforms: ${{ env.platforms }}
platforms: linux/amd64
push: true
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,32 @@ docker pull airkro/node-lts

### Size of node:tag

| Size | Tag |
| ----------------: | ---------- |
| ![alpine][alpine] | lts-alpine |
| ![slim][slim] | lts-slim |
| ![lts][lts] | lts |
| Size | Tag |
| ----------------: | --------------- |
| ![alpine][alpine] | node:lts-alpine |
| ![slim][slim] | node:lts-slim |
| ![lts][lts] | node:lts |

[alpine]: https://img.shields.io/docker/image-size/_/node/lts-alpine?label=&style=flat-square
[slim]: https://img.shields.io/docker/image-size/_/node/lts-slim?label=&style=flat-square
[lts]: https://img.shields.io/docker/image-size/_/node/lts?label=&style=flat-square

### Size of airkro/node-lts:tag

| Size | Tag | Features |
| ------------------: | :------ | :------------------------------------------- |
| ![latest][latest] | latest | git / zip |
| ![ssh][ssh] | ssh | git / zip / ssh |
| ![python3][python3] | python3 | git / zip / ssh / python3 |
| ![browser][browser] | browser | git / zip / ssh / playwright / Noto Sans ... |
| Size | Tag | Features |
| ----------------------------: | :----------- | :--------------------------------------------- |
| ![latest][latest] | latest | git / zip / docker-cli |
| ![ssh][ssh] | ssh | tag:latest / ssh |
| ![python3][python3] | python3 | tag:ssh / python3 |
| ![mp-wechat-ci][mp-wechat-ci] | mp-wechat-ci | tag:latest / npm:miniprogram-ci |
| ![mp-alipay-ci][mp-alipay-ci] | mp-alipay-ci | tag:python3 / npm:minidev |
| ![mp-ci][mp-ci] | mp-ci | tag:python3 / npm:miniprogram-ci / npm:minidev |
| ![browser][browser] | browser | git / zip / ssh / playwright / Noto Sans ... |

[latest]: https://flat.badgen.net/docker/size/airkro/node-lts/latest?label=
[ssh]: https://flat.badgen.net/docker/size/airkro/node-lts/ssh?label=
[python3]: https://flat.badgen.net/docker/size/airkro/node-lts/python3?label=
[browser]: https://flat.badgen.net/docker/size/airkro/node-lts/browser?label=
[mp-wechat-ci]: https://flat.badgen.net/docker/size/airkro/node-lts/mp-wechat-ci?label=
[mp-alipay-ci]: https://flat.badgen.net/docker/size/airkro/node-lts/mp-alipay-ci?label=
[mp-ci]: https://flat.badgen.net/docker/size/airkro/node-lts/mp-ci?label=
12 changes: 10 additions & 2 deletions conf/arch.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@ RUN apk --no-cache --update add openssh
FROM latest as python3
RUN apk --no-cache --update add python3 py3-pip

FROM latest as miniprogram-ci
RUN npm i -g miniprogram-ci minidev && rm -rf /root/.npm/_cacache && npm cache clean --force
FROM latest as mp-wechat-ci
RUN npm i -g miniprogram-ci && rm -rf /root/.npm/_cacache && npm cache clean --force

FROM python3 as mp-alipay-ci
RUN apk --no-cache --update add make
RUN npm i -g minidev && rm -rf /root/.npm/_cacache && npm cache clean --force

FROM python3 as mp-ci
RUN apk --no-cache --update add make
RUN npm i -g minidev miniprogram-ci && rm -rf /root/.npm/_cacache && npm cache clean --force
19 changes: 8 additions & 11 deletions conf/ci.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1.5

FROM openjdk:11 as jdk11
FROM openjdk:11 as qci_worker

RUN <<EOL
apt-get update
Expand All @@ -12,28 +12,25 @@ apt-get autoremove
rm -rf /var/lib/apt/lists/*
EOL

RUN corepack enable && corepack prepare --activate --all
RUN mkdir -p /root/codingci/tools

FROM jdk11 as jenkins

RUN mkdir -p /root/jenkins/tools

WORKDIR /root/jenkins/tools
WORKDIR /root/codingci/tools

RUN <<EOL
curl -fL -o jenkins.war https://public-files.coding.net/public-files/coding-ci/jenkins.war?version=2.293-cci
curl -fL -o jenkins.war https://public-files.coding.net/public-files/coding-ci/jenkins.war?version=2.293-cci-v2.4
chmod +x jenkins.war
curl -fL -o jenkinsHome.zip https://coding-public-generic.pkg.coding.net/cci/release/jenkinsHome.zip?version=latest
unzip jenkinsHome.zip
unzip -o jenkinsHome.zip
rm jenkinsHome.zip
EOL

FROM jenkins as qci_worker

RUN <<EOL
pip3 install qci_worker -i https://coding-public-pypi.pkg.coding.net/cci/worker/simple
qci_worker version

qci_worker config JENKINS_HOST=0.0.0.0
qci_worker config JENKINS_PORT=15740
qci_worker config JENKINS_ENCODING='UTF-8'
EOL

EXPOSE 15740
4 changes: 2 additions & 2 deletions conf/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FROM airkro/ci:qci_worker as codingci
ARG CODING_TOKEN
ARG CODING_TEAM

RUN qci_worker cci_reg --home /root/jenkins --token $CODING_TOKEN --server wss://$CODING_TEAM.coding.net
RUN qci_worker cci_reg --token $CODING_TOKEN --server wss://$CODING_TEAM.coding.net

CMD ["qci_worker", "up", "-d"]
ENTRYPOINT ["qci_worker", "up"]
```
3 changes: 0 additions & 3 deletions conf/playwright.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ rm noto-sans.txt
fc-cache -f -v

EOF

FROM browser as heavy
RUN npm i -g @sentry/webpack-plugin && npm cache clean --force
7 changes: 0 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
version: "3.8"

services:
heavy:
image: ${REG_HOST}/node-lts:heavy
build:
dockerfile: conf/playwright.dockerfile
context: .
target: heavy

browser:
image: ${REG_HOST}/node-lts:browser
build:
Expand Down

0 comments on commit 98820ee

Please sign in to comment.