How to tag a git repo in a bamboo build

后端 未结 3 1270
傲寒
傲寒 2021-01-30 09:19

I\'m trying to tag the git repo of a ruby gem in a Bamboo build. I thought doing something like this in ruby would do the job

`git tag v#{current_version}`
`git         


        
3条回答
  •  借酒劲吻你
    2021-01-30 09:58

    It seems that after a checkout by the bamboo agent, the remote repository url for origin is set as file://nothing

    [remote "origin"]
    url = file://nothing
    fetch = +refs/heads/*:refs/remotes/origin/*
    

    That's why we can either update the url using git remote set-url or in my case I just created a new alias so it does not break the existing behavior. There must be a good reason why it is set this way.

    [remote "build-origin"]
    url = 
    fetch = +refs/heads/*:refs/remotes/build-origin/*
    

    I also noticed that using ${bamboo.planRepository..repositoryUrl} did not work for me since it was defined in my plan as https. Switching to ssh worked.

提交回复
热议问题