ibm-watson-data-lab / cos-uploader

IBM Cloud Object Storage file uploader for web browsers, using Cloud Functions
3 stars 2 forks source link

zsh: permission denied: ./deploy.sh #1

Open GoodPBC opened 6 years ago

GoodPBC commented 6 years ago

Mac Sierra. Zsh running in VSCode

Permission denied when trying to run deploy.sh

Steps:

  1. Created dot files for aws config and am getting back back the contents of the bucket in zsh.
  2. Installed the bx wsk tool according to instructions.
  3. Set the environment variables in zsh by typing each command individually.
    export access_key='xxx'
    export secret_key='yyy'
    export bucket='mybucket'
    export endpoint="https://s3-api.us-geo.objectstorage.softlayer.net"

    I am unclear as to whether to set the env var globally in VSCode or in a dotenv file in the project. I have never worked with cloud functions before. Is this where I went wrong or could it be something else?

jackyhieu1211-hn commented 4 years ago

Step 1: Create Cloud Object Storage on IBM Cloud Step 2: Create a bucket and name it "mybucketname" and Upload a file. Example : "Book1.xlsx" Step 3: Click to "mybucketname" . And On "Service credentials" Click to "New credentials" Step 4: Save info like access_key_id, secret_access_key, mybucketname Step 5: Find Endpoint on bucket Like as : "s3.us-south.cloud-object-storage.appdomain.cloud " => convert to "https://s3.us-south.cloud-object-storage.appdomain.cloud" Step 6: open terminal run

aws configure

Enter info

AWS Access Key ID [****************PN4A]: "Access Key ID"
AWS Secret Access Key [****************g2VO]: "AWS Secret Access Key"
Default region name [us-south]: us-south
Default output format [None]: json

Step 7: Clone this repository => open terminal at this repository and RUN command

aws --endpoint-url=https://s3.us-south.cloud-object-storage.appdomain.cloud/ \
  s3api \
  put-bucket-cors \
  --bucket mybucketname \
  --cors-configuration file://cors.json

Step 8: Check result

aws --endpoint-url=https://s3.us-south.cloud-object-storage.appdomain.cloud/ s3 ls s3://mybucketname

Result :

2019-11-24 11:03:10 22331 Book1.xlsx