mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
git commit hash generator
This commit is contained in:
19
buildscripts/git-commit-id.sh
Normal file
19
buildscripts/git-commit-id.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CONST_FILE=build-constants.go
|
||||
|
||||
cat > $CONST_FILE <<EOF
|
||||
/*
|
||||
* ** DO NOT EDIT THIS FILE. THIS FILE IS AUTO GENERATED BY RUNNING MAKE **
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
const (
|
||||
gitCommitHash = "__GIT_COMMIT_HASH__"
|
||||
)
|
||||
EOF
|
||||
|
||||
commit_id=$(git log --format="%H" -n 1)
|
||||
sed -i "s/__GIT_COMMIT_HASH__/$commit_id/" $CONST_FILE
|
||||
|
||||
Reference in New Issue
Block a user