0

actually I am using travis but I want to change to drone.

For all tex documents I'm using a small Makefile with a Container to generate my pdf file and deploy it on my repository.

But since I'm using gitea I want to set up my integration pipeline with drone, but I don't know how I can configure the .drone.yml to deploy my pdf file on every tag als release.

Actually I'm using the following .drone.yml and I am happy the say, that's build process works fine at the moment.

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

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

and this is my 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

Which tags and conditions are missing in my drone.yml to deploy my index.pdf as release in gitea when I push a new git tag?

Volker

Volker Raschek
  • 545
  • 1
  • 6
  • 21

2 Answers2

1

I have this setup on my gitea / drone pair. This is a MWE of my .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

So rather than setting up the docker build in the Makefile, we add a step using docker image with latex, compile the pdf, and use a pipeline step to release.

You'll also have to set your drone repo to trigger builds on a tags and set a gitea API token to use. To set the API token, you can use the command line interface:

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

You can set up the drone repo to trigger builds in the repository settings in the web UI.

Note that you'll also likely have to allow *.pdf attachments in your gitea settings, as they are disallowed by default. In your gitea app.ini add this to the attachment section:

[attachment]
ENABLED = true
PATH = /data/gitea/attachments
MAX_SIZE = 10
ALLOWED_TYPES = */*
0

In addition to Gabe's answer, if you are using an NGINX reverse proxy, you might also have to allow larger file uploads in your nginx.conf. (This applies to all file types, not just .pdf)

server {

  [ ... ]

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

}

This fixed the problem for me.

Jannis K
  • 13
  • 3