Skip to content

Commit

Permalink
Merge pull request #22 from erik-leven/fix-2.1.1
Browse files Browse the repository at this point in the history
fixed bug with master pull
  • Loading branch information
GabriellCVig authored Nov 18, 2020
2 parents 8eca46d + 3007930 commit 62dabed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Warning, use with care. Notes:

`SLEEP_INTERVAL` - Defaults to 60. The amount of time (in seconds) between synching with the git repository. Value should be an integer.


## Example Sesam System Config
This configuration assumes that you have defined both a "github_token" and a "jwt" secret under settings > datahub > secrets, containing the relative correct strings. Make sure also that the GitHub token you are using belongs to a user
with access permission to the private GitHub repository you are using. Some variables have been omitted, and using defaults: we assume we are using the master branch, and "pipes", "systems" and node-metadata.conf.json are in the top directory of that repository.
Expand Down
11 changes: 7 additions & 4 deletions service/github-autodeployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
turn_off = os.environ.get('off', 'false').lower() == 'true'
sleep_interval = os.environ.get("SLEEP_INTERVAL", 60)


## internal, skeleton, don't touch, you perv! *touchy, touchy*
git_cloned_dir = "/tmp/git_upstream_clone"
sesam_checkout_dir = "/tmp/sesam_conf"
Expand Down Expand Up @@ -290,7 +289,7 @@ def check_for_unknown():


if __name__ == '__main__':
while 1 < 2:
while 1 < 2:
os.chdir("/service")
if clone_with_git_token is False:
with open("id_deployment_key", "w") as key_file:
Expand All @@ -307,7 +306,7 @@ def check_for_unknown():
check_for_unknown()
copy_autodeployer()

new_node = load_sesam_files_as_json(git_cloned_dir + "/" + sync_root + '/node')
new_node = load_sesam_files_as_json(git_cloned_dir + "/" + sync_root)
old_node = load_sesam_files_as_json(sesam_checkout_dir + "/" + "unpacked")
if not compare_json_dict_list(old_node, new_node):
# Verify variables & secrets if specified
Expand All @@ -326,11 +325,15 @@ def check_for_unknown():
logging.error('Failed to upload variables to node!')
elif upload_variables and variables is None:
logging.error('Upload variables is true but could not get variables to upload!')
if orchestrator:
check_and_replace_orchestrator_pipes()
check_and_replace_orchestrator_systems()

logging.info(f"Uploading new configuration from github to node {sesam_api}")
zip_payload()
upload_payload()
else:
logging.info("No change, doing nothing.")

logging.info("Sleeping for {} seconds".format(sleep_interval))
time.sleep(sleep_interval)

0 comments on commit 62dabed

Please sign in to comment.