jenkinsctl 1.0.0__py3-none-any.whl → 1.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of jenkinsctl might be problematic. Click here for more details.

@@ -0,0 +1,172 @@
1
+ Metadata-Version: 2.1
2
+ Name: jenkinsctl
3
+ Version: 1.0.7
4
+ Summary: A command-line tool to interact with Jenkins jobs 🚀
5
+ Home-page: https://github.com/amanshaw4511/jenkinsctl
6
+ License: GPL-3.0-or-later
7
+ Keywords: jenkins,jenkin
8
+ Author: Aman Shaw
9
+ Author-email: amanshaw4511@protonmail.com
10
+ Maintainer: Aman Shaw
11
+ Maintainer-email: amanshaw4511@protonmail.com
12
+ Requires-Python: >=3.8,<4.0
13
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.8
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Requires-Dist: click (>=8.1.7,<9.0.0)
23
+ Requires-Dist: click-completion (>=0.5.2,<0.6.0)
24
+ Requires-Dist: dynaconf (>=3.2.6,<4.0.0)
25
+ Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
26
+ Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
27
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
28
+ Requires-Dist: rich (>=13.8.1,<14.0.0)
29
+ Project-URL: Repository, https://github.com/amanshaw4511/jenkinsctl
30
+ Description-Content-Type: text/markdown
31
+
32
+ ![jenkinsctl](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Jenkins_logo.svg/226px-Jenkins_logo.svg.png?20120629215426)
33
+ # jenkinsctl [![PyPI version](https://badge.fury.io/py/jenkinsctl.svg?)](https://badge.fury.io/py/jenkinsctl) [![Downloads](https://static.pepy.tech/badge/jenkinsctl/week?)](https://pepy.tech/project/jenkinsctl) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
34
+ # jenkinsctl – Jenkins Control Right from Your Terminal 🚀
35
+
36
+ `jenkinsctl` is a CLI tool that puts Jenkins management right in your terminal. It simplifies tasks like listing builds, fetching logs, and triggering parameterized jobs—no more web UI hassle!
37
+
38
+ ## Why jenkinsctl? 🔥
39
+
40
+ Jenkins workflows can be tedious through the web UI. `jenkinsctl` keeps your hands on the keyboard, streamlining Jenkins management directly from your terminal, making it perfect for quick job control, scripting, and automation.
41
+
42
+ ---
43
+
44
+ ### Key Features
45
+
46
+ - **Quick Build Listings**: View recent builds for any job.
47
+ - **Instant Log Access**: Fetch build logs effortlessly.
48
+ - **JSON & YAML API Data**: Retrieve job configurations and build data in JSON or YAML.
49
+ - **Easy Rebuilds**: Re-run jobs without reopening Jenkins.
50
+ - **Parameterized Builds**: Customize builds with dynamic parameters.
51
+ - **Folder Job Listings**: Organize and access jobs in specific folders.
52
+ - **Autocompletion**: Enhance the CLI experience with shell autocompletion for bash, zsh, or fish.
53
+
54
+ ---
55
+
56
+ ## Installation 📦
57
+ ```sh
58
+ pip3 install jenkinsctl
59
+ ```
60
+
61
+ ## Jenkins Configuration 🛠️
62
+ Before using jenkinsctl, configure your Jenkins server details in your shell profile.
63
+ Add these lines in your ~/.bashrc or ~/.zshrc file:
64
+ ```sh
65
+ export JENKINS_SERVER_URL=http://localhost:8080
66
+ export JENKINS_USERNAME=amanshaw4511
67
+ export JENKINS_API_KEY=21df49caf41726094323b803a6de363eae
68
+ ```
69
+ Adjust the values to match your Jenkins server's URL, your username, and the corresponding API key. This configuration is essential for jenkinsctl to interact with Jenkins and execute tasks efficiently.
70
+
71
+ How to Get the API Token: https://www.baeldung.com/ops/jenkins-api-token
72
+
73
+ Reload your shell profile:
74
+ ```sh
75
+ exec $SHELL
76
+ ```
77
+
78
+ ## Commands & Options 🤖
79
+ All `jenkinsctl` commands are designed to be terminal-friendly with structured flags and arguments.
80
+
81
+ ### `list`
82
+ List recent builds of a Jenkins job.
83
+ ```sh
84
+ jenkinsctl list <job_name> [-n <number_of_builds>]
85
+ ```
86
+ | Option | Description |
87
+ |----------------|------------------------------------------------|
88
+ | `job_name` | Name of the Jenkins job |
89
+ | `-n, --number` | Number of builds to list (default: 5) |
90
+
91
+ ### `logs`
92
+ View logs of a specific build.
93
+ ```sh
94
+ jenkinsctl logs <job_name> [build_no]
95
+ ```
96
+ | Option | Description |
97
+ |-------------|---------------------------------------------------|
98
+ | `job_name` | Name of the Jenkins job |
99
+ | `build_no` | Build number (optional, defaults to last build) |
100
+
101
+ ### `json`
102
+ Get JSON API data for a build.
103
+ ```sh
104
+ jenkinsctl json <job_name> [build_no]
105
+ ```
106
+ ### `config`
107
+ Get build configuration in YAML format.
108
+ ```sh
109
+ jenkinsctl config <job_name> [build_no]
110
+ ```
111
+
112
+ ### `rebuild`
113
+ Trigger a rebuild of a specific job.
114
+ ```sh
115
+ jenkinsctl rebuild <job_name> [build_no]
116
+ ```
117
+
118
+ ### `build`
119
+ Start a new build using YAML configuration with optional parameters.
120
+ ```sh
121
+ jenkinsctl build -f <config_file> [--param key=value]
122
+ ```
123
+ | Option | Description |
124
+ |----------------|-------------------------------------------------|
125
+ | `-f, --file` | YAML configuration file for the Jenkins job |
126
+ | `--param` | Key-value pairs to override config parameters |
127
+
128
+ ### `enable-completion`
129
+ Enable shell autocompletion for streamlined CLI use.
130
+ ```sh
131
+ jenkinsctl enable-completion [shell]
132
+ ```
133
+ | Argument | Description |
134
+ |----------|-------------------------------------------------------|
135
+ | `shell` | Optional: specify shell (`bash`, `zsh`, or `fish`) |
136
+
137
+ ### `jobs`
138
+ List all jobs in a specified Jenkins folder.
139
+ ```sh
140
+ jenkinsctl jobs [folder_name]
141
+ ```
142
+ | Option | Description |
143
+ |--------------|-----------------------------------------------|
144
+ | `folder_name`| Folder path for jobs (optional) |
145
+
146
+
147
+ ## Quick Examples 🎭
148
+
149
+ 1. **List Recent Builds**: Show the last 10 builds for a job.
150
+ ```
151
+ jenkinsctl list my-awesome-job -n 10
152
+ ```
153
+
154
+ 2. **Get Logs for a Build**: View logs for a specific build.
155
+ ```
156
+ jenkinsctl logs my-awesome-job 42
157
+ ```
158
+
159
+ 3. **Start a Build with Parameters**: Launch a build with custom parameters.
160
+ ```
161
+ jenkinsctl build -f path/to/config.yaml --param version=1.2.3
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Contributing 🤝
167
+
168
+ Contributions are welcome! If you want to contribute, fork the repo, make your changes, and submit a pull request. Found an issue? Open an issue in the repo!
169
+
170
+ ---
171
+
172
+
@@ -18,8 +18,8 @@ jenkinsctl/jenkins/commons.py,sha256=wxhwu-YBhtHEYwtiVLsPdzGxr-EoZFnJcgv9VvNzx74
18
18
  jenkinsctl/jenkins/console_util.py,sha256=VKZ3Zj_oZqERvkZ_avLNcpRFdJoe-QBMCOusv14HEyQ,718
19
19
  jenkinsctl/jenkins/job.py,sha256=fqLIB9GTGSoXXD2VYXZyRXLuZa5GIxvFyxT4wXPFsW4,1922
20
20
  jenkinsctl/jenkins/utils.py,sha256=20160jL_GdwKdeQnVsRKMlJG3B6EVAg5xLG_NkaCC9o,1143
21
- jenkinsctl-1.0.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
22
- jenkinsctl-1.0.0.dist-info/METADATA,sha256=OT4MWXGvCEIFDNGPNmBPx5BTZtdNh7Rl0Q6feRvtgSQ,4297
23
- jenkinsctl-1.0.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
24
- jenkinsctl-1.0.0.dist-info/entry_points.txt,sha256=mLjLucLiePOzvV8uIOpZy0YnPZZRMB2hMqfqR3-RRK8,49
25
- jenkinsctl-1.0.0.dist-info/RECORD,,
21
+ jenkinsctl-1.0.7.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
22
+ jenkinsctl-1.0.7.dist-info/METADATA,sha256=TW2_h8kQ6uDwQcRuA2II4e-NNgQFByTRCiMdiqYsum0,6320
23
+ jenkinsctl-1.0.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
24
+ jenkinsctl-1.0.7.dist-info/entry_points.txt,sha256=mLjLucLiePOzvV8uIOpZy0YnPZZRMB2hMqfqR3-RRK8,49
25
+ jenkinsctl-1.0.7.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.0
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,127 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: jenkinsctl
3
- Version: 1.0.0
4
- Summary: A command-line tool to interact with Jenkins jobs 🚀
5
- Home-page: https://github.com/amanshaw4511/jenkinsctl
6
- License: GPL-3.0-or-later
7
- Keywords: jenkins,jenkin
8
- Author: Aman Shaw
9
- Author-email: amanshaw4511@protonmail.com
10
- Maintainer: Aman Shaw
11
- Maintainer-email: amanshaw4511@protonmail.com
12
- Requires-Python: >=3.8,<4.0
13
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
- Classifier: Programming Language :: Python :: 3.9
18
- Classifier: Programming Language :: Python :: 3.10
19
- Classifier: Programming Language :: Python :: 3.11
20
- Classifier: Programming Language :: Python :: 3.12
21
- Requires-Dist: click (>=8.1.7,<9.0.0)
22
- Requires-Dist: click-completion (>=0.5.2,<0.6.0)
23
- Requires-Dist: dynaconf (>=3.2.6,<4.0.0)
24
- Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
25
- Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
26
- Requires-Dist: requests (>=2.32.3,<3.0.0)
27
- Requires-Dist: rich (>=13.8.1,<14.0.0)
28
- Project-URL: Repository, https://github.com/amanshaw4511/jenkinsctl
29
- Description-Content-Type: text/markdown
30
-
31
- ![jenkinsctl](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Jenkins_logo.svg/226px-Jenkins_logo.svg.png?20120629215426)
32
- # jenkinsctl [![PyPI version](https://badge.fury.io/py/jenkinsctl.svg?)](https://badge.fury.io/py/jenkinsctl) [![Downloads](https://static.pepy.tech/badge/jenkinsctl/week?)](https://pepy.tech/project/jenkinsctl) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
33
- Build Jenkins jobs effortlessly using a single command. 🚀
34
-
35
- ## Installation 📦
36
-
37
- ```sh
38
- pip install jenkinsctl
39
- ```
40
-
41
- ## Jenkins Configuration 🛠️
42
- Before using jenkinsctl, configure your Jenkins server details in your shell profile.
43
- Add these lines in your ~/.bashrc or ~/.zshrc file:
44
- ```sh
45
- export JENKINS_SERVER_URL=http://localhost:8080
46
- export JENKINS_USERNAME=amanshaw4511
47
- export JENKINS_API_KEY=21df49caf41726094323b803a6de363eae
48
- ```
49
- Adjust the values to match your Jenkins server's URL, your username, and the corresponding API key. This configuration is essential for jenkinsctl to interact with Jenkins and execute tasks efficiently.
50
-
51
- How to Get the API Token: https://www.baeldung.com/ops/jenkins-api-token
52
- ## Usage 🤖
53
- ```sh
54
- $ jenkinsctl --help
55
- usage: jenkinsctl [-h] {build,config} ...
56
-
57
- options:
58
- -h, --help show this help message and exit
59
-
60
- Subcommand:
61
- {build,config}
62
- build run new build
63
- config get config of a build
64
- ```
65
-
66
- ### Run a Jenkins Job
67
- ```sh
68
- $ jenkinsctl build --help
69
- usage: jenkinsctl build [-h] [-f FILE] [-v] [-s SUPPRESS_LOGS] [--param PARAM]
70
-
71
- options:
72
- -h, --help show this help message and exit
73
- -f FILE, --file FILE Yaml configuration file
74
- -v, --verbose
75
- -s SUPPRESS_LOGS, --suppress-logs SUPPRESS_LOGS
76
- --param PARAM
77
- ```
78
-
79
- ### Get Config of a Jenkin Build in YAML Format
80
- ```sh
81
- $ jenkinsctl config --help
82
- usage: jenkinsctl config [-h] job_name build_no
83
-
84
- positional arguments:
85
- job_name
86
- build_no
87
-
88
- options:
89
- -h, --help show this help message and exit
90
- ```
91
-
92
- ## Examples 🎭
93
- ### Runing a Jenkins Job
94
- Create a YAML configuration file, let's say `my_job.yaml`, with job parameters like this:
95
- ```yaml
96
- job: my_job
97
- params:
98
- param1: some value
99
- param2: 10
100
- param3: true
101
- ```
102
- Initiate the job build using the following command:
103
- ```sh
104
- jenkinsctl build -f my_job.yaml
105
- ```
106
- This command executes the job based on the specified YAML configuration.
107
-
108
- ### Overriding Specific Parameter from Configuration
109
- ```sh
110
- jenkinsctl build -f my_job.yaml --param param2=11 --param param3=false
111
- ```
112
- This command will override the value of `param2` and `param3` from original configuration file `my_job.yaml`, passing an effective configuration as follows to run jenkin job :
113
- ```yaml
114
- job: my_job
115
- params:
116
- param1: some value
117
- param2: 11
118
- param3: false
119
- ```
120
-
121
- ### Generating Config from Existing Builds
122
- Capture and reproduce configurations from previous Jenkins builds.
123
- To generate a YAML configuration file from a specific build (e.g. 2nd build) of a job (e.g., `my_job`), use the following command:
124
- ```sh
125
- jenkinsctl config my_job 2 > my_job.yaml
126
- ```
127
-