nightroman / Invoke-Build

Build Automation in PowerShell

Home Page:https://github.com/nightroman/Invoke-Build/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

invoke-build discovery fails in powershell container

ChrisFoulstone opened this issue · comments

I'm using a docker based Gitlab runner to handle my CI/CD build automation. Inside the container my invocation of Invoke-Build fails to locate the *.build.ps1 file that exists in the same directory.

Locally, a simple Invoke-Build successfully locates the the *.Build.ps1 files and runs the build process as expected.

I've added in a basic path test to confirm presence of the Module.Build.ps1 in the directory from the context of the runner. Additionally, I've tried to also specify the build file explicitly without success.

gitlab-ci.yml

image: mcr.microsoft.com/powershell

stages:
  - test
  - deploy

build and test:
  stage: test
  tags:
    - test
  script:
    -  |
      pwsh -f ./Module.CI.Entrypoint.ps1
      pwsh -c 'Write-Host "Directory contents:"; (Get-ChildItem).Name'
      pwsh -c 'Write-Output "Testing specific file path result:"; Test-Path -path .\Module.Build.ps1'
      pwsh -c 'Invoke-Build'

pipleline output:

Directory contents:
Tests
CHANGELOG.md
Module.Build.ps1
Module.CI.Entrypoint.ps1
README.md
Testing specific file path result:
True
Invoke-Build.ps1: Missing default script.
Cleaning up file based variables
ERROR: Job failed: exit code 1
  • What is the OS?
  • Does it work if you name your script Module.build.ps1 (Build -> build)?

Additionally, I've tried to also specify the build file explicitly without success.

Weird... But to be sure what is the exact command and error?

  • What is the OS?
    Debian
  • Does it work if you name your script Module.build.ps1 (Build -> build)?
    Actually, yes it does. Of course my runner is *nix and I'm developing on a Windows box. Can't believe I didn't consider that, thank you!
    Weird... But to be sure what is the exact command and error?
    This will be entirely related to the casing issue too.

All sorted now, thanks for a quick reply.