-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b12dd8
commit 3b216f5
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
#set -e | ||
# | ||
# nextbuildver.sh | ||
# Find the next build version number and either return it if no arguments | ||
# were passed in, or insert/append it to the filename passed in | ||
# If the argument passed in has a dot in it, the version will be inserted | ||
# before the dot with a leading underscore | ||
# eg: abc -> abc_4.2.4 or a.sh -> a_4.2.4.sh | ||
# | ||
# Expects one environment variable to exist: | ||
# artifact_name - the base filename to calculate the build number for | ||
# s3_bucket - the bucket where artifacts reside (to see latest one) | ||
|
||
echo "Starting nextbuildver.sh" | ||
|
||
if [[ $# > 2 ]]; then | ||
echo "Error: There must be at most one argument. If present, it must \ | ||
be a filename to be modified" | ||
exit 1 | ||
fi | ||
|
||
if [[ -n "$1" ]]; then | ||
fname="$1" | ||
echo "got filename=$fname" | ||
else | ||
if [[ -z "$1" ]]; then | ||
echo "got -z \$1" | ||
fi | ||
fi | ||
|
||
if [[ -z "$artifact_name" ]]; then | ||
echo "Error: Missing environment variable \$artifact_name" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "$s3_bucket" ]]; then | ||
echo "Error: Missing environment variable \$s3_bucket" | ||
exit 1 | ||
fi | ||
|