how to get build_bumber in buildspec? (OD-1820)
wc opened 2 years ago

question1: in jenkins, I use BUILD_NUMBER to generate my version file: xxx.$BUILD_NUMBER.tar but in onedev, how to get BUILD_NUMBER value?

in jenkins like this:

if [ -z $BUILD_NUMBER ] || [ -z $JOB_NAME ] || [ -z $GIT_BRANCH ]; then
   echo "Not in jenkins!"
   echo "you can test use follow command"
   echo "export BUILD_NUMBER=0; export JOB_NAME=pvetui/master; export GIT_BRANCH=master"
   exit 1
fi

question 2: how to search issues in onedev? image.png

  • Robin Shen commented 2 years ago

    In commands field of the step, you may input '@' to bring up the variable prompt. For build number, it is @build_number@.

    As to search by artibrary text, please surround with ~, as suggested in the auto completion dropdown. And you can press tab to have OneDev adding ~ automatically.

  • wc commented 2 years ago

    In commands field of the step, you may input '@' to bring up the variable prompt. For build number, it is @build_number@.

    As to search by artibrary text, please surround with ~, as suggested in the auto completion dropdown. And you can press tab to have OneDev adding ~ automatically.

    build_number=@build_number@
    echo "build_number is $build_number"
    

    thank you, it works, How to get all built-in variables like @build_number@?

  • Robin Shen commented 2 years ago

    As mentioned, just input @ and OneDev will prompt all available variables.

  • wc commented 2 years ago

    As mentioned, just input @ and OneDev will prompt all available variables.

    very thank you! my English not good. 😟 image_2.png

  • wc changed state to 'Closed' 2 years ago
    Previous Value Current Value
    Open
    Closed
  • wc commented 2 years ago

    very thank you

  • Robin Shen commented 2 years ago

    No problem. Thx for using OneDev.

issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-1820
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover