Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM alpine:latest

# 配置清华 alpine 源
RUN cp /etc/apk/repositories /etc/apk/repositories.bak && \
sed -i 's|dl-cdn.alpinelinux.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apk/repositories && \
apk update

# 安装必要的工具和依赖
RUN apk add --no-cache \
bash \
libstdc++ \
curl \
git && \
# 清理缓存
rm -rf /var/cache/apk/*


# 复制翻译脚本到镜像中
ADD deepin-auto-translation /app/deepin-auto-translation

# 安装bun
# 这里使用 curl 下载并执行安装脚本
RUN curl -fsSL https://bun.sh/install | bash
ENV BUN_INSTALL="~/.bun" \
PATH="$BUN_INSTALL/bin:$PATH"

# 安装transifex
# 这里使用 curl 下载并执行安装脚本
RUN curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash && mv /tx /usr/local/bin/tx

# 安装脚本运行依赖
RUN cd /app/deepin-auto-translation && BUN_INSTALL="~/.bun" ~/.bun/bin/bun install

# 复制入口点脚本到镜像中
COPY entrypoint /app/entrypoint

RUN chmod +x /app/entrypoint

# 设置入口点
#ENTRYPOINT ["bash", "/app/entrypoint"]
Submodule deepin-auto-translation added at 8b158b
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# 设置翻译仓库路径配置
mkdir -p /app/deepin-auto-translation/repo/${REPO_OWNER}/
ln -s $(pwd) /app/deepin-auto-translation/repo/${REPO_OWNER}/${REPO_NAME}


# 设置git配置
git config --global user.name "deepin-ci-robot"
git config --global user.email "packages@deepin.org"
git -C /app/deepin-auto-translation pull || true

# 设置transifix配置
echo "- o:${REPO_OWNER}:p:${REPO_NAME}" > /app/deepin-auto-translation/transifex-projects.yml

# 启动翻译脚本
cd /app/deepin-auto-translation && BUN_INSTALL="~/.bun" ~/.bun/bin/bun index.ts
68 changes: 68 additions & 0 deletions services/prow/config/jobs/submits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,67 @@ desktop-translator: &desktop-translator
testgrid-alert-email: hudeng@deepin.org
description: Runs Prow desktop-translator job for translating ts files to desktop files.

deepin-auto-translation: &deepin-auto-translation
name: deepin-auto-translation
decorate: true
decoration_config:
timeout: 240m
always_run: true
run_if_changed: ".ts$"
labels:
app: deepin-auto-translation
spec:
nodeSelector:
kubernetes.io/arch: amd64
hostAliases:
- ip: 10.20.64.81
hostnames:
- github.com
- ip: 10.20.64.82
hostnames:
- api.github.com
- ip: 10.20.64.83
hostnames:
- github.githubassets.com
- ip: 10.20.64.84
hostnames:
- raw.githubusercontent.com
- ip: 10.20.64.85
hostnames:
- collector.github.com
- ip: 10.20.64.86
hostnames:
- avatars.githubusercontent.com
containers:
- name: deepin-auto-translation
image: "hub.deepin.com/prow/deepin-auto-translation:latest"
command:
- /app/entrypoint
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: obs-api-credential
key: github-token
volumeMounts:
- name: config
mountPath: /app/deepin-auto-translation/secrets.ts
subPath: secrets.ts
readOnly: true
- name: config
mountPath: /root/.transifexrc
subPath: transifexrc
readOnly: true
volumes:
- name: config
configMap:
name: deepin-auto-translation-cfg
annotations:
testgrid-dashboards: sig-deepin-cicd
testgrid-tab-name: deepin-auto-translation
testgrid-alert-email: hudeng@deepin.org
description: Runs Prow deepin-auto-translation job to translate ts files by using llm ai models.

github-pr-review-ci: &github-pr-review-ci
name: github-pr-review-ci
decorate: false
Expand Down Expand Up @@ -857,6 +918,8 @@ static-check: &static-check
Runs Prow static-check to config , and add comment.

presubmits:
peeweep-test/AITest:
- <<: *deepin-auto-translation
peeweep-test:
- <<: *github-trigger-obs-ci
- <<: *github-pr-review-ci
Expand All @@ -875,17 +938,22 @@ presubmits:
linuxdeepin/deepin-osconfig:
- <<: *github-trigger-obs-ci
- <<: *github-pr-review-ci
- <<: *deepin-auto-translation
linuxdeepin/linglong:
- <<: *github-trigger-obs-ci
- <<: *github-pr-review-ci
- <<: *deepin-auto-translation
linuxdeepin/dde-shell:
- <<: *github-trigger-obs-ci
- <<: *github-pr-review-ci
- <<: *deepin-auto-translation
linuxdeepin/dde-tray-loader:
- <<: *github-trigger-obs-ci
- <<: *github-pr-review-ci
- <<: *deepin-auto-translation
linuxdeepin:
- <<: *github-pr-review-ci
- <<: *deepin-auto-translation
linuxdeepin/treeland.private:
- <<: *github-trigger-obs-ci
deepin-community/GHC_packages:
Expand Down
Loading