Skip to content

Commit

Permalink
updates gitlab to pull rbac permissions data when building preview
Browse files Browse the repository at this point in the history
  • Loading branch information
bgdeutsch authored and davidejones committed Feb 5, 2021
1 parent ddb6761 commit 64402f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ build_preview:
- touch Makefile.config
- make BRANCH=${CI_COMMIT_REF_NAME} examples
- sync_integration_descriptions
- pull_rbac.py --api_key $(get_secret 'dd_api_key') --app_key $(get_secret 'dd-app-key')
#- sync_integration_descriptions_cached
- placehold_translations
- update_preview_baseurl
Expand Down
8 changes: 6 additions & 2 deletions local/bin/py/build/pull_rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import requests
import json
from os import getenv

def pull_rbac():
api_endpoint = 'https://app.datadoghq.com/api/v2/permissions'
Expand All @@ -28,8 +29,11 @@ def pull_rbac():
with open('data/permissions.json', 'w') as outfile:
outfile.write(formatted_permissions_json)
else:
# API request failed
print('API request failed')
print('RBAC api request failed.')

if getenv("LOCAL") != 'True':
sys.exit(1)


pull_rbac()

0 comments on commit 64402f0

Please sign in to comment.