Code Monkey home page Code Monkey logo

Comments (5)

rlvandaveer avatar rlvandaveer commented on August 17, 2024

How is your code organized? Did you look at https://github.com/RamblingCookieMonster/BuildHelpers#get-project-name? It sounds like your psd1 is in the root of your repo.

from buildhelpers.

FISHMANPET avatar FISHMANPET commented on August 17, 2024

Not all powershell projects are modules!
My case in particular where I noticed this is a repo of Azure Automation Runbooks, so there's no .psd1 file anywhere. Additionally, looking closely at the code, the first case is assuming that your project will have a folder matching the name of the project, and that it will get checked out into a folder with the same name as the project, which will never be the case in Azure Devops unless your project is for some reason called s.

from buildhelpers.

rlvandaveer avatar rlvandaveer commented on August 17, 2024

Well certainly. This project seems like it's primarily focused on helping with building modules however.

I think in order to get it to work out of the box for your use case, you could create a folder using the project name within your repo and then put the source you wish to build there. Then when you kick off your process, kick it off within that subfolder, not the root i.e., agent working directory.

from buildhelpers.

rlvandaveer avatar rlvandaveer commented on August 17, 2024

So I was reading through some YAML build related documentation and found this tidbit which may be of use to you. https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/pipeline-options-for-git?view=azure-devops#checkout-path

Checkout path
By default, your source code will be checked out into a directory called s. For YAML pipelines, you can change this by specifying checkout with a path. The specified path is relative to $(Agent.BuildDirectory). For example: if the checkout path value is mycustompath and $(Agent.BuildDirectory) is C:\agent_work\1, then the source code will be checked out into C:\agent_work\1\mycustompath.
Please note that the checkout path value cannot be set to go up any directory levels above $(Agent.BuildDirectory), so path..\anotherpath will result in a valid checkout path (i.e. C:\agent_work\1\anotherpath), but a value like ..\invalidpath will not (i.e. C:\agent_work\invalidpath).

You could specify a subpath with you project name in it.

from buildhelpers.

peppekerstens avatar peppekerstens commented on August 17, 2024

@rlvandaveer the code in this module is not always strict on that; check out Get-BuildVariable which leans heavily on environment variables of each build system. If this was a 'pure' Git/PS module, it could have done without. I am sure @RamblingCookieMonster had his reasons.

@FISHMANPET just use $(System.TeamProject). I do agree with @rlvandaveer; this is made for PS modules...

from buildhelpers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.