Example #1
0
def _create_build_with_latest_version():
    version = _get_latest_commcare_build_version()

    commcare_version_build = next((cc_build
                                   for cc_build in CommCareBuild.all_builds()
                                   if cc_build.version == version), None)
    if commcare_version_build is None:
        CommCareBuild.create_without_artifacts(version, None)
        _update_commcare_build_menu(version)
Example #2
0
 def _create_build_with_version(self, version):
     if any(build.version == version
            for build in CommCareBuild.all_builds()):
         self.stdout.write(
             f"A build for version {version} already exists. You're up-to-date!"
         )
     else:
         CommCareBuild.create_without_artifacts(version, None)
         _update_commcare_build_menu(version)
         self.stdout.write(f"Added build for version {version}.")