-
Notifications
You must be signed in to change notification settings - Fork 830
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PM-10515] CI build info on version copy (#4456)
Co-authored-by: Álison Fernandes <[email protected]>
- Loading branch information
Showing
5 changed files
with
86 additions
and
4 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
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,38 @@ | ||
#!/bin/sh | ||
# CI Build Info Updater | ||
# | ||
# Updates the ci.properties file with additional info from the CI build. | ||
# | ||
# Prerequisites: | ||
# - Git command line tools installed | ||
# - Write access to ci.properties file | ||
|
||
if [ $# -ne 5 ]; then | ||
echo "Usage: $0 <repository> <branch> <commit_hash> <ci_run_number> <ci_run_attempt>" | ||
echo "E.g: $0 bitwarden/android main abc123 123 1" | ||
exit 1 | ||
fi | ||
|
||
set -euo pipefail | ||
|
||
repository=$1 | ||
branch=$2 | ||
commit_hash=$3 | ||
ci_run_number=$4 | ||
ci_run_attempt=$5 | ||
|
||
ci_build_info_file="../ci.properties" | ||
git_source="${repository}/${branch}@${commit_hash}" | ||
ci_run_source="${repository}/actions/runs/${ci_run_number}/attempts/${ci_run_attempt}" | ||
emoji_brick="\\ud83e\\uddf1" # 🧱 | ||
emoji_computer="\\ud83d\\udcbb" # 💻 | ||
|
||
echo "🧱 Updating app CI Build info..." | ||
echo "🧱 🧱 commit: ${git_source}" | ||
echo "🧱 💻 build source: ${ci_run_source}" | ||
|
||
cat << EOF > ${ci_build_info_file} | ||
ci.info="${emoji_brick} commit: ${git_source}\\\n${emoji_computer} build source: ${ci_run_source}" | ||
EOF | ||
|
||
echo "✅ CI Build info updated successfully." |