Skip to content

Commit

Permalink
Adding steps to install ibcurl4-gnutls-dev because it is required for…
Browse files Browse the repository at this point in the history
… pycurl to the pipeline
  • Loading branch information
said-moj committed Aug 9, 2023
1 parent d2a4c0f commit 9477585
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ jobs:
- run:
name: Setup Python environment
command: |
echo "Installing ibcurl4-gnutls-dev because it is required for pycurl"
sudo apt-get update
sudo apt-get install -y libcurl4-gnutls-dev
pip install virtualenv
virtualenv pip-compile-env
- restore_cache:
Expand Down Expand Up @@ -137,6 +140,9 @@ jobs:
- run:
name: Setup Python environment
command: |
echo "Installing ibcurl4-gnutls-dev because it is required for pycurl"
sudo apt-get update
sudo apt-get install -y libcurl4-gnutls-dev
sudo apt-get update && sudo apt-get install -y libpython2.7 firefox
pip install virtualenv
virtualenv env
Expand Down
5 changes: 3 additions & 2 deletions cla_backend/libs/aws/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ def get_s3_connection(cls, bucket_name):
@classmethod
def download_file(cls, bucket_name, key):
try:
obj = cls.get_s3_connection(bucket_name).bucket.Object(key.strip("/"))
obj = cls.get_s3_connection(bucket_name).bucket.Object(key)
data = NamedTemporaryFile()
obj.download_fileobj(data)
data.seek(0)
return {"headers": {"Content-Type": obj.content_type}, "body": data}
except ClientError:
return None

@classmethod
def save_file(cls, bucket_name, key, path):
cls.get_s3_connection(bucket_name).save(key, open(path, "rb"))
cls.get_s3_connection(bucket_name).bucket.Object(key).upload_file(path)

@classmethod
def delete_file(cls, bucket_name, key):
Expand Down

0 comments on commit 9477585

Please sign in to comment.