Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Jenkins Env #6387

Merged
merged 2 commits into from
Sep 17, 2024
Merged

Fix Jenkins Env #6387

merged 2 commits into from
Sep 17, 2024

Conversation

AmitPhulera
Copy link
Contributor

I noticed while running commands for Jenkins env, the command failed because fab-settings.yml did not exist for the command.
And then when the command ran it errored for dummy hosts because they do not exist. So the PR fixes those issues.

Environments Affected

Jenkins

these were causing error in running ansible commands on the environments
Copy link
Contributor

@gherceg gherceg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remind me why we still need an empty fab-settings.yml file in environments?

@AmitPhulera
Copy link
Contributor Author

I think commcare cloud expects a fab-settings.yml file in every environment.

Traceback (most recent call last):
File "/Users/amitphulera/.pyenv/versions/cchq/bin/cchq", line 33, in
sys.exit(load_entry_point('commcare-cloud', 'console_scripts', 'cchq')())
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/commcare_cloud.py", line 274, in main
exit_code = call_commcare_cloud()
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/commcare_cloud.py", line 243, in call_commcare_cloud
exit_code = command.run(args, unknown_args)
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/commands/ansible/ansible_playbook.py", line 368, in run
return AnsiblePlaybook(self.parser).run(args, unknown_args)
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/commands/ansible/ansible_playbook.py", line 82, in run
return run_ansible_playbook(
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/commands/ansible/ansible_playbook.py", line 172, in run_ansible_playbook
return run_action_with_check_mode(run_check, run_apply, skip_check, quiet, always_skip_check)
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/commands/ansible/helpers.py", line 156, in run_action_with_check_mode
exit_code = run_check()
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/commands/ansible/ansible_playbook.py", line 162, in run_check
return ansible_playbook(playbook, '--check', *unknown_args)
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/commands/ansible/ansible_playbook.py", line 155, in ansible_playbook
with environment.generated_yml():
File "/Users/amitphulera/.pyenv/versions/3.10.11/lib/python3.10/contextlib.py", line 135, in enter
return next(self.gen)
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/environment/main.py", line 361, in generated_yml
self._create_generated_yml()
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/environment/main.py", line 380, in _create_generated_yml
'ignore_kafka_checkpoint_warning': self.fab_settings_config.ignore_kafka_checkpoint_warning,
File "/Users/amitphulera/.pyenv/versions/cchq/lib/python3.10/site-packages/memoized.py", line 20, in _memoized
cache[key] = value = fn(*args, **kwargs)
File "/Users/amitphulera/commcare-cloud/src/commcare_cloud/environment/main.py", line 258, in fab_settings_config
with open(self.paths.fab_settings_yml, encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/amitphulera/commcare-cloud/environments/jenkins/fab-settings.yml'

@AmitPhulera AmitPhulera merged commit eb8b7e7 into master Sep 17, 2024
2 checks passed
@AmitPhulera AmitPhulera deleted the ap/fix-jenkins-env branch September 17, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants