Skip to content

Commit b489e9a

Browse files
authored
disable CI publishing when no AWS keys (#68)
1 parent 3497fd5 commit b489e9a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

scripts/oneapi.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,12 @@ def ci_publish(root, target=None):
205205
root_only(root)
206206
if not args.branch:
207207
exit('Error: --branch <branchname> is required')
208-
shell('aws s3 sync --only-show-errors --delete site s3://%s/exclude/ci/branches/%s' % (staging_host, args.branch))
209-
log('published at http://staging.spec.oneapi.com.s3-website-us-west-2.amazonaws.com/exclude/ci/branches/%s/'
210-
% (args.branch))
208+
if 'AWS_SECRET_ACCESS_KEY' in os.environ:
209+
shell('aws s3 sync --only-show-errors --delete site s3://%s/exclude/ci/branches/%s' % (staging_host, args.branch))
210+
log('published at http://staging.spec.oneapi.com.s3-website-us-west-2.amazonaws.com/exclude/ci/branches/%s/'
211+
% (args.branch))
212+
else:
213+
log('Skipping publishing the site because AWS access key is not available. This is expected when building a fork')
211214

212215
@action
213216
def prod_publish(root, target=None):
@@ -255,8 +258,10 @@ def spec_venv(root, target=None):
255258
@action
256259
def get_tarballs(root='.', target=None):
257260
root_only(root)
258-
if not os.path.exists('tarballs'):
259-
makedirs('tarballs')
261+
print('exists',os.path.exists('tarballs'))
262+
if args.dry_run or os.path.exists('tarballs'):
263+
return
264+
makedirs('tarballs')
260265
for t in tarballs:
261266
tf = join('tarballs','%s.tgz' % t)
262267
url = 'https://spec.oneapi.com/tarballs/%s.tgz' % t

0 commit comments

Comments
 (0)