-
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
2b7491d
commit 77f11f3
Showing
4 changed files
with
99 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
if [ -z $1 ]; then | ||
echo "Usage: $0 <bisect-coverage.json>" | ||
exit 1; | ||
fi | ||
|
||
if [ -z ${COVERALLS_REPO_TOKEN}]; then | ||
echo "Set the variable COVERALLS_REPO_TOKEN" | ||
exit 1; | ||
fi | ||
|
||
metadata_tmp=$(mktemp /tmp/coveralls-metadata.XXXXXXXX.json) | ||
cat <<EOT > $metadata_tmp | ||
{ | ||
"service_name": "$SERVICE_NAME", | ||
"service_number": "$SERVICE_NUMBER", | ||
"service_job_id": "$SERVICE_JOB_ID", | ||
"service_pull_request": "$PULL_REQUEST_ID", | ||
"repo_token": "$COVERALLS_REPO_TOKEN", | ||
"git": | ||
{"head": | ||
{"id":"$COMMIT_SHA", | ||
"author_name":"$AUTHOR_NAME", | ||
"author_email":"$AUTHOR_EMAIL", | ||
"committer_name":"$COMMITER_MAIL", | ||
"committer_email":"$COMMITER_EMAIL", | ||
"message":"$COMMITER_MESSAGE" | ||
},"branch":"$BRANCH", | ||
"remotes":{}}, | ||
"parallel": false, | ||
"flag_name": "test", | ||
"commit_sha": "$COMMIT_SHA", | ||
"run_at": "$RUN_AT" | ||
} | ||
EOT | ||
|
||
echo "Generated metadata: " $metadata_tmp > /dev/stderr | ||
|
||
jq -r -s '.[0] * .[1]' $metadata_tmp $1 |
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,28 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
# set -u | ||
set -x | ||
|
||
if [ -z $1 ]; then | ||
echo "Usage: $0 <bisect-coverage.json>" | ||
exit 1; | ||
fi | ||
|
||
CI_COMMIT_AUTHOR_NAME=$(echo $CI_COMMIT_AUTHOR | sed 's/ <.*//') | ||
CI_COMMIT_AUTHOR_EMAIL=$(echo $CI_COMMIT_AUTHOR | sed 's/.*<\(.*\)>.*/\1/') | ||
|
||
export RUN_AT=$CI_JOB_STARTED_AT | ||
export SERVICE_NAME="gitlab-ci" | ||
export SERVICE_NUMBER=$CI_PIPELINE_IID | ||
export SERVICE_JOB_ID=$CI_JOB_ID | ||
export PULL_REQUEST_ID=$CI_OPEN_MERGE_REQUESTS | ||
export COMMIT_SHA=$CI_COMMIT_SHA | ||
export AUTHOR_NAME=$CI_COMMIT_AUTHOR_NAME | ||
export AUTHOR_EMAIL=$CI_COMMIT_AUTHOR_EMAIL | ||
export COMMITER_MAIL=$CI_COMMIT_AUTHOR_NAME | ||
export COMMITER_EMAIL=$CI_COMMIT_AUTHOR_EMAIL | ||
export COMMITER_MESSAGE=$(echo $CI_COMMIT_MESSAGE | sed -z 's@\n@\\n@g') | ||
export BRANCH=$CI_COMMIT_BRANCH | ||
|
||
./_ci/coverage_metadata.sh $1 |
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,24 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -u | ||
|
||
if [ -z $1 ]; then | ||
echo "Usage: $0 <bisect-coverage.json>" | ||
exit 1; | ||
fi | ||
|
||
export RUNAT=$(date +'%Y-%m-%d %H:%m:%S %z') | ||
export SERVICE_NAME="local" | ||
export SERVICE_NUMBER=1000 | ||
export SERVICE_JOB_ID=1001 | ||
export PULL_REQUEST_ID=1002 | ||
export COMMIT_SHA=$(git rev-parse HEAD) | ||
export AUTHOR_NAME=$(git log --oneline --format='%an' -n 1 HEAD) | ||
export AUTHOR_EMAIL=$(git log --oneline --format='%ae' -n 1 HEAD) | ||
export COMMITER_MAIL=$(git log --oneline --format='%cn' -n 1 HEAD) | ||
export COMMITER_EMAIL=$(git log --oneline --format='%ce' -n 1 HEAD) | ||
export COMMITER_MESSAGE=$(git log --oneline --format='%s' -n 1 HEAD) | ||
export BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
./_ci/coverage_metadata.sh $1 |