"Publish Site" Build Step always fails with "Site publish is prohibited by current job executor" (OD-1343)
Closed
Alex H opened 1 year ago

I recently installed OneDev for a personal code vault and I am loving it and it's CI. However, I cannot get the "Publish Site" build step to work in any repo. It always fails with Site publish is prohibited by current job executor. I know that the "sites" feature of OneDev isn't well documented, but this error message is not documented at all. :(

I set up a test repository with only two files: index.html (with some arbitrary text) and onedev-buildspec.yml, both in ROOT, to attempt to publish a site. I have yet to have any pipeline with the "Publish Site" build step to succeed.

Here is the contents of onedev-buildspec.yml:

version: 21
jobs:
- name: Publish Site
  steps:
  - !CheckoutStep
    name: Checkout
    cloneCredential: !HttpCredential
      accessTokenSecret: access-token
    withLfs: false
    withSubmodules: false
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  - !PublishSiteStep
    name: Publish
    artifacts: index.html
    condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
  retryCondition: never
  maxRetries: 3
  retryDelay: 30
  timeout: 3600

And the resulting logs of the failed build:

15:38:09 No job executor defined, auto-discovering...
15:38:10 Discovered job executor type: Server Docker Executor
15:38:10 Pending resource allocation...
15:38:10 Executing job (executor: auto-discovered, server: 127.0.0.1:5710, network: auto-discovered-8-8-0)...
15:38:10 Setting up job cache...
15:38:10 Copying job dependencies...
15:38:10 Running step "Checkout"...
15:38:10 Checking out code...
15:38:10 Switched to branch 'main'
15:38:10 Branch 'main' set up to track remote branch 'main' from 'origin'.
15:38:10 Step "Checkout" is successful (0 seconds)
15:38:10 Running step "Publish"...
15:38:10 Step "Publish" is failed: (0 seconds) Site publish is prohibited by current job executor

I am running OneDev 8.1.1 in a Docker container (no swarm) on Ubuntu. I am using the embedded database and I do not have any connected agents.

Any pointers would be appreciated! Please let me know if I need to provide any more information. Thank you!

Robin Shen commented 1 year ago

By default site publishing is disabled to prevent XSS attach on untrusted CI jobs. To enable it, define an executor in menu `Administration / Job Executors' and tick the publish site feature. Then configure your job to use that job executor.

Alex H commented 1 year ago

This worked flawlessly. Definitely something worth putting in the Docs for this feature when that gets written. 😉

Thanks so much and sorry for the trouble!

Alex H changed state to 'Closed' 1 year ago
Previous Value Current Value
Open
Closed
issue 1 of 1
Type
Question
Priority
Normal
Assignee
Issue Votes (0)
Watchers (4)
Reference
OD-1343
Please wait...
Page is in error, reload to recover