"Publish Site" Successfully, But Site file not found: index.html #2775
RainOnTheRoof opened 1 month ago

Hello Robin,

Hope everything goes well.

We have created a repository and successfully published a site by "Publish Site" build step, however the site could not find index page which dose exist in repository (in root). Success.png notfound.png

Can you help us in solving this problem?

  • Robin Shen commented 1 month ago

    OneDev site expects index.html to be directly under /path/to/onedev/site/projects/2/site. If it is inside a sub directory, please change from directory property of publish site step to be the sub directory name.

  • RainOnTheRoof commented 1 month ago

    OneDev site expects index.html to be directly under /path/to/onedev/site/projects/2/site. If it is inside a sub directory, please change from directory property of publish site step to be the sub directory name.

    I set up a test repository with index.html and onedev-buildspec.yml both in ROOT.

    image_2.png

    Here the contents of onedev-buildspec.yml:

    jobs:
    - name: Publish Site
      steps:
      - !PublishSiteStep
        name: Publish
        artifacts: index.html
        condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
      retryCondition: never
      maxRetries: 3
      retryDelay: 30
      timeout: 3600
    

    "Publish Site" build step is Successful, but still Site file not found. I wonder if there is anything we got wrong or missed.

    Please let me know if any more information is needed. Thank you!

  • Robin Shen commented 1 month ago

    Please add a checkout step before publish site step.

  • xjarea commented 1 month ago

    The site has been successfully built, but the CSS and JS files in the index.html file cannot be accessed. The browser's devtool outputs Uncaught SyntaxError: Unexpected identifier 'file'. The files can be found in the repository, and they are exist, but why index.html can't import them? If I directly access these CSS and JS files in the URL address, the browser will display Site file not found: (file pathโ€ฆ) ๐Ÿ˜“

  • Robin Shen commented 1 month ago

    Specify artifacts of publish site step to include all files for the site, not just index.html. For instance ** will publish all files from job working directory

  • RainOnTheRoof commented 1 month ago

    Thank you for your reply, the problems mentioned above is solved. ๐Ÿ˜„ > Specify artifacts of publish site step to include all files for the site, not just index.html. For instance ** will publish all files from job working directory

  • Robin Shen changed state to 'Closed' 1 month ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-2775
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover