{"id":21979995,"url":"https://github.com/jenkinsci/agent-setup-plugin","last_synced_at":"2025-04-30T04:35:07.439Z","repository":{"id":1681003,"uuid":"2408256","full_name":"jenkinsci/agent-setup-plugin","owner":"jenkinsci","description":"Prepare Jenkins agents for use","archived":false,"fork":false,"pushed_at":"2025-03-02T15:05:00.000Z","size":272,"stargazers_count":10,"open_issues_count":0,"forks_count":23,"subscribers_count":99,"default_branch":"master","last_synced_at":"2025-03-30T12:33:57.892Z","etag":null,"topics":["adopt-this-plugin","agents"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/slave-setup/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-09-18T05:32:30.000Z","updated_at":"2025-03-02T14:57:27.000Z","dependencies_parsed_at":"2023-01-11T16:05:27.536Z","dependency_job_id":"ed90f9b9-5453-44f5-846b-b7ac438803d8","html_url":"https://github.com/jenkinsci/agent-setup-plugin","commit_stats":null,"previous_names":["jenkinsci/agent-setup-plugin","jenkinsci/slave-setup-plugin"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fagent-setup-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fagent-setup-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fagent-setup-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fagent-setup-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/agent-setup-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644262,"owners_count":21620617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adopt-this-plugin","agents"],"created_at":"2024-11-29T17:09:00.248Z","updated_at":"2025-04-30T04:35:07.416Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agent Setup plugin\n\nThis plugin prepares agents for build execution by letting you copy\nfiles and execute scripts before the agents are used.\n\nIt also allows you to start and stop agents on demand from the controller.\n\n## Label-based setup\n\nThe agent setup plugin gets executed for an agent, if the given label\nexpression matches and on:\n\n-   Jenkins startup as an agent gets connected.\n-   Save of the Jenkins configuration page if the \"deploy on save now\"\n    checkbox is checked.\n-   New or re-connection of an agent.\n\nWhen you install this plugin, it adds a new system configuration section\nthat lets you specify a list of agent setup items. Each of them have to\nfollowing properties:\n\n| Property                | Description                                                                                                                                                                                                                            | Example                                   |\n|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|\n| pre-launch script       | Name of a pre-launch script relative to the **Jenkins home directory**. This can be used to start the agent machine, before Jenkins tries to ssh it.                                                                                   | ./prelaunch.sh                            |\n| prepare script          | Name of a prepare script relative to the **jenkins home directory** (not the setup files directory, this has changed in v1.6). This can be used to aggregate files into the setup files directory, patch them, pack them, and so on... | ./prepare\\_files.sh                       |\n| setup files directory   | Absolute path to the directory that will be copied to the agent.  The contents of this directory are copied to the home directory of the agent.                                                                                        | /var/jenkins/devAgentFiles                |\n| setup script after copy | Name of the script that should be executed on the agent after all files are copied. The script should be part of the files to copy.                                                                                                    | ./agent\\_setup.sh                         |\n| deploy on save now      | If checked, this agent setup item will be executed on save of the Jenkins configuration page.                                                                                                                                          | checked                                   |\n| Label Expression        | Like jobs an agent setup item can be configured to be executed only on the agents that match the Label Expression.                                                                                                                      | \"agents\", \"!selenium\", \"agent1 OR agent2\" |\n\n![](docs/images/agent-setup.png)\n\nFirst the directory gets copied, then the script gets run. The execution\nof the script is reported to the agent log. When it fails, the agent is\nnot marked as online, so ill-prepared agents never enter the agent pool.\n\nThis provides the administrator of the system an opportunity to prepare\nagents to the state suitable for build execution. This works\nparticularly well in conjunction with tools like Puppet that has\nhigher-level support for this kind of task.\n\n## On-demand agent setup\n\nThis plugin also provides you a per-agent \"start\" and \"stop\" script\nconfiguration specific for on-demand agents.\n\nOnce installed, you will have an additional **\"Launch method\" (1)** for\nthis case:\n\nthis one lets you specify the \"Start\" **(2)** and \"Stop\" **(3)**\nscripts, and on top of that you will be able to **specify the\n\"conventional\" connection (4)** method for reaching the agent after it\nhas been started.\n\nYou will likely also want to specify that you want this node to be\nonline only when Jenkins needs it **(5)**.\n\nThe figure below shows the configuration that you may want to use if\nyour on-demand agent is an Amazon EC2 instance.\n\n\u003cimg src=\"docs/images/system-config.png\" width=\"80%\"\u003e\n\n**NOTE:** if your jobs need the agent to be up for being scheduled, you\nmay end up in a situation where no jobs are scheduled because the agents\nare offline, and the agents are not started because no jobs are\nscheduled.\n\nA common cause of this situation might be that you are polling Git by\nthe Git plugin, and \"Fast remote polling\" (polling from the controller\ninstead of the agent) is disabled or not working. See the [Git plugin\ndocumentation](https://plugins.jenkins.io/git/)\non how to get the \"Fast remote polling\" working.\n\n## Version History\n\n[GitHub releases](https://github.com/jenkinsci/agent-setup-plugin/releases) provides changelogs for recent releases.\n\n[CHANGELOG](https://github.com/jenkinsci/agent-setup-plugin/blob/slave-setup-1.12/CHANGELOG.md) provides changelogs for releases before 2014.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fagent-setup-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fagent-setup-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fagent-setup-plugin/lists"}