forked from jenkinsci/pipeline-model-definition-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jenkinsci#45 from abayer/jenkins-39394
JENKINS-39394 - Get rid of notifications, rename postBuild to post
- Loading branch information
Showing
59 changed files
with
248 additions
and
937 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
79 changes: 79 additions & 0 deletions
79
...ine-model-api/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ASTSchema.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,79 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2016, CloudBees, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package org.jenkinsci.plugins.pipeline.modeldefinition; | ||
|
||
import com.github.fge.jsonschema.exceptions.ProcessingException; | ||
import com.github.fge.jsonschema.main.JsonSchema; | ||
import com.github.fge.jsonschema.main.JsonSchemaFactory; | ||
import hudson.Extension; | ||
import hudson.model.RootAction; | ||
import hudson.util.TimeUnit2; | ||
import org.kohsuke.stapler.StaplerRequest; | ||
import org.kohsuke.stapler.StaplerResponse; | ||
|
||
import javax.servlet.ServletException; | ||
import java.io.IOException; | ||
|
||
/** | ||
* Endpoint for exposing the AST JSON schema. | ||
* | ||
* @author Andrew Bayer | ||
*/ | ||
@Extension | ||
public class ASTSchema implements RootAction { | ||
public static final String AST_SCHEMA_URL = "pipeline-model-schema"; | ||
|
||
@Override | ||
public String getUrlName() { | ||
return AST_SCHEMA_URL; | ||
} | ||
|
||
@Override | ||
public String getIconFileName() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return null; | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
public void doJson(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { | ||
rsp.serveFile(req, getClass().getResource("/ast-schema.json")); | ||
} | ||
|
||
/** | ||
* Get the Pipeline Config AST JSON schema. | ||
* | ||
* @return the schema in {@link JsonSchema} form. | ||
* @throws ProcessingException | ||
*/ | ||
public static JsonSchema getJSONSchema() throws ProcessingException { | ||
final JsonSchemaFactory factory = JsonSchemaFactory.byDefault(); | ||
return factory.getJsonSchema("resource:/ast-schema.json"); | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
* Corresponds to {@code Notifications} or {@code PostBuild} | ||
* | ||
* @author Robert Sandell <[email protected]>. | ||
* @see ModelASTNotifications | ||
* @see ModelASTPostStage | ||
* @see ModelASTPostBuild | ||
*/ | ||
public abstract class ModelASTBuildConditionsContainer extends ModelASTElement { | ||
|
33 changes: 0 additions & 33 deletions
33
...c/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTNotifications.java
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.