Skip to content

Commit

Permalink
ci: allow pull requests
Browse files Browse the repository at this point in the history
disable tests if env secrets are empty

- detect emtpy aws token
- upload: check for aptly creds
  • Loading branch information
neolynx committed Sep 21, 2024
1 parent 79ebaf6 commit cb82b2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/s3_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
try:
import boto

if 'AWS_SECRET_ACCESS_KEY' in os.environ and 'AWS_ACCESS_KEY_ID' in os.environ:
if 'AWS_SECRET_ACCESS_KEY' in os.environ and 'AWS_ACCESS_KEY_ID' in os.environ and \
os.environ['AWS_SECRET_ACCESS_KEY'] != "" and os.environ['AWS_ACCESS_KEY_ID'] != "":
s3_conn = boto.connect_s3()
else:
print("S3 tests disabled: AWS creds not found in the environment (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)")
Expand Down
6 changes: 6 additions & 0 deletions upload-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ if [ "action" = "ci" ] && [ -z "$dist" ]; then
exit 1
fi

if [ -z "$aptly_user" ] || [ -z "$aptly_password" ]; then
usage
echo Error: please set APTLY_USER and APTLY_PASSWORD
exit 1
fi

echo "Publishing version '$version' to $action for $dist...\n"

upload()
Expand Down

0 comments on commit cb82b2c

Please sign in to comment.