Hi,
I have very simple script I wrote where I am uploading file to BrwoserStack. While running job on CircleCI I am getting error saying curl: (26) couldn’t open file “/Users/xyz/Downloads/debug.apk”
Exited with code exit status 26
When I was trying to upload file via curl command at terminal it’s working fine and uploading the file.
Spend 2 days’ to see what’s going on but no luck. Even with Shell script it’s uploading the file. only in CircleCI giving error.
version: 2.1
jobs:
build:
working_directory: ~/circleci-python
docker:
- image: “circleci/python:3.6.4”
steps:
- checkout
- run: python3 main.py
test:
working_directory: ~/circleci-python
docker:
- image: “circleci/python:3.6.4”
steps:
- checkout
- run: python3 main-test.py
deploy:
working_directory: ~/circleci-python
docker:
- image: “circleci/python:3.6.4”
steps:
- run:
name : App upload and Set app id in environment variable.
command : |
APP_UPLOAD_RESPONSE=$(curl -u “xyz_oOQxMv:txxxxx” -X POST https://api-cloud.browserstack.com/app-automate/upload -F file="@/Users/xyz/Downloads/debug.apk")
APP_ID=$(echo $APP_UPLOAD_RESPONSE | jq -r “.app_url”)
if [ $APP_ID != null ]; then
echo "Apk uploaded to BrowserStack with app id : ",$APP_ID;
echo “export BROWSERSTACK_APP_ID=$APP_ID” >> $BASH_ENV;
source $BASH_ENV;
echo "Setting value of BROWSERSTACK_APP_ID in environment variables to ",$APP_ID;
else
UPLOAD_ERROR_MESSAGE=$(echo $APP_UPLOAD_RESPONSE | jq -r “.error”)
echo "App upload failed, reason : ",$UPLOAD_ERROR_MESSAGE
exit 1;
fi
workflows:
build_and_test_deploy:
jobs:
- build
- test:
requires:
- build
- deploy:
requires:
- build
- test