-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from codecov/th/create-commit
feat: add create commit args
- Loading branch information
Showing
11 changed files
with
350 additions
and
71 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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
__pycache__/ | ||
.py[oc] | ||
codecov | ||
codecov.SHA256SUM* |
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
CODECOV_FLAGS="meow,rawr" | ||
|
||
. ./set_defaults.sh | ||
. ./download.sh | ||
. ./validate.sh | ||
|
||
. ./set_cli_args.sh | ||
. ./set_create_commit_args.sh | ||
. ./set_create_report_args.sh | ||
. ./set_do_upload_args.sh | ||
. ./upload.sh |
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,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
codecov_cli_args="" | ||
|
||
if [ -n "$CODECOV_AUTO_LOAD_PARAMS_FROM" ]; | ||
then | ||
codecov_cli_args+=" --auto-load-params-from ${CODECOV_AUTO_LOAD_PARAMS_FROM}" | ||
fi | ||
|
||
if [ -n "$CODECOV_ENTERPRISE_URL" ]; | ||
then | ||
codecov_cli_args+=" --enterprise-url ${CODECOV_ENTERPRISE_URL}" | ||
fi | ||
|
||
unset CODECOV_YML_PATH | ||
if [ -n "$CODECOV_YML_PATH" ]; | ||
then | ||
codecov_cli_args+=" --codecov-yml-path ${CODECOV_YML_PATH}" | ||
fi | ||
|
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
codecov_create_commit_args=() | ||
|
||
if [ -n "$CODECOV_BRANCH" ]; | ||
then | ||
codecov_create_commit_args+=( " --branch " "${CODECOV_BRANCH}" ) | ||
fi | ||
|
||
if [ "$CODECOV_FAIL_ON_ERROR" = "true" ]; | ||
then | ||
codecov_create_commit_args+=( " --fail-on-error" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_GIT_SERVICE" ]; | ||
then | ||
codecov_create_commit_args+=( " --git-service " "${CODECOV_GIT_SERVICE}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_PARENT_SHA" ]; | ||
then | ||
codecov_create_commit_args+=( " --parent-sha " "${CODECOV_PARENT_SHA}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_PULL_REQUEST" ]; | ||
then | ||
codecov_create_commit_args+=( " --pr " "${CODECOV_PULL_REQUEST}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_SHA" ]; | ||
then | ||
codecov_create_commit_args+=( " --sha " "${CODECOV_SHA}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_SLUG" ]; | ||
then | ||
codecov_create_commit_args+=( " --slug " "${CODECOV_SLUG}" ) | ||
fi |
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,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
codecov_create_report_args=() | ||
|
||
if [ -n "$CODECOV_CODE" ]; | ||
then | ||
codecov_create_report_args+=( " --code " "${CODECOV_CODE}" ) | ||
fi | ||
|
||
if [ "$CODECOV_FAIL_ON_ERROR" = "true" ]; | ||
then | ||
codecov_create_report_args+=( " --fail-on-error" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_GIT_SERVICE" ]; | ||
then | ||
codecov_create_report_args+=( " --git-service " "${CODECOV_GIT_SERVICE}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_PULL_REQUEST" ]; | ||
then | ||
codecov_create_report_args+=( " --pr " "${CODECOV_PULL_REQUEST}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_SHA" ]; | ||
then | ||
codecov_create_report_args+=( " --sha " "${CODECOV_SHA}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_SLUG" ]; | ||
then | ||
codecov_create_report_args+=( " --slug " "${CODECOV_SLUG}" ) | ||
fi |
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 |
---|---|---|
@@ -1,21 +1,37 @@ | ||
home_dir=$(bash -c "cd ~$(printf %q $USER) && pwd") | ||
CODECOV_BASH_ENV="${CODECOV_BASH_ENV:-$home_dir/.bashrc}" | ||
#!/usr/bin/env bash | ||
|
||
CODECOV_WRAPPER_VERSION="0.0.1" | ||
CODECOV_VERSION="${CODECOV_VERSION:-latest}" | ||
CODECOV_UPLOAD_NAME="${CODECOV_UPLOAD_NAME:-$CIRCLE_BUILD_NUM}" | ||
|
||
codecov_vars=( | ||
CODECOV_WRAPPER_VERSION | ||
CODECOV_VERSION | ||
) | ||
say() { | ||
echo -e "$1" | ||
} | ||
|
||
exit_if_error() { | ||
say "$r==> $1$x" | ||
if [ $CODECOV_FAIL_ON_ERROR = true ]; | ||
then | ||
say "$r Exiting...$x" | ||
exit 1; | ||
fi | ||
} | ||
|
||
echo "Running wrapper version $CODECOV_WRAPPER_VERSION" | ||
for value in "${codecov_vars[@]}" | ||
do | ||
echo "==> \$$value=${!value}" | ||
export $value=${!value} | ||
done | ||
b="\033[0;36m" # variables/constants | ||
g="\033[0;32m" # info/debug | ||
r="\033[0;31m" # errors | ||
y="\033[0;33m" # warnings | ||
x="\033[0m" | ||
|
||
echo "Finishing setting env variables" | ||
echo "" | ||
say " _____ _ | ||
/ ____| | | | ||
| | ___ __| | ___ ___ _____ __ | ||
| | / _ \\ / _\` |/ _ \\/ __/ _ \\ \\ / / | ||
| |___| (_) | (_| | __/ (_| (_) \\ V / | ||
\\_____\\___/ \\__,_|\\___|\\___\\___/ \\_/ | ||
$r Wrapper-$CODECOV_WRAPPER_VERSION$x | ||
" | ||
|
||
CODECOV_VERSION="${CODECOV_VERSION:-latest}" | ||
CODECOV_FAIL_ON_ERROR="${CODECOV_FAIL_ON_ERROR:-false}" | ||
say "$g ->$x$b CODECOV_VERSION$x = $CODECOV_VERSION" | ||
say "$g ->$x$b CODECOV_FAIL_ON_ERROR$x = $CODECOV_FAIL_ON_ERROR" | ||
say |
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,145 @@ | ||
#!/usr/bin/env bash | ||
|
||
codecov_do_upload_args=() | ||
|
||
OLDIFS=$IFS;IFS=, | ||
|
||
if [ -n "$CODECOV_BRANCH" ]; | ||
then | ||
codecov_do_upload_args+=( " --branch " "${CODECOV_BRANCH}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_BUILD" ]; | ||
then | ||
codecov_do_upload_args+=( " --build " "${CODECOV_BUILD}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_BUILD_URL" ]; | ||
then | ||
codecov_do_upload_args+=( " --build-url " "${CODECOV_BUILD_URL}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_CODE" ]; | ||
then | ||
codecov_do_upload_args+=( " --code " "${CODECOV_CODE}" ) | ||
fi | ||
|
||
if [ "$CODECOV_DISABLE_FILE_FIXES" = "true" ]; | ||
then | ||
codecov_do_upload_args+=( " --disable-file-fixes" ) | ||
fi | ||
|
||
if [ "$CODECOV_DISABLE_SEARCH" = "true" ]; | ||
then | ||
codecov_do_upload_args+=( " --disable-search" ) | ||
fi | ||
|
||
if [ "$CODECOV_DRY_RUN" = "true" ]; | ||
then | ||
codecov_do_upload_args+=( " --dry-run" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_ENV" ]; | ||
then | ||
codecov_do_upload_args+=( " --env " "${CODECOV_ENV}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_EXCLUDE_DIRS" ]; | ||
then | ||
for directory in $CODECOV_EXCLUDE_DIRS; do | ||
codecov_do_upload_args+=( " --exclude " "$directory" ) | ||
done | ||
fi | ||
|
||
if [ "$CODECOV_FAIL_ON_ERROR" = "true" ]; | ||
then | ||
codecov_do_upload_args+=( " --fail-on-error" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_FILES" ]; | ||
then | ||
for file in $CODECOV_FILES; do | ||
codecov_do_upload_args+=( " --file " "$file" ) | ||
done | ||
fi | ||
|
||
if [ -n "$CODECOV_FLAGS" ]; | ||
then | ||
for flag in $CODECOV_FLAGS; do | ||
codecov_do_upload_args+=( " --flag " "$flag" ) | ||
done | ||
fi | ||
|
||
if [ -n "$CODECOV_GIT_SERVICE" ]; | ||
then | ||
codecov_do_upload_args+=( " --git-service " "${CODECOV_GIT_SERVICE}" ) | ||
fi | ||
|
||
if [ "$CODECOV_HANDLE_NO_REPORTS_FOUND" = "true" ]; | ||
then | ||
codecov_do_upload_args+=( " --handle-no-reports-found" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_JOB_CODE" ]; | ||
then | ||
codecov_do_upload_args+=( " --job-code " "${CODECOV_JOB_CODE}" ) | ||
fi | ||
|
||
if [ "$CODECOV_LEGACY" = "true" ]; | ||
then | ||
codecov_do_upload_args+=( " --legacy" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_NAME" ]; | ||
then | ||
codecov_do_upload_args+=( " --name " "${CODECOV_NAME}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_NETWORK_FILTER" ]; | ||
then | ||
codecov_do_upload_args+=( " --network-filter " "${CODECOV_NETWORK_FILTER}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_NETWORK_PREFIX" ]; | ||
then | ||
codecov_do_upload_args+=( " --network-prefix " "${CODECOV_NETWORK_PREFIX}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_NETWORK_ROOT_FOLDER" ]; | ||
then | ||
codecov_do_upload_args+=( " --network-root-folder " "${CODECOV_NETWORK_ROOT_FOLDER}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_PLUGINS" ]; | ||
then | ||
for plugin in $CODECOV_PLUGINS; do | ||
codecov_do_upload_args+=( " --plugin " "$plugin" ) | ||
done | ||
fi | ||
|
||
if [ -n "$CODECOV_PULL_REQUEST" ]; | ||
then | ||
codecov_do_upload_args+=( " --pr " "${CODECOV_PULL_REQUEST}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_REPORT_TYPE" ]; | ||
then | ||
codecov_do_upload_args+=( " --report-type " "${CODECOV_REPORT_TYPE}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_SEARCH_DIR" ]; | ||
then | ||
codecov_do_upload_args+=( " --coverage-files-search-root-folder " "${CODECOV_SEARCH_DIR}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_SHA" ]; | ||
then | ||
codecov_do_upload_args+=( " --sha " "${CODECOV_SHA}" ) | ||
fi | ||
|
||
if [ -n "$CODECOV_SLUG" ]; | ||
then | ||
codecov_do_upload_args+=( " --slug " "${CODECOV_SLUG}" ) | ||
fi | ||
|
||
IFS=$OLDIFS |
Oops, something went wrong.