Skip to content
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

Create new node #15

Merged
merged 1 commit into from
Apr 11, 2018
Merged

Create new node #15

merged 1 commit into from
Apr 11, 2018

Conversation

VermaSh
Copy link
Contributor

@VermaSh VermaSh commented Apr 2, 2018

I have added create new node part of NodeMaintaince job. This is a standalone job that calls the API to add new node. Along with the new job I have also fixed a few bugs in NodeHelper API.

@VermaSh VermaSh added the enhancement New feature or request label Apr 2, 2018
@VermaSh VermaSh added this to To do in openjdk-jenkins-helper via automation Apr 2, 2018
@karianna karianna moved this from To do to In progress in openjdk-jenkins-helper Apr 2, 2018
@VermaSh VermaSh moved this from In progress to Waiting on PR Merge in openjdk-jenkins-helper Apr 6, 2018
Copy link
Contributor

@AdamBrousseau AdamBrousseau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional deskside review

static final String WGET_SLAVE_JAR = "\"wget -q --no-check-certificate -O slave.jar ${SLAVE_JAR_LOCATION} ; java -jar slave.jar\"";
static final String SSH_COMMAND = "ssh -C -i ${SSH_KEY_LOCATION} <userName/>@";
static final String SSH_KEY_LOCATION = "";
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new line at the end of the file.

List<String> newMachines = new ArrayList<String>();

node {
stage('jenkins made me do it') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a more descriptive stage name?

// This will be used to get the names of machines that need to have description updated
newMachines.add(newMachineName);
} else {
echo "Machine(${machines[index]}) already exists."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reverse this if to have the error at the start

if (launcher.getClass().toString().contains("slaves.CommandLauncher")) {
for (ScriptApproval.PendingScript script : scriptSet) {
// TODO: Search for entire string instead of a part
if (script.script.contains("ssh -C -i /data/jenkins/J9_Build/home/.ssh/j9build.key j9build@" + machineIPs[index])) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this string hardcoded here, shouldn't we be using the Constants file?

Copy link
Contributor

@AdamBrousseau AdamBrousseau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing new line at end of Contstants.groovy, other than that lgtm

- Added CreateNewNode job
- Updated readme file to include the new job
- Moved string constants to the vars directory of the Node helper API
- added a input parameter for SSH key id in CreateNewNode

issue adoptium#10

Signed-off-by: Shubham Verma <shubhamv.sv@gmail.com>
@AdamBrousseau AdamBrousseau merged commit 9ac4cf3 into adoptium:master Apr 11, 2018
openjdk-jenkins-helper automation moved this from Waiting on PR Merge to Done Apr 11, 2018
@VermaSh VermaSh deleted the CreateNewNode branch June 18, 2018 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants