Able to retrieve all branches and tags when run a job (OD-143)
bufferUnderrun opened 6 years ago

Hi,

i'm looking for a way to retrieve the git describe --tags value inside a job command.

Thanks

  • Robin Shen commented 6 years ago

    Can you please help me understanding the usage scenario?

  • bufferUnderrun commented 6 years ago

    Inside my job, depending if build is a single .exe file or dist folder, i rename the .exe or zip the folder with the name of git describe --tags

    $ git describe --tags
    v0.4-39-gfbe25cf
    
    • v0.4 : current tag
    • 39 : commit count after tag
    • gfbe25cf : last commit hash

    So i want my artifact get the name "project-v0.4-39-gfbe25cf.exe" or "project-v0.4-39-gfbe25cf.zip" and need dit describe --tags

  • Robin Shen commented 6 years ago

    Thanks for the explanation. OneDev currently only fetches desired commit for performance consideration. To get this command running, all tags need to be fetched first. To do it:

    1. Run your job on an image with git installed
    2. Define project secret password
    3. Run below command before running "git describe --tags"
    git fetch http://admin:@secrets:password@\@192.168.1.39:6610/test --tags
    

    Also the checkout setting in 3.2.0 will add options to get all branches and tags to make such task easy.

  • Robin Shen changed title 6 years ago
    Previous Value Current Value
    Retrieve git describe --tags
    Able to retrieve all branches and tags when run a job
  • Robin Shen changed fields 6 years ago
    Name Previous Value Current Value
    Label
    Help Wanted
    empty
  • Robin Shen changed iterations 6 years ago
    Previous Value Current Value
    empty
    3.2.0
  • OneDev changed state to 'Closed' 6 years ago
    Previous Value Current Value
    Open
    Closed
  • OneDev changed state to 'Released' 6 years ago
    Previous Value Current Value
    Closed
    Released
issue 1/1
Type
Improvement
Priority
Normal
Assignee
Iterations
Issue Votes (0)
Watchers (2)
Reference
OD-143
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover