Skip to content

Commit

Permalink
[MER-2009] include aviator_upload_url env variable (#2)
Browse files Browse the repository at this point in the history
* test upload orb

* update descriptions

* lint

* fix example

* fix test deploy

* address ankits comments

* command always succeeds

* use string

* modify script

* upload multiple files

* add upload url

* always run step

* add bracket

* assign url

* rename to aviator_upload_url
  • Loading branch information
doratzeng authored Mar 21, 2023
1 parent 79f9598 commit 26ac63b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/commands/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ steps:
AVIATOR_API_TOKEN: <<parameters.aviator_api_token>>
ASSETS: <<parameters.assets>>
name: Upload junit xml files
when: always
command: <<include(scripts/upload.sh)>>
7 changes: 6 additions & 1 deletion src/scripts/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ if [ -z "${ASSETS}" ]; then
exit 1
fi

if [[ -z "${AVIATOR_UPLOAD_URL}" ]]; then
URL="https://upload.aviator.co/api/test-report-uploader"
else
URL="${AVIATOR_UPLOAD_URL}"
fi

if ! which curl > /dev/null; then
echo "curl is required to use this command"
exit 1
Expand All @@ -21,7 +27,6 @@ for filename in ${ASSETS}; do
done
echo "${all_files[@]}"

URL="https://upload.aviator.co/api/test-report-uploader"
REPO_URL="https://github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}"

response=$(curl -X POST -H "x-Aviator-Api-Key: ${AVIATOR_API_TOKEN}" \
Expand Down

0 comments on commit 26ac63b

Please sign in to comment.