{"id":15045894,"url":"https://github.com/cynipe/jenkins-capistrano","last_synced_at":"2025-10-25T10:30:49.030Z","repository":{"id":3571225,"uuid":"4633555","full_name":"cynipe/jenkins-capistrano","owner":"cynipe","description":"The capistrano tasks for Jenkins CI Server","archived":false,"fork":false,"pushed_at":"2014-07-15T04:15:19.000Z","size":472,"stargazers_count":26,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T21:44:39.960Z","etag":null,"topics":["capistrano-plugin","capistrano-tasks","jenkins"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"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/cynipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-12T05:25:26.000Z","updated_at":"2023-09-11T07:06:13.000Z","dependencies_parsed_at":"2022-09-13T17:51:26.828Z","dependency_job_id":null,"html_url":"https://github.com/cynipe/jenkins-capistrano","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/cynipe/jenkins-capistrano","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynipe%2Fjenkins-capistrano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynipe%2Fjenkins-capistrano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynipe%2Fjenkins-capistrano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynipe%2Fjenkins-capistrano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cynipe","download_url":"https://codeload.github.com/cynipe/jenkins-capistrano/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynipe%2Fjenkins-capistrano/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280826207,"owners_count":26397822,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["capistrano-plugin","capistrano-tasks","jenkins"],"created_at":"2024-09-24T20:52:25.502Z","updated_at":"2025-10-25T10:30:48.770Z","avatar_url":"https://github.com/cynipe.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jenkins-capistrano\n\n**Note**: 0.1.0 has incompatible change for Node creation.\nsee [Release Notes](#release-notes) and [Node Configuration](#node-configuration) for detail.\n\n#### Table of Contents\n\n1. [Overview](#overview)\n1. [Installation](#installation)\n1. [Usage](#usage)\n  * [Job Configuration](#job-configuration)\n    * [Disabling Jobs](#disabling-jobs)\n  * [Node Configuration](#node-configuraton)\n    * [Note for the Credentials Plugin and multistage-extension]()\n  * [View Configuration](#view-configuraton)\n1. [Don't know how to write config.xml?](#dont-know-how-to-write-configxml)\n1. [Known Issues](#known-issues)\n  * [Using mutlibyte characters in config.xml](#using-multibyte-characters-in-configxml)\n1. [Todo](#todo)\n1. [Release Notes](#release-notes)\n1. [Contributing](#contributing)\n\n## Overview\n\nThe capistrano tasks for Jenkins CI Server which manages following things:\n\n* Job\n* Node\n* View\n\n## Installation\n\nAdd this line to your application's Gemfile::\n\n```\ngem 'jenkins-capistrano'\n```\n\nAnd then execute::\n\n```\n$ bundle\n```\n\nOr install it yourself as::\n\n```\n$ gem install jenkins-capistrano\n```\n\n## Usage\n\nSee example directory or following instructions.\n\n### Job Configuration\n\nThe following code will creates or updates Jenkins jobs before each deploy task:\n\nconfig directory structure(name your config.xml as a job name):\n```\nconfig\n├── deploy.rb\n└── jenkins\n     └── jobs\n         ├── job-name1.xml\n         ├── job-name2.xml\n         └── job-name3.xml\n```\n\ndeploy.rb:\n```ruby\nset :application, \"your-awesome-app\"\nset :scm, :git\nset :repository,  \"https://github.com/your/repository.git\"\n\nset :jenkins_host, 'http://localhost:8080'\n#set :jenkins_username, '' # default empty\n#set :jenkins_password, '' # default empty\n#set :jenkins_job_config_dir, 'config/jenkins/jobs'\n\nbefore 'deploy', 'jenkins:deploy_jobs'\n```\n\n#### Disabling Jobs\n\nSince 0.0.5, you can disabling jobs using `disabled_jobs` option.\nUse this option with [multistage-extension](\u003chttps://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension\u003e).\n\nPut the following line into `config/deploy/\u003cenv\u003e.rb`:\n```\nset :disabled_jobs, %w(job1 job2)\n```\n\n### Node Configuration\n\nconfig directory structure(name your json file as a node name):\n```\nconfig\n├── deploy.rb\n└── jenkins\n     └── nodes\n         ├── node1.xml\n         ├── node2.xml\n         └── node3.xml\n```\n\nsample node configuration:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cslave\u003e\n  \u003cname\u003eexample\u003c/name\u003e\n  \u003cdescription/\u003e\n  \u003cremoteFS\u003e/home/jenkins\u003c/remoteFS\u003e\n  \u003cnumExecutors\u003e5\u003c/numExecutors\u003e\n  \u003cmode\u003eEXCLUSIVE\u003c/mode\u003e\n  \u003cretentionStrategy class=\"hudson.slaves.RetentionStrategy$Always\"/\u003e\n  \u003clauncher class=\"hudson.plugins.sshslaves.SSHLauncher\" plugin=\"ssh-slaves@1.5\"\u003e\n    \u003chost\u003edev-slave01.local\u003c/host\u003e\n    \u003cport\u003e22\u003c/port\u003e\n    \u003ccredentialsId\u003eCREDENTIAL-ID-FOR-SLAVE\u003c/credentialsId\u003e\n    \u003cjvmOptions\u003e-Dfile.encoding=UTF-8\u003c/jvmOptions\u003e\n  \u003c/launcher\u003e\n  \u003clabel\u003ehello\u003c/label\u003e\n  \u003cnodeProperties\u003e\n    \u003chudson.slaves.EnvironmentVariablesNodeProperty\u003e\n      \u003cenvVars serialization=\"custom\"\u003e\n        \u003cunserializable-parents/\u003e\n        \u003ctree-map\u003e\n          \u003cdefault\u003e\n            \u003ccomparator class=\"hudson.util.CaseInsensitiveComparator\"/\u003e\n          \u003c/default\u003e\n          \u003cint\u003e2\u003c/int\u003e\u003c!-- must specify env var count --\u003e\n          \u003cstring\u003eLANG\u003c/string\u003e\n          \u003cstring\u003eja_JP.UTF-8\u003c/string\u003e\n          \u003cstring\u003eENVIRONMENT\u003c/string\u003e\n          \u003cstring\u003edevelop\u003c/string\u003e\n        \u003c/tree-map\u003e\n      \u003c/envVars\u003e\n    \u003c/hudson.slaves.EnvironmentVariablesNodeProperty\u003e\n  \u003c/nodeProperties\u003e\n\u003c/slave\u003e\n```\n\ndeploy.rb:\n```ruby\nset :application, \"your-awesome-app\"\nset :scm, :git\nset :repository,  \"https://github.com/your/repository.git\"\n\nset :jenkins_host, 'http://localhost:8080'\n# set :jenkins_username, '' # default empty\n# set :jenkins_password, '' # default empty\n# set :jenkins_node_config_dir, 'config/jenkins/nodes'\n\nbefore 'deploy', 'jenkins:config_nodes'\n```\n\n#### Note for the Credentials Plugin and multistage-extension\n\nRecently, Jenkins has changed the slave's auth method to use\n[Credentials Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Plugin),\nand we need to use its id(credentialsId) to create slave configuration.\nHowever, Credentials Plugin doesn't have a REST interface to manage their credentials,\nand credentialsId is different on every Jenkins master.\n\nSo, if you want to use same config.xml against different masters,\nuse the ERB template support to specify correct credentialsId like as following:\n\nconfig/jenkins/nodes/node1.xml.erb:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cslave\u003e\n  \u003cname\u003ebatch-slave\u003c/name\u003e\n  \u003cdescription/\u003e\n  \u003cremoteFS\u003e/home/jenkins\u003c/remoteFS\u003e\n  \u003cnumExecutors\u003e5\u003c/numExecutors\u003e\n  \u003cmode\u003eEXCLUSIVE\u003c/mode\u003e\n  \u003cretentionStrategy class=\"hudson.slaves.RetentionStrategy$Always\"/\u003e\n  \u003clauncher class=\"hudson.plugins.sshslaves.SSHLauncher\" plugin=\"ssh-slaves@1.5\"\u003e\n    \u003chost\u003ebatch-slave\u003c/host\u003e\n    \u003cport\u003e22\u003c/port\u003e\n    \u003ccredentialsId\u003e\u003c%= @credential_id %\u003e\u003c/credentialsId\u003e\n    \u003cjvmOptions\u003e-Dfile.encoding=UTF-8\u003c/jvmOptions\u003e\n  \u003c/launcher\u003e\n  \u003clabel\u003ehello\u003c/label\u003e\n  \u003cnodeProperties/\u003e\n\u003c/slave\u003e\n```\n\nconfig/deploy.rb\n```ruby\nset :application, \"your-awesome-app\"\nset :scm, :git\nset :repository,  \"https://github.com/your/repository.git\"\n\nset :jenkins_host, 'http://localhost:8080'\nbefore 'deploy', 'jenkins:config_nodes'\n```\n\nconfig/deploy/staging.rb:\n```xml\nset :jenkins_template_vars, {\n  :credential_id =\u003e 'STAGING-CREDENTIAL_ID'\n}\n```\n\nconfig/deploy/production.rb:\n```xml\nset :jenkins_template_vars, {\n  :credential_id =\u003e 'PRODUCTION-CREDENTIAL_ID'\n}\n```\n\n### View Configuration\n\nconfig directory structure(name your json file as a node name):\n```\nconfig\n├── deploy.rb\n└── jenkins\n     └── views\n         ├── view1.xml\n         ├── view2.xml\n         └── view3.xml\n```\n\nsample view configuration:\n```xml\n\u003clistView\u003e\n  \u003cname\u003eview1\u003c/name\u003e\n  \u003cfilterExecutors\u003efalse\u003c/filterExecutors\u003e\n  \u003cfilterQueue\u003efalse\u003c/filterQueue\u003e\n  \u003cproperties class=\"hudson.model.View$PropertyList\"/\u003e\n  \u003cjobNames class=\"tree-set\"\u003e\n    \u003ccomparator class=\"hudson.util.CaseInsensitiveComparator\" reference=\"../../../hudson.plugins.view.dashboard.Dashboard/jobNames/comparator\"/\u003e\n  \u003c/jobNames\u003e\n  \u003cjobFilters/\u003e\n  \u003ccolumns\u003e\n    \u003chudson.views.StatusColumn/\u003e\n    \u003chudson.views.WeatherColumn/\u003e\n    \u003chudson.views.JobColumn/\u003e\n    \u003chudson.views.LastSuccessColumn/\u003e\n    \u003chudson.views.LastFailureColumn/\u003e\n    \u003chudson.views.LastDurationColumn/\u003e\n    \u003chudson.views.BuildButtonColumn/\u003e\n  \u003c/columns\u003e\n  \u003cincludeRegex\u003ejob.*\u003c/includeRegex\u003e\n\u003c/listView\u003e\n```\n\ndeploy.rb:\n```ruby\nset :application, \"your-awesome-app\"\nset :scm, :git\nset :repository,  \"https://github.com/your/repository.git\"\n\nset :jenkins_host, 'http://localhost:8080'\n# set :jenkins_username, '' # default empty\n# set :jenkins_password, '' # default empty\n# set :jenkins_node_config_dir, 'config/jenkins/nodes'\n\nbefore 'deploy', 'jenkins:config_views'\n```\n\n## Don't know how to write config.xml?\n\nFirst, create the job, node, or view you want to manage with via the Jenkins UI.\nThen, runnning following command to download them:\n\n```\n# For the job\ncurl -o config/jenkins/jobs/\u003cjob_name\u003e.xml http://jenkins.example.org/job/\u003cjob_name\u003e/config.xml\n\n# For the node\ncurl -o config/jenkins/nodes/\u003cnode_name\u003e.xml http://jenkins.example.org/computer/\u003cnode_name\u003e/config.xml\n\n# For the view\ncurl -o config/jenkins/views/\u003cview_name\u003e.xml http://jenkins.example.org/view/\u003cview_name\u003e/config.xml\n```\n\n## Known Issues\n\n### Using mutlibyte characters in config.xml\n\nUntil [jenkins_api_client PR143](https://github.com/arangamani/jenkins_api_client/pull/143) merged,\nput following code to your Gemfile:\n\n```ruby\n# FIXME after https://github.com/arangamani/jenkins_api_client/pull/143 merged\ngem 'jenkins_api_client', github: 'cynipe/jenkins_api_client', branch: 'fix-multibyte-configs'\n```\n\n## TODO\n\n  * [ ] Reverse config support. something like `cap jenkins:reverse_job`\n  * [ ] CI cucumber tests on Wercker\n  * [ ] Capistrano v3 support\n  * [ ] Make examples triable on user's local\n  * [ ] Collect usage report using Google Analytics to see who uses this tool.\n\n## Release Notes\n\n### 0.1.2\n  * Fix `.` is not allowed for job/node/view name ([#11](https://github.com/cynipe/jenkins-capistrano/pull/11))\n\n### 0.1.1\n  * Abort when json file found in node config and show user-friendly message\n  * Remove unimplemented `jenkin:reverse_config` task\n\n### 0.1.0\n  * **[INCOMPATIBLE CHANGE]** Remove plugin support\n  * **[INCOMPATIBLE CHANGE]** Change node configuration to use config.xml instead of json config\n  * Support erb template for config.xml(need to name the file xxx.xml.erb)\n\n### 0.0.7\n  * Fix disable_job is not working with recent version of Jenkins ([#9](https://github.com/cynipe/jenkins-capistrano/pull/9))\n\n### 0.0.6\n  * Support view management ([726ad3ef](\u003chttps://github.com/cynipe/jenkins-capistrano/commit/726ad3ef817ba15a2d66503ce0dd4bc961ed92e2))\n  * Support plugin management(Experimental) ([4d9964c0](https://github.com/cynipe/jenkins-capistrano/commit/4d9964c00ff95798915484ceb8b5c837b2aa03e8))\n\n### 0.0.5.2\n  * Fix cgi library loading error\n\n## Contributing\n\n1. Fork it\n1. Create your feature branch (`git checkout -b my-new-feature`)\n1. Commit your changes (`git commit -am 'Added some feature'`)\n1. Run Integration tests as following:\n\n    $ vagrant up\n    $ bundle exec cucumber\n\n1. Push to the branch (`git push origin my-new-feature`)\n1. Create new Pull Request\n\n[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/e76247570c952ad3205ca7d6d3f0f7b5 \"githalytics.com\")](http://githalytics.com/cynipe/jenkins-capistrano)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcynipe%2Fjenkins-capistrano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcynipe%2Fjenkins-capistrano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcynipe%2Fjenkins-capistrano/lists"}