{"id":17403711,"url":"https://github.com/link89/jenkins-fire-cli","last_synced_at":"2025-03-27T22:34:16.284Z","repository":{"id":81055217,"uuid":"535928509","full_name":"link89/jenkins-fire-cli","owner":"link89","description":"A Jenkins command line tool built with python-fire that wraps the jenkins-cli and job-dsl-core.","archived":false,"fork":false,"pushed_at":"2022-09-15T03:42:49.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T00:47:50.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/link89.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-13T02:30:33.000Z","updated_at":"2022-09-13T06:56:51.000Z","dependencies_parsed_at":"2023-03-25T13:34:18.228Z","dependency_job_id":null,"html_url":"https://github.com/link89/jenkins-fire-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link89%2Fjenkins-fire-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link89%2Fjenkins-fire-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link89%2Fjenkins-fire-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/link89%2Fjenkins-fire-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/link89","download_url":"https://codeload.github.com/link89/jenkins-fire-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245937239,"owners_count":20696974,"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":[],"created_at":"2024-10-16T19:07:22.682Z","updated_at":"2025-03-27T22:34:16.204Z","avatar_url":"https://github.com/link89.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jenkins-fire-cli\nA Jenkins command line tool built with python-fire that wraps the jenkins-cli and job-dsl-core.\n\n## Prerequisite \nYou need to ensure `Java` and `Python\u003e=3.8` are in the PATH to use this tool. \n\n## Install\nIt can be installed by the following command.\n```bash\npip install jenkins-fire-cli\n```\n\n## Get Started\n\n### Provision\nYou need to set Jenkins site url and user credential for the first time\n\n```bash\njenkins-fire-cli config set jenkins.url http://your-jenkins-site\njenkins-fire-cli config set user.name john.doe\n\n# user.token is optional, but you will be asked to type it when it is missing\n# either api token or user's password will be OK, but it's recommneded to use token for the sake of security\njenkins-fire-cli config set user.token passw0rd \n\n# check configuration by running\njenkins-fire-cli config show\n```\n\nBefore you start to run Jenkins commands, don't forget to run the `init` command for the first time, which will download `jenkins-cli.jar` and `job-dsl-core-standalone.jar` automatically.\n\n```bash\njenkins-fire-cli init\n```\n\n### Run jenkins-cli commands\nAs `jenkins-fire-cli` is a wrapper of `jenkins-cli` and `job-dsl-core` to make them easier to use, \nyou can find the document of `jenkins-cli` in your Jenkins site or run the following command to open it in browser.\n\n```bash\njenkins-fire-cli doc --open\n```\n\nYou can use the `run` sub-command to execute `jenkins-cli` command, for example\n\n```bash\njenkins-fire-cli run list-jobs  \n# It is equivalent to \"java -jar jenkins-cli.jar -s http://localhost:9090/ -webSocket list-jobs\"\n\n# For command with multiple arguments you need to quote them with \"\"\njenkins-fire-cli run \"get-job my-job\"  \n```\n\n### Run job-dsl commands\n\nYou can also run the `job-dsl` command. For example you have a `job-dsl` script with the following content.\n\n```groovy\n// file: /tmp/sample.dsl\npipelineJob('job-dsl-plugin') {\n  definition {\n    cpsScm {\n      scm {\n        git {\n          remote {\n            url('https://github.com/jenkinsci/job-dsl-plugin.git')\n          }\n          branch('*/master')\n        }\n      }\n      lightweight()\n    }\n  }\n}\n```\n\nThen you can run the following command to generate the job XML configuration.\n\n```bash\njenkins-fire-cli dsl /tmp/sample-dsl.groovy\n```\n\nThen you will find a file named `job-dsl-plugin.xml` is generated. \nNow you can run another command to create this job in jenkins:\n\n```bash\njenkins-file-cli run 'create-job job-dsl-plugin' \u003c job-dsl-plugin.xml\n```\n\nThen you will find a new job named `job-dsl-plugin` has been created in jenkins.\n\n### Environment Variables\n\nIf you want to use this tool in CI system, you may use the following environment variable instead of global setting.\n\n* `JENKINS_USER_ID`: equivalent to `user.name`\n* `JENKINS_API_TOKEN`: equvalent to `user.token`\n* `JENKINS_URL`: equvalent to `jenkins.url`\n* `JENKINS_JOB_DSL_PATH`: path to the job-dsl jar package, you may skip `init` when this is set \n* `JNEKINS_CLI_PATH`: path to the jenkins-cli jar package, you may skip `init` when this is set \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flink89%2Fjenkins-fire-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flink89%2Fjenkins-fire-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flink89%2Fjenkins-fire-cli/lists"}