diff --git a/README.md b/README.md index 2afd8ca..84b7257 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/service/github-autodeployer.py b/service/github-autodeployer.py index 14356b2..f74d0b1 100755 --- a/service/github-autodeployer.py +++ b/service/github-autodeployer.py @@ -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" @@ -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: @@ -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 @@ -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) \ No newline at end of file