-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-57903]- Refactor PromotionConditionDescriptor extension Point to make it Pipeline Compatible. #137
Open
dernDren161
wants to merge
25
commits into
jenkinsci:master
Choose a base branch
from
dernDren161:final
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
72aca25
Update Jenkins Core requirement to 2.60.3, use the modern Parent POM
oleg-nenashev daa7a82
Fix Jenkinsfile
oleg-nenashev 0a9e676
Update Jenkins Core to 2.138.x and cleanup Jenkins instance access AP…
oleg-nenashev 084e389
Merge branch 'facelift' of https://github.com/jenkinsci/promoted-buil…
oleg-nenashev 5666eef
More FindBugs cleanup
oleg-nenashev c3965f0
[JENKINS-57839] - Initial PromotionBadge compatibility code for Jenki…
oleg-nenashev 9c51d9e
[JENKINS-57903]- Refactor PromotionConditionDescriptor class and othe…
dernDren161 69f69be
Delete README.txt
oleg-nenashev 7317087
Add badges to README
oleg-nenashev 162697b
Remove Contributing from README
oleg-nenashev 68dd6c8
Create CONTRIBUTING.md
oleg-nenashev fb198ac
Merge pull request #138 from jenkinsci/doc-cleanup
oleg-nenashev d1ce53d
Maven Fix- For the PromotionConditionDescriptor
dernDren161 8aa5cec
Stub code for logic review
dernDren161 bca15f9
Fix tests after ugrading the Jenkins and JTH baseline
oleg-nenashev e6b87eb
FindBugs: Cleanup unrequired checks in Groovy conditions
oleg-nenashev bd7af12
Merge pull request #124 from jenkinsci/facelift
oleg-nenashev 4ebbf5e
[maven-release-plugin] prepare release promoted-builds-3.3
oleg-nenashev 64a5bd4
[maven-release-plugin] prepare for next development iteration
oleg-nenashev 307199d
Merge branches
oleg-nenashev 0eeda41
Fix compilation errors in AddPromotionBadge
oleg-nenashev 2f6b639
Restore code from d1ce53de6aa5622899b21768cca4e813c0fab024 by @dernDr…
oleg-nenashev dd6de8a
Resolve Maven upper bounds issues
oleg-nenashev 8e4fca7
Fix compilation issues in GroovyConditionDescriptor
oleg-nenashev 4fa0b38
PR chnages w.r.t the reviews
dernDren161 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Contributing | ||
=============== | ||
|
||
* If you want to add a new feature or to fix a defect, just submit a pull request. | ||
The [pull request template](.github/PULL_REQUEST_TEMPLATE.md) documents usual expectations from pull requests in this project | ||
* Making new releases is covered in [the "Hosting Plugins" wiki page](https://wiki.jenkins-ci.org/display/JENKINS/Hosting+Plugins). | ||
* There are a lot a issues and features that need attention, the JIRA bug tracker is listed on [the wiki page](https://wiki.jenkins-ci.org/display/JENKINS/Promoted+Builds+Plugin). |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// Builds a module using https://github.com/jenkins-infra/pipeline-library | ||
buildPlugin() | ||
buildPlugin(configurations: buildPlugin.recommendedConfigurations()) |
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 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
120 changes: 120 additions & 0 deletions
120
src/main/java/hudson/plugins/promoted_builds/AddPromotionBadge.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,120 @@ | ||
package hudson.plugins.promoted_builds; | ||
|
||
import hudson.EnvVars; | ||
import hudson.Extension; | ||
import hudson.FilePath; | ||
import hudson.Launcher; | ||
import hudson.model.*; | ||
import hudson.tasks.*; | ||
import jenkins.tasks.SimpleBuildStep; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
import org.kohsuke.stapler.DataBoundSetter; | ||
|
||
import java.io.IOException; | ||
import java.io.PrintStream; | ||
|
||
public class AddPromotionBadge extends Recorder implements SimpleBuildStep { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is still in the production scope, needs to be moved |
||
|
||
private String boxName = "Promotion Badges"; | ||
private boolean gold; | ||
private boolean silver; | ||
|
||
@Extension | ||
public static final DescriptorImpl DESCRIPTOR = new DescriptorImpl(); | ||
|
||
@DataBoundConstructor | ||
public AddPromotionBadge(String boxName, boolean gold, boolean silver){ | ||
this.boxName = boxName; | ||
this.gold = gold; | ||
this.silver = silver; | ||
} | ||
|
||
public String getBoxName(){ | ||
return boxName; | ||
} | ||
|
||
@DataBoundSetter | ||
public void setBoxName(String boxName){ | ||
this.boxName = boxName; | ||
} | ||
|
||
|
||
public boolean getGold(){ | ||
return gold; | ||
} | ||
|
||
@DataBoundSetter | ||
public void setGold(boolean gold){ | ||
this.gold = gold; | ||
} | ||
|
||
public boolean getSilver(){ | ||
return silver; | ||
} | ||
|
||
@DataBoundSetter | ||
public void setSilver(boolean silver){ | ||
this.silver = silver; | ||
} | ||
|
||
public BuildStepMonitor getRequiredMonitorService(){ | ||
return BuildStepMonitor.NONE; | ||
} | ||
|
||
|
||
@Override | ||
public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher, final TaskListener listener) | ||
throws InterruptedException, IOException { | ||
|
||
PrintStream logger = listener.getLogger(); | ||
logger.println("Started initialization"); | ||
|
||
Result buildResult = build.getResult(); | ||
|
||
if (Result.SUCCESS.equals(buildResult)) { | ||
logger.println("The pipeline build is successful!!"); | ||
|
||
if(gold == true){ | ||
// How to assign actual badge icons?? | ||
} | ||
|
||
} | ||
|
||
String temp; | ||
|
||
if(build instanceof AbstractBuild){ | ||
EnvVars vars = build.getEnvironment(listener); | ||
vars.overrideAll(((AbstractBuild)build).getBuildVariables()); | ||
temp = vars.expand(boxName); | ||
}else{ | ||
temp = boxName; | ||
} | ||
|
||
logger.println("Starting the pipeline build"); | ||
logger.println("Will assign badges once the pipeline build is successful in promotion"); | ||
|
||
} | ||
|
||
|
||
public static final class DescriptorImpl extends BuildStepDescriptor<Publisher>{ | ||
|
||
private DescriptorImpl(){ | ||
super(AddPromotionBadge.class); | ||
} | ||
|
||
public String getDisplayName(){ | ||
return "Add Promotion Badges"; | ||
} | ||
|
||
|
||
@Override | ||
public boolean isApplicable(Class<? extends AbstractProject> a){ | ||
return true; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The history got messed up after merge by me. Should not impact the delivery