#1820  how to get build_bumber in buildspec?
Closed
wc opened 1 month 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 1 month 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 1 month 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 1 month ago

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

wc commented 1 month 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' 1 month ago
Previous Value Current Value
Open
Closed
wc commented 1 month ago

very thank you

Robin Shen commented 1 month ago

No problem. Thx for using OneDev.

issue 1 of 1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
onedev/server#1820
Please wait...
Page is in error, reload to recover