default String getArtifactCommit(String deploymentName) { SpinnakerArtifact artifact = getArtifact(); return getArtifactService().getArtifactCommit(deploymentName, artifact); }
public String getGoogleImageProject(String deploymentName, SpinnakerArtifact artifact) { BillOfMaterials.ArtifactSources artifactSources = artifactService.getArtifactSources(deploymentName, artifact); return artifactSourcesConfig.mergeWithBomSources(artifactSources).getGoogleImageProject(); } }
private GateProfileFactory getGateProfileFactory(String deploymentName) { String version = getArtifactService().getArtifactVersion(deploymentName, SpinnakerArtifact.GATE); try { if (Versions.lessThan(version, BOOT_UPGRADED_VERSION)) { return boot128ProfileFactory; } } catch (IllegalArgumentException iae) { log.warn("Could not resolve Gate version, using `boot154ProfileFactory`."); } return boot154ProfileFactory; }
@RequestMapping(value = "/publishLatest", method = RequestMethod.PUT) DaemonTask<Halconfig, Void> publishLatest( @RequestParam(required = false) String latestSpinnaker, @RequestParam(required = false) String latestHalyard, @RequestBody String _ignored) { StaticRequestBuilder<Void> builder = new StaticRequestBuilder<>(() -> { if (!StringUtils.isEmpty(latestSpinnaker)) { artifactService.publishLatestSpinnaker(latestSpinnaker); } if (!StringUtils.isEmpty(latestHalyard)) { artifactService.publishLatestHalyard(latestHalyard); } return null; }); return DaemonTaskHandler.submitTask(builder::build, "Update the latest version"); }
public BillOfMaterials.ArtifactSources getArtifactSources(String deploymentName, SpinnakerArtifact artifact) { BillOfMaterials bom = getBillOfMaterials(deploymentName); BillOfMaterials.ArtifactSources baseline = bom.getArtifactSources(); BillOfMaterials.ArtifactSources overrides = bom.getArtifactSources(artifact.getName()); return mergeArtifactSources(baseline, overrides); }
/** * Should use {@link #getArtifactSources(String, SpinnakerArtifact)} when it supports all types of * deployments. * * To future devs: In order to remove this method for good, the remaining callers of this method * need to be able to incorporate different repository sources. As of this writing (May 2018) the * {@link com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.debian.LocalDebianServiceProvider} * and the * {@link com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.bake.debian.BakeDebianServiceProvider} * are the two hold outs. */ @Deprecated public BillOfMaterials.ArtifactSources getArtifactSources(String deploymentName) { BillOfMaterials bom = getBillOfMaterials(deploymentName); return bom.getArtifactSources(); }
public void publishVersion(Version version) { if (googleWriteableProfileRegistry == null) { throw new HalException(FATAL, NO_WRITER_ENABLED); } Versions versionsCollection = versionsService.getVersions(); if (versionsCollection == null) { throw new HalException(FATAL, NO_GCS_ENABLED); } deleteVersion(versionsCollection, version.getVersion()); versionsCollection.getVersions().add(version); googleWriteableProfileRegistry.writeVersions(yamlParser.dump(relaxedObjectMapper.convertValue(versionsCollection, Map.class))); }
@RequestMapping(value = "/deprecateVersion", method = RequestMethod.PUT) DaemonTask<Halconfig, Void> deprecateVersion( @RequestParam(required = false) String illegalReason, @RequestBody Versions.Version version) { StaticRequestBuilder<Void> builder = new StaticRequestBuilder<>( () -> { artifactService.deprecateVersion(version, illegalReason); return null; }); return DaemonTaskHandler.submitTask(builder::build, "Deprecate version " + version.getVersion()); }
@RequestMapping(value = "/publishVersion", method = RequestMethod.PUT) DaemonTask<Halconfig, Void> publishVersion( @RequestBody Versions.Version version) { StaticRequestBuilder<Void> builder = new StaticRequestBuilder<>(() -> { artifactService.publishVersion(version); return null; }); return DaemonTaskHandler.submitTask(builder::build, "Publish a new version " + version.getVersion()); }
public BillOfMaterials.ArtifactSources getArtifactSources(String deploymentName, SpinnakerArtifact artifact) { BillOfMaterials bom = getBillOfMaterials(deploymentName); BillOfMaterials.ArtifactSources baseline = bom.getArtifactSources(); BillOfMaterials.ArtifactSources overrides = bom.getArtifactSources(artifact.getName()); return mergeArtifactSources(baseline, overrides); }
/** * Should use {@link #getArtifactSources(String, SpinnakerArtifact)} when it supports all types of * deployments. * * To future devs: In order to remove this method for good, the remaining callers of this method * need to be able to incorporate different repository sources. As of this writing (May 2018) the * {@link com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.debian.LocalDebianServiceProvider} * and the * {@link com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.bake.debian.BakeDebianServiceProvider} * are the two hold outs. */ @Deprecated public BillOfMaterials.ArtifactSources getArtifactSources(String deploymentName) { BillOfMaterials bom = getBillOfMaterials(deploymentName); return bom.getArtifactSources(); }
public void publishVersion(Version version) { if (googleWriteableProfileRegistry == null) { throw new HalException(FATAL, NO_WRITER_ENABLED); } Versions versionsCollection = versionsService.getVersions(); if (versionsCollection == null) { throw new HalException(FATAL, NO_GCS_ENABLED); } deleteVersion(versionsCollection, version.getVersion()); versionsCollection.getVersions().add(version); googleWriteableProfileRegistry.writeVersions(yamlParser.dump(relaxedObjectMapper.convertValue(versionsCollection, Map.class))); }
private GateProfileFactory getGateProfileFactory(String deploymentName) { String version = getArtifactService().getArtifactVersion(deploymentName, SpinnakerArtifact.GATE); try { if (Versions.lessThan(version, BOOT_UPGRADED_VERSION)) { return boot128ProfileFactory; } } catch (NumberFormatException nfe) { log.warn("Could not resolve Gate version, using `boot154ProfileFactory`."); } return boot154ProfileFactory; }
public String getGoogleImageProject(String deploymentName, SpinnakerArtifact artifact) { BillOfMaterials.ArtifactSources artifactSources = artifactService.getArtifactSources(deploymentName, artifact); return artifactSourcesConfig.mergeWithBomSources(artifactSources).getGoogleImageProject(); } }
public String getArtifactCommit(String deploymentName, SpinnakerArtifact artifact) { return getBillOfMaterials(deploymentName).getArtifactCommit(artifact.getName()); }
public void deprecateVersion(Version version, String illegalReason) { if (googleWriteableProfileRegistry == null) { throw new HalException(FATAL, NO_WRITER_ENABLED); } Versions versionsCollection = versionsService.getVersions(); if (versionsCollection == null) { throw new HalException(FATAL, NO_GCS_ENABLED); } deleteVersion(versionsCollection, version.getVersion()); if (!StringUtils.isEmpty(illegalReason)) { List<Versions.IllegalVersion> illegalVersions = versionsCollection.getIllegalVersions(); if (illegalVersions == null) { illegalVersions = new ArrayList<>(); } illegalVersions.add(new Versions.IllegalVersion().setVersion(version.getVersion()).setReason(illegalReason)); versionsCollection.setIllegalVersions(illegalVersions); } googleWriteableProfileRegistry.writeVersions(yamlParser.dump(relaxedObjectMapper.convertValue(versionsCollection, Map.class))); }
default String getArtifactCommit(String deploymentName) { SpinnakerArtifact artifact = getArtifact(); return getArtifactService().getArtifactCommit(deploymentName, artifact); }
private String getArtifactId(String deploymentName) { String artifactName = getArtifact().getName(); String version = artifactService.getArtifactVersion(deploymentName, getArtifact()); return String.join(":", artifactName, version); } }
public String getDockerRegistry(String deploymentName, SpinnakerArtifact artifact) { BillOfMaterials.ArtifactSources artifactSources = artifactService.getArtifactSources(deploymentName, artifact); return artifactSourcesConfig.mergeWithBomSources(artifactSources).getDockerRegistry(); }
public String getArtifactVersion(String deploymentName, SpinnakerArtifact artifact) { return getBillOfMaterials(deploymentName).getArtifactVersion(artifact.getName()); }