-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cf): add SpEL support for cf manifests (#3299)
- Loading branch information
Jammy Louie
committed
Nov 20, 2019
1 parent
8c311b8
commit c36b504
Showing
10 changed files
with
342 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...om/netflix/spinnaker/orca/clouddriver/tasks/providers/cf/CloudFoundryManifestContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2019 Netflix, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.orca.clouddriver.tasks.providers.cf; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; | ||
import com.netflix.spinnaker.kork.artifacts.model.Artifact; | ||
import com.netflix.spinnaker.orca.clouddriver.tasks.manifest.ManifestContext; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Map; | ||
import javax.annotation.Nullable; | ||
import lombok.Builder; | ||
import lombok.Value; | ||
|
||
@Builder(builderClassName = "CloudFoundryManifestContextBuilder", toBuilder = true) | ||
@Value | ||
public class CloudFoundryManifestContext implements ManifestContext { | ||
@Nullable private List<Map<Object, Object>> manifests; | ||
|
||
private Source source; | ||
|
||
private String manifestArtifactId; | ||
private Artifact manifestArtifact; | ||
private String manifestArtifactAccount; | ||
|
||
@Builder.Default private List<String> requiredArtifactIds = Collections.emptyList(); | ||
@Builder.Default private List<BindArtifact> requiredArtifacts = Collections.emptyList(); | ||
|
||
@Builder.Default private boolean skipExpressionEvaluation = false; | ||
|
||
@Override | ||
public List<Map<Object, Object>> getManifests() { | ||
return manifests; | ||
} | ||
|
||
@JsonPOJOBuilder(withPrefix = "") | ||
public static class CloudFoundryManifestContextBuilder {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...main/groovy/com/netflix/spinnaker/orca/clouddriver/tasks/providers/cf/DirectManifest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2019 Pivotal, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License") | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.netflix.spinnaker.orca.clouddriver.tasks.providers.cf; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.PropertyNamingStrategy; | ||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; | ||
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator; | ||
|
||
public abstract class DirectManifest { | ||
static ObjectMapper manifestMapper = | ||
new ObjectMapper( | ||
new YAMLFactory() | ||
.enable(YAMLGenerator.Feature.MINIMIZE_QUOTES) | ||
.enable(YAMLGenerator.Feature.INDENT_ARRAYS)) | ||
.setPropertyNamingStrategy(PropertyNamingStrategy.KEBAB_CASE); | ||
|
||
abstract String toManifestYml(); | ||
} |
Oops, something went wrong.