Skip to content

dotnet fornax build unable to find config.fsx on CI servers #52

@Luke-Burgess

Description

@Luke-Burgess

Describe the bug
Installing fornax as a local tool on a CI server and trying to build a site throws an error "Couldn't find or load config".

To Reproduce

  1. Create a fornax site (e.g. using fornax new)
  2. Add a dotnet-tools.json with instructions to install fornax locally
  3. Add a config file for your chosen CI platform which runs dotnet tool restore and dotnet fornax build
  4. Push your site to a git repo and build using the CI service of your choice (e.g. TravisCI, Netlify, Azure Pipelines, etc.)
  5. Watch the build fail and observe the printed error Couldn't find or load config.

Expected behaviour
The site should build.

Build Output
Below is the output from TravisCI. The same problem occurs on Azure Pipelines as well as Netlify.

dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.201
 Commit:    b1768b4ae7
Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.201/
Host (useful for support):
  Version: 3.1.3
  Commit:  4a9f85e9f8
.NET Core SDKs installed:
  3.1.201 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
$ dotnet tool restore
$ pwd
/home/travis/build/LukeBurgessYeo/fsharp-tutorial
The command "pwd" exited with 0.
$ ls
config.fsx  images  _lib     loaders  README.md   style
generators  js	    LICENSE  posts    Script.fsx
The command "ls" exited with 0.
$ dotnet fornax build
Couldn't find or load config
The command "dotnet fornax build" exited with 1.

Notice that the working directory contains a config.fsx.

Additional Thoughts
Fornax works as expected locally with the globally installed dotnet tool, as well as with the locally installed dotnet tool. It seems that on these CI servers, the directory which dotnet fornax build is being run from is not the same as the directory which is being passed into the build process (i.e. this path from Directory.GetCurrentDirectory()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions