Closed phbits closed 3 years ago
Th module manifest that is used as source is in https://github.com/phbits/SocketHttpRequest/blob/dev/source/SocketHttpRequest.psd1 and is defined in build.yaml
.
You should also put the public functions as separate .ps1 files (one for each function) under 'source/Public', and private functions under 'source/Private'.
You should also clean out the content of https://github.com/phbits/SocketHttpRequest/blob/dev/source/SocketHttpRequest.psm1, I saw that now and added that to the list. That file should be empty, as it is built
If you don't want to use private/public folders then add the functions inside https://github.com/phbits/SocketHttpRequest/blob/dev/source/SocketHttpRequest.psm1 (although I have not tested this in a module for over a year, so it might not work since there have been many iterations of Sampler since then)
I see now that you changed this row, and it does not point to a existing file 🤔 https://github.com/phbits/SocketHttpRequest/blob/db375ab407f83fbd6f6d574bbee063858f14d0e2/build.yaml#L6
It should not be needed at all if module manifest is in source
folder.
This should not be needed either, it is the default: https://github.com/phbits/SocketHttpRequest/blob/db375ab407f83fbd6f6d574bbee063858f14d0e2/build.yaml#L8
@johlju Many thanks for the feedback. After seeing all these issues, I started over from scratch and followed the steps you supplied in the devops chat. For some reason, I got carried away with modifying build.yaml and ended up with this mess. 🤦♂️
I started documentation at the following gist. Everything is going good using the steps you've already documented. I'm continuing on with tests
which I want to include steps on including custom Pester tests. More to come.
https://gist.github.com/phbits/854343e658c4911bcbe6cec1b19a2f53
That gist looks like it's becoming a good blog post - let me know if you publish it to a blog.
Happy I could help 😃
Details of the scenario you tried and the problem that is occurring
I followed the directions @johlju provided in the devops Discord chat to CICD a very simple module using Sampler
ModuleType = SimpleModule
. The target module is SocketHttpRequest which consists of just two functional files (excluding README, License, etc.):When running
.\build.ps1 -task build
, the module manifest is rebuilt but in doing so settings are not carried over from the original manifest. Seems the only setting that should get modified by the build process are as follows. All other settings should be carried over 'as-is'.Release Notes
Module Version
Prerelease
Verbose logs showing the problem
I committed everything to the dev branch.
The original manifest: https://github.com/phbits/SocketHttpRequest/blob/dev/SocketHttpRequest.psd1 The built manifest: https://github.com/phbits/SocketHttpRequest/blob/dev/output/SocketHttpRequest/0.1.0/SocketHttpRequest.psd1
Console output from running build.ps1 is available here: https://github.com/phbits/SocketHttpRequest/blob/dev/build-output.txt
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the Required Modules used ('dev' if using current dev branch)
All are listed at: https://github.com/phbits/SocketHttpRequest/tree/dev/output/RequiredModules