| from steps import git_metadata, machine_setup, gsutil_setup |
| import os |
| from enum import Enum |
| |
| class CurrentToolchain(Enum): |
| GIT = "GIT" |
| GCLOUD = "GCLOUD" |
| |
| class Prebuild(): |
| def __init__(self): |
| self.current_toolchain_image = os.getenv("CURRENT_TOOLCHAIN_IMAGE") |
| |
| def run_prebuild(self): |
| if CurrentToolchain(self.current_toolchain_image) == CurrentToolchain.GIT: |
| git_metadata_step = git_metadata.GitMetadata() |
| machine_setup_step = machine_setup.MachineSetup() |
| |
| git_metadata_step.run_script() |
| machine_setup_step.run_script() |
| |
| elif CurrentToolchain(self.current_toolchain_image) == CurrentToolchain.GCLOUD: |
| gsutil_setup_step = gsutil_setup.GsutilSetup() |
| gsutil_setup_step.run_script() |
| |
| def main(): |
| prebuild = Prebuild() |
| prebuild.run_prebuild() |
| |
| if __name__ == "__main__": |
| main() |