-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* derive project version from git tags, use BUILD_NUMBER enrironment var * fetch tags * use ziti-uploads Artifactory user
- Loading branch information
Showing
6 changed files
with
119 additions
and
44 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
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
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 @@ | ||
# Get the current working branch | ||
execute_process( | ||
COMMAND git rev-parse --abbrev-ref HEAD | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_BRANCH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
# Get the latest abbreviated commit hash of the working branch | ||
execute_process( | ||
COMMAND git log -1 --format=%h | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_COMMIT_HASH | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
# capture build date | ||
execute_process( | ||
COMMAND date +%a-%m/%d/%Y-%H:%M:%S-%Z | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE BUILD_DATE | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
# lookup most recent tag to derive version | ||
execute_process( | ||
COMMAND git describe HEAD | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_INFO | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
if(${GIT_INFO} MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)$") | ||
set(ver ${GIT_INFO}) | ||
elseif(${GIT_INFO} MATCHES "^([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-[^-]*") | ||
string(JOIN "." ver ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}) | ||
endif() | ||
message("project version: ${ver} (derived from git)") | ||
|
||
|
||
|
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
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
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,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo '{ "files": [' > publish.json | ||
for f in build-*/*-pub-spec.json | ||
do | ||
if [ -n "$first" ]; then | ||
echo "," >> publish.json | ||
fi | ||
cat $f >> publish.json | ||
first="done" | ||
done | ||
echo "]}" >> publish.json |