Status: Open (View Workflow)
Gitea plugin: 1.2.1
Gitea server: try.gitea.io (version 1.15.0+dev-114-g63411309f)
Git version: 2.7.4 / 2.29.2
OS: Windows 10 / Ubuntu 16.04
JDK: 8 (OpenJDK) / 11 (AdoptOpenJDK)
After server restart, git checkout from gitea using an API key fails. If the used project type is a 'multibranch pipeline' or derived from that, it is possible to manually scan the repo, after which it will work until the next server restart.
Steps to reproduce:
1) Setup an account at try.gitea.io. Create a repo for testing and add a Jenkinsfile (https://www.jenkins.io/doc/book/pipeline/jenkinsfile/). Make sure the repo is set to private.
2) Get an API key for your account (Settings > Applications, input a token name and click generate. Make sure to copy the token, as it will not be displayed again.)
3) Setup your Jenkins with the Gitea plugin.
4) Add https://try.gitea.io/ as 'Gitea server' under 'Configure'.
5) Select 'New element', enter a name for it and create a new multibranch pipeline
6) Under 'branch sources', select gitea. Select try.gitea.io as server (if its not pre-selected).
7) Add your previously generated token as credentials (Gitea personal access token). In the owner field add your username on try.gitea.org and your repository name.
8) Click 'Save'. Jenkins should now scan you repo.
9) Click 'status' and select the master branch. Select 'Build now'. If your repo contains a Jenkinsfile, Jenkins should build that.
10) After the build is completed, restart Jenkins.
11) Once the server is up again, start a new build. It should fail with
12) Select 'Up' and click 'Scan multipranch pipeline now'
13) Navigate back to master and start a new build. It should succeed again.
The issue started appearing some weeks ago after an upgrade. Not sure which version though, probably 2.284 or 2.285. I don´t know which version i had before, so might have started a bit earlier.