Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Remove version dependency on date and SHA (#422)
Browse files Browse the repository at this point in the history
* Remove version dependency on date and SHA

* Use VERSION for tbd in tests
  • Loading branch information
thomasrockhu authored Apr 13, 2021
1 parent b104bfe commit f181fd2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
gcloud --quiet config set project ${GCLOUD_PROJECT_ID}
gcloud --quiet config set compute/zone ${GCLOUD_COMPUTE_ZONE}
- run:
name: Update uploader and env with versions
name: Update and push release tag
command: ./scripts/version.sh
- run:
name: Upload Bash Uploader
Expand Down
2 changes: 1 addition & 1 deletion SHA1SUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6d9842131391ad7e27631142c38dc74a9a680a3a codecov
0ddc61a9408418c73b19a1375f63bb460dc947a8 codecov
2 changes: 1 addition & 1 deletion SHA256SUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bbfe23d850d80f1e522cc49251fb3c9c8e812531537782bd4a9c5f6a65ccf588 codecov
89c658e261d5f25533598a222fd96cf17a5fa0eb3772f2defac754d9970b2ec8 codecov
2 changes: 1 addition & 1 deletion SHA512SUM
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0696019e73cf96c52cb3c9e1ec88cf3067eade4121a36b2e2bfc28b44d50dfa353f7e83a99b55be6a405d6f070035aa0e08ec7a50d5d221f1d4f49d76b344000 codecov
d075b412a362a9a2b7aedfec3b8b9a9a927b3b99e98c7c15a2b76ef09862aeb005e91d76a5fd71b511141496d0fd23d1b42095f722ebcd509d768fba030f159e codecov
4 changes: 2 additions & 2 deletions codecov
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -e +o pipefail

VERSION="tbd"
VERSION="1.0.1"

codecov_flags=( )
url="https://codecov.io"
Expand Down Expand Up @@ -124,7 +124,7 @@ cat << EOF
-e VAR,VAR2
-k prefix Prefix filepaths to help resolve path fixing
-k prefix Prefix filepaths to help resolve path fixing
-i prefix Only include files in the network with a certain prefix. Useful for upload-specific path fixing
Expand Down
2 changes: 1 addition & 1 deletion env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -e +o pipefail

VERSION="tbd"
VERSION="1.0.1"

add()
{
Expand Down
22 changes: 4 additions & 18 deletions scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

set -x

change_bash_file () {
sed -i -e "s|.*VERSION=.*|VERSION=\"$RELEASE_TAG\"|g" codecov
rm codecov-e || :
}

change_env_file () {
sed -i -e "s|.*VERSION=.*|VERSION=\"$RELEASE_TAG\"|g" env
rm env-e || :
clear_branch () {
# Clear changes
git stash
}

update_branch () {
Expand All @@ -26,16 +21,7 @@ tag_and_push () {
git push origin "$RELEASE_TAG"
}

clear_branch () {
# Clear changes
git stash
}

clear_branch
update_branch
short_git=$(git rev-parse --short HEAD)
date=$(date +%Y%m%d)
RELEASE_TAG="$date-$short_git"
change_bash_file
change_env_file
RELEASE_TAG=$(grep 'VERSION=\".*\"' codecov | cut -d'"' -f2)
tag_and_push
6 changes: 3 additions & 3 deletions tests/test
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ function test_buddy () {
export BUDDY_EXECUTION_ID="1"
export BUDDY_EXECUTION_PULL_REQUEST_NO="1"
export BUDDY_REPO_SLUG="codecov/ci-repo"
assertURL "https://codecov.io/upload/v4?package=bash-tbd&token=&branch=master&commit=$TEST_DATA_GIT_COMMIT&build=1&build_url=&name=&tag=&slug=codecov%2Fci-repo&service=buddy&flags=&pr=1&job=&cmd_args=d,C"
assertURL "https://codecov.io/upload/v4?package=bash-$VERSION&token=&branch=master&commit=$TEST_DATA_GIT_COMMIT&build=1&build_url=&name=&tag=&slug=codecov%2Fci-repo&service=buddy&flags=&pr=1&job=&cmd_args=d,C"
}

function test_cirrus () {
Expand All @@ -656,7 +656,7 @@ function test_cirrus () {
export CIRRUS_BUILD_ID="777"
export CIRRUS_TASK_ID="239"
export CIRRUS_TASK_NAME="test"
assertURL "https://codecov.io/upload/v4?package=bash-tbd&token=&branch=$CIRRUS_BRANCH&commit=$TEST_DATA_GIT_COMMIT&build=$CIRRUS_BUILD_ID&build_url=https%3A%2F%2Fcirrus-ci.com%2Ftask%2F$CIRRUS_TASK_ID&name=&tag=&slug=codecov%2Fci-repo&service=cirrus-ci&flags=&pr=1&job=test&cmd_args=d,C"
assertURL "https://codecov.io/upload/v4?package=bash-$VERSION&token=&branch=$CIRRUS_BRANCH&commit=$TEST_DATA_GIT_COMMIT&build=$CIRRUS_BUILD_ID&build_url=https%3A%2F%2Fcirrus-ci.com%2Ftask%2F$CIRRUS_TASK_ID&name=&tag=&slug=codecov%2Fci-repo&service=cirrus-ci&flags=&pr=1&job=test&cmd_args=d,C"
}

function test_heroku () {
Expand All @@ -665,7 +665,7 @@ function test_heroku () {
export HEROKU_TEST_RUN_BRANCH="master"
export HEROKU_TEST_RUN_ID="1"
export HEROKU_TEST_RUN_COMMIT_VERSION="$TEST_DATA_GIT_COMMIT"
assertURL "https://codecov.io/upload/v4?package=bash-tbd&token=&branch=master&commit=$TEST_DATA_GIT_COMMIT&build=1&build_url=&name=&tag=&slug=codecov%2Fcodecov-bash&service=heroku&flags=&pr=&job=&cmd_args=d,C"
assertURL "https://codecov.io/upload/v4?package=bash-$VERSION&token=&branch=master&commit=$TEST_DATA_GIT_COMMIT&build=1&build_url=&name=&tag=&slug=codecov%2Fcodecov-bash&service=heroku&flags=&pr=&job=&cmd_args=d,C"
}

# Call and Run all Tests
Expand Down

0 comments on commit f181fd2

Please sign in to comment.