iriusrisk / GoCD-EC2-Elastic-Agent-Plugin

Plugin for GoCD server that will spin up and shut down EC2 instances as its agent workers on demand
Apache License 2.0
12 stars 12 forks source link

Allow the plugin to be used on other Linuxes #16

Closed M-JobPixel closed 3 years ago

M-JobPixel commented 3 years ago

ec2-metadata is an amazon linux specific command. Many other flavours of linux have a similar command ec2metadata, which has slightly different output.

This command is used in Ec2Instance.java to populate the agent autoregister properties. When it fails the created agents fail to join the Elastic pool.

I have created a patch to the userdata string which checks which variant of the command exists on the box and runs the appropriate command.

It works on an AMI I use which is based on Ubuntu 20

I tried pushing my branch back to the repo but got:

remote: Permission to iriusrisk/GoCD-EC2-Elastic-Agent-Plugin.git denied to M-JobPixel.
fatal: unable to access 'https://github.com/iriusrisk/GoCD-EC2-Elastic-Agent-Plugin.git/': The requested URL returned error: 403

I attach here my modified Ec2Instance.java

or let me know what I need to do to make a PR. Ec2Instance.java.zip

VadymIriusRisk commented 3 years ago

Hi @M-JobPixel! Thanks for your dedication! It will be a great improvement. In order to open a pull request you should first make a fork of this repository and after create a pull request from your repository to the official one. This is a standard procedure. More info here: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request

Anyone with read permissions to a repository can create a pull request, but you must have write permissions to create a branch. If you want to create a new branch for your pull request and don't have write permissions to the repository, you can fork the repository first. For more information, see "Creating a pull request from a fork" and "About forks".

We will be waiting for your pull request ;)