protected Providers getImageProviders(String version, String deploymentName) { Providers providers; try (InputStream is = profileRegistry.readProfile(getArtifact().getName(), version, "images.yml")) { Object obj = yamlParser.load(is); providers = objectMapper.convertValue(obj, Providers.class); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Unable to read images.yml for rosco: " + e.getMessage(), e); } File f = halconfigDirectoryStructure.getUserProfilePath(deploymentName).resolve("images-local.yml").toFile(); Providers localProviders = null; if (f.exists()) { // Need just the $PROVIDER.bakeryDefaults.baseImages list items to merge in with the content from rosco/halconfig/images.yml. try (FileInputStream fis = new FileInputStream(f)) { Object localObj = yamlParser.load(fis); localProviders = objectMapper.convertValue(localObj, Providers.class); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Unable to read images-local.yml for rosco: " + e.getMessage(), e); } } if (localProviders != null) { augmentProvidersBaseImages(providers, localProviders); } return providers; }
public Versions getVersions() { try { return profileRegistry.readVersions(); } catch (IOException e) { throw new HalException( new ConfigProblemBuilder(FATAL, "Could not load \"versions.yml\" from config bucket: " + e.getMessage() + ".").build()); } }
public InputStream readProfile(String artifactName, String version, String profileName) throws IOException { return pickProfileReader(version).readProfile(artifactName, version, profileName); }
public BillOfMaterials getBillOfMaterials(String version) { if (version == null || version.isEmpty()) { throw new HalException( new ConfigProblemBuilder(FATAL, "You must pick a version of Spinnaker to deploy.") .build() ); } try { return profileRegistry.readBom(version); } catch (RetrofitError | IOException e) { throw new HalException( new ConfigProblemBuilder(FATAL, "Unable to retrieve the Spinnaker bill of materials for version \"" + version + "\": " + e.getMessage()) .build() ); } }
is = profileRegistry.readArchiveProfile(artifact.getName(), version, archiveName); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Error retrieving contents of archive " + archiveName + ".tar.gz", e);
public BillOfMaterials getBillOfMaterials(String version) { if (version == null || version.isEmpty()) { throw new HalException( new ConfigProblemBuilder(FATAL, "You must pick a version of Spinnaker to deploy.") .build() ); } try { return profileRegistry.readBom(version); } catch (RetrofitError | IOException e) { throw new HalException( new ConfigProblemBuilder(FATAL, "Unable to retrieve the Spinnaker bill of materials for version \"" + version + "\": " + e.getMessage()) .build() ); } }
is = profileRegistry.readArchiveProfile(artifact.getName(), version, archiveName); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Error retrieving contents of archive " + archiveName + ".tar.gz", e);
protected Providers getImageProviders(String version, String deploymentName) { Providers providers; try (InputStream is = profileRegistry.readProfile(getArtifact().getName(), version, "images.yml")) { Object obj = yamlParser.load(is); providers = objectMapper.convertValue(obj, Providers.class); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Unable to read images.yml for rosco: " + e.getMessage(), e); } File f = halconfigDirectoryStructure.getUserProfilePath(deploymentName).resolve("images-local.yml").toFile(); Providers localProviders = null; if (f.exists()) { // Need just the $PROVIDER.bakeryDefaults.baseImages list items to merge in with the content from rosco/halconfig/images.yml. try (FileInputStream fis = new FileInputStream(f)) { Object localObj = yamlParser.load(fis); localProviders = objectMapper.convertValue(localObj, Providers.class); } catch (IOException e) { throw new HalException(Problem.Severity.FATAL, "Unable to read images-local.yml for rosco: " + e.getMessage(), e); } } if (localProviders != null) { augmentProvidersBaseImages(providers, localProviders); } return providers; }
public Versions getVersions() { try { return profileRegistry.readVersions(); } catch (IOException e) { throw new HalException( new ConfigProblemBuilder(FATAL, "Could not load \"versions.yml\" from config bucket: " + e.getMessage() + ".").build()); } }
public InputStream readArchiveProfile(String artifactName, String version, String profileName) throws IOException { return pickProfileReader(version).readArchiveProfile(artifactName, version, profileName); }
@Override protected Profile getBaseProfile(String name, String version, String outputFile) { try { return new Profile(name, version, outputFile, IOUtils.toString(profileRegistry.readProfile(getArtifact().getName(), version, name)) ); } catch (RetrofitError | IOException e) { throw new HalException( new ConfigProblemBuilder(FATAL, "Unable to retrieve profile \"" + name + "\": " + e.getMessage()) .build(), e ); } } }
public BillOfMaterials readBom(String version) throws IOException { return pickProfileReader(version).readBom(version); }
@Override protected Profile getBaseProfile(String name, String version, String outputFile) { try { return new Profile(name, version, outputFile, IOUtils.toString(profileRegistry.readProfile(getArtifact().getName(), version, name)) ); } catch (RetrofitError | IOException e) { throw new HalException( new ConfigProblemBuilder(FATAL, "Unable to retrieve profile \"" + name + "\": " + e.getMessage()) .build(), e ); } } }