FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code-utils/misc/createStagingNo.rb at master · Praqma/code-utils · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
Praqma
/
code-utils
Public
Notifications
You must be signed in to change notification settings
Fork
15
Star
17
Code
Issues
3
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
code-utils
/
misc
/
createStagingNo.rb
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
26 lines (22 loc) · 681 Bytes
Breadcrumbs
code-utils
/
misc
/
createStagingNo.rb
Copy path
File metadata and controls
executable file
·
26 lines (22 loc) · 681 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/ruby
# Parse input paramenter:
# one mandatory settings file in ruby (not validating the file)
if
ARGV
.
length
(
)
!=
1
then
puts
<<-EOF
Please provide a number for this script
usage:
createStagingNo xxx
Will return a modulo 10 of the number as key=value pair to eg. set an ENV VAR
Can be used to do modulo on build number on jenkins jobs and use the number
as a round robin pointer to eg. deploy sub-directories.
EOF
abort
(
"Wrong input parameters"
)
else
inputNo
=
ARGV
[
0
]
;
end
begin
puts
"PROJECT_STAGE_NO_FROM_BUILD="
+
(
Integer
(
inputNo
)
%
10
)
.
to_s
(
)
rescue
puts
"PROJECT_STAGE_NO_FROM_BUILD=x"
abort
(
"Could not convert input argument to number"
)
end
Back
|
FazBrowse Home
|
New Git URL