0

实际上我正在使用 travis,但我想换成无人机。

对于所有 tex 文档,我使用带有容器的小型 Makefile 来生成我的 pdf 文件并将其部署到我的存储库中。

但是由于我使用的是 gitea,所以我想用无人机设置我的集成管道,但我不知道如何配置.drone.yml以在每个标签 als 版本上部署我的 pdf 文件。

实际上我正在使用以下内容.drone.yml,我很高兴地说,目前构建过程运行良好。

clone:
  git:
    image: plugins/git
    tags: true

pipeline:
  pdf:
    image: volkerraschek/docker-latex:latest
    pull: true
    commands:
    - make

这是我的Makefile

# Docker Image
IMAGE := volkerraschek/docker-latex:latest

# Input tex-file and output pdf-file
FILE := index
TEX_NAME := ${FILE}.tex
PDF_NAME := ${FILE}.pdf

latexmk:
    latexmk \
        -shell-escape \
        -synctex=1 \
        -interaction=nonstopmode \
        -file-line-error \
        -pdf ${TEX_NAME}

docker-latexmk:
    docker run \
        --rm \
        --user="$(shell id -u):$(shell id -g)" \
        --net="none" \
        --volume="${PWD}:/data" ${IMAGE} \
        make latexmk

当我推送一个新的 git 标签时,我的drone.yml 中缺少哪些标签和条件来部署我的 index.pdf 作为 gitea 中的发布?

沃尔克

4

2 回答 2

1

我在我的 gitea / 无人机对上有这个设置。这是我的 MWE .drone.yml

pipeline:
  build:
    image: tianon/latex
    commands:
      - pdflatex <filename.tex>
  gitea_release:
    image: plugins/gitea-release
    base_url: <gitea domain>
    secrets: [gitea_token]
    files: <filename.pdf>
    when:
      event: tag

因此,我们没有在 中设置 docker 构建Makefile,而是添加了一个使用 docker image 和 latex 的步骤,编译 pdf,并使用管道步骤来发布。

您还必须设置您的无人机存储库以触发标签上的构建并设置要使用的 gitea API 令牌。要设置 API 令牌,您可以使用命令行界面:

$ drone secret add <org/repo> --name gitea_token --value <token value> --image plugins/gitea-release

您可以设置无人机存储库以在 Web UI 的存储库设置中触发构建。

请注意,您可能还必须*.pdf在 gitea 设置中允许附件,因为默认情况下它们是不允许的。在您的 gitea 中将其app.ini添加到附件部分:

[attachment]
ENABLED = true
PATH = /data/gitea/attachments
MAX_SIZE = 10
ALLOWED_TYPES = */*
于 2018-10-06T11:02:19.593 回答
0

除了 Gabe 的回答,如果您使用的是 NGINX 反向代理,您可能还必须允许在 nginx.conf 中上传更大的文件。(这适用于所有文件类型,而不仅仅是 .pdf)

server {

  [ ... ]

  location / {
    client_max_body_size 10M;      # add this line
    proxy_pass http://gitea:3000;
  }

}

这解决了我的问题。

于 2020-03-13T10:02:30.923 回答