jenkinsctl 1.0.0__tar.gz → 1.0.7__tar.gz
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.
- jenkinsctl-1.0.7/PKG-INFO +172 -0
- jenkinsctl-1.0.7/README.md +140 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/pyproject.toml +1 -1
- jenkinsctl-1.0.0/PKG-INFO +0 -127
- jenkinsctl-1.0.0/README.md +0 -96
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/LICENSE +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/__init__.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/cli.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/__init__.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/build.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/config.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/enable_completion.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/jobs.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/json.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/list.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/logs.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/commands/rebuild.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/configs/__init__.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/configs/config.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/configs/logging_config.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/configs/session.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/jenkins/cli_helper.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/jenkins/commons.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/jenkins/console_util.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/jenkins/job.py +0 -0
- {jenkinsctl-1.0.0 → jenkinsctl-1.0.7}/jenkinsctl/jenkins/utils.py +0 -0
|
@@ -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
|
+

|
|
33
|
+
# jenkinsctl [](https://badge.fury.io/py/jenkinsctl) [](https://pepy.tech/project/jenkinsctl) [](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
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+

|
|
2
|
+
# jenkinsctl [](https://badge.fury.io/py/jenkinsctl) [](https://pepy.tech/project/jenkinsctl) [](https://www.gnu.org/licenses/gpl-3.0)
|
|
3
|
+
# jenkinsctl – Jenkins Control Right from Your Terminal 🚀
|
|
4
|
+
|
|
5
|
+
`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!
|
|
6
|
+
|
|
7
|
+
## Why jenkinsctl? 🔥
|
|
8
|
+
|
|
9
|
+
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.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Key Features
|
|
14
|
+
|
|
15
|
+
- **Quick Build Listings**: View recent builds for any job.
|
|
16
|
+
- **Instant Log Access**: Fetch build logs effortlessly.
|
|
17
|
+
- **JSON & YAML API Data**: Retrieve job configurations and build data in JSON or YAML.
|
|
18
|
+
- **Easy Rebuilds**: Re-run jobs without reopening Jenkins.
|
|
19
|
+
- **Parameterized Builds**: Customize builds with dynamic parameters.
|
|
20
|
+
- **Folder Job Listings**: Organize and access jobs in specific folders.
|
|
21
|
+
- **Autocompletion**: Enhance the CLI experience with shell autocompletion for bash, zsh, or fish.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Installation 📦
|
|
26
|
+
```sh
|
|
27
|
+
pip3 install jenkinsctl
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Jenkins Configuration 🛠️
|
|
31
|
+
Before using jenkinsctl, configure your Jenkins server details in your shell profile.
|
|
32
|
+
Add these lines in your ~/.bashrc or ~/.zshrc file:
|
|
33
|
+
```sh
|
|
34
|
+
export JENKINS_SERVER_URL=http://localhost:8080
|
|
35
|
+
export JENKINS_USERNAME=amanshaw4511
|
|
36
|
+
export JENKINS_API_KEY=21df49caf41726094323b803a6de363eae
|
|
37
|
+
```
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
How to Get the API Token: https://www.baeldung.com/ops/jenkins-api-token
|
|
41
|
+
|
|
42
|
+
Reload your shell profile:
|
|
43
|
+
```sh
|
|
44
|
+
exec $SHELL
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Commands & Options 🤖
|
|
48
|
+
All `jenkinsctl` commands are designed to be terminal-friendly with structured flags and arguments.
|
|
49
|
+
|
|
50
|
+
### `list`
|
|
51
|
+
List recent builds of a Jenkins job.
|
|
52
|
+
```sh
|
|
53
|
+
jenkinsctl list <job_name> [-n <number_of_builds>]
|
|
54
|
+
```
|
|
55
|
+
| Option | Description |
|
|
56
|
+
|----------------|------------------------------------------------|
|
|
57
|
+
| `job_name` | Name of the Jenkins job |
|
|
58
|
+
| `-n, --number` | Number of builds to list (default: 5) |
|
|
59
|
+
|
|
60
|
+
### `logs`
|
|
61
|
+
View logs of a specific build.
|
|
62
|
+
```sh
|
|
63
|
+
jenkinsctl logs <job_name> [build_no]
|
|
64
|
+
```
|
|
65
|
+
| Option | Description |
|
|
66
|
+
|-------------|---------------------------------------------------|
|
|
67
|
+
| `job_name` | Name of the Jenkins job |
|
|
68
|
+
| `build_no` | Build number (optional, defaults to last build) |
|
|
69
|
+
|
|
70
|
+
### `json`
|
|
71
|
+
Get JSON API data for a build.
|
|
72
|
+
```sh
|
|
73
|
+
jenkinsctl json <job_name> [build_no]
|
|
74
|
+
```
|
|
75
|
+
### `config`
|
|
76
|
+
Get build configuration in YAML format.
|
|
77
|
+
```sh
|
|
78
|
+
jenkinsctl config <job_name> [build_no]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `rebuild`
|
|
82
|
+
Trigger a rebuild of a specific job.
|
|
83
|
+
```sh
|
|
84
|
+
jenkinsctl rebuild <job_name> [build_no]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `build`
|
|
88
|
+
Start a new build using YAML configuration with optional parameters.
|
|
89
|
+
```sh
|
|
90
|
+
jenkinsctl build -f <config_file> [--param key=value]
|
|
91
|
+
```
|
|
92
|
+
| Option | Description |
|
|
93
|
+
|----------------|-------------------------------------------------|
|
|
94
|
+
| `-f, --file` | YAML configuration file for the Jenkins job |
|
|
95
|
+
| `--param` | Key-value pairs to override config parameters |
|
|
96
|
+
|
|
97
|
+
### `enable-completion`
|
|
98
|
+
Enable shell autocompletion for streamlined CLI use.
|
|
99
|
+
```sh
|
|
100
|
+
jenkinsctl enable-completion [shell]
|
|
101
|
+
```
|
|
102
|
+
| Argument | Description |
|
|
103
|
+
|----------|-------------------------------------------------------|
|
|
104
|
+
| `shell` | Optional: specify shell (`bash`, `zsh`, or `fish`) |
|
|
105
|
+
|
|
106
|
+
### `jobs`
|
|
107
|
+
List all jobs in a specified Jenkins folder.
|
|
108
|
+
```sh
|
|
109
|
+
jenkinsctl jobs [folder_name]
|
|
110
|
+
```
|
|
111
|
+
| Option | Description |
|
|
112
|
+
|--------------|-----------------------------------------------|
|
|
113
|
+
| `folder_name`| Folder path for jobs (optional) |
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## Quick Examples 🎭
|
|
117
|
+
|
|
118
|
+
1. **List Recent Builds**: Show the last 10 builds for a job.
|
|
119
|
+
```
|
|
120
|
+
jenkinsctl list my-awesome-job -n 10
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
2. **Get Logs for a Build**: View logs for a specific build.
|
|
124
|
+
```
|
|
125
|
+
jenkinsctl logs my-awesome-job 42
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
3. **Start a Build with Parameters**: Launch a build with custom parameters.
|
|
129
|
+
```
|
|
130
|
+
jenkinsctl build -f path/to/config.yaml --param version=1.2.3
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Contributing 🤝
|
|
136
|
+
|
|
137
|
+
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!
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
jenkinsctl-1.0.0/PKG-INFO
DELETED
|
@@ -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
|
-

|
|
32
|
-
# jenkinsctl [](https://badge.fury.io/py/jenkinsctl) [](https://pepy.tech/project/jenkinsctl) [](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
|
-
|
jenkinsctl-1.0.0/README.md
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
# jenkinsctl [](https://badge.fury.io/py/jenkinsctl) [](https://pepy.tech/project/jenkinsctl) [](https://www.gnu.org/licenses/gpl-3.0)
|
|
3
|
-
Build Jenkins jobs effortlessly using a single command. 🚀
|
|
4
|
-
|
|
5
|
-
## Installation 📦
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
pip install jenkinsctl
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Jenkins Configuration 🛠️
|
|
12
|
-
Before using jenkinsctl, configure your Jenkins server details in your shell profile.
|
|
13
|
-
Add these lines in your ~/.bashrc or ~/.zshrc file:
|
|
14
|
-
```sh
|
|
15
|
-
export JENKINS_SERVER_URL=http://localhost:8080
|
|
16
|
-
export JENKINS_USERNAME=amanshaw4511
|
|
17
|
-
export JENKINS_API_KEY=21df49caf41726094323b803a6de363eae
|
|
18
|
-
```
|
|
19
|
-
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.
|
|
20
|
-
|
|
21
|
-
How to Get the API Token: https://www.baeldung.com/ops/jenkins-api-token
|
|
22
|
-
## Usage 🤖
|
|
23
|
-
```sh
|
|
24
|
-
$ jenkinsctl --help
|
|
25
|
-
usage: jenkinsctl [-h] {build,config} ...
|
|
26
|
-
|
|
27
|
-
options:
|
|
28
|
-
-h, --help show this help message and exit
|
|
29
|
-
|
|
30
|
-
Subcommand:
|
|
31
|
-
{build,config}
|
|
32
|
-
build run new build
|
|
33
|
-
config get config of a build
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Run a Jenkins Job
|
|
37
|
-
```sh
|
|
38
|
-
$ jenkinsctl build --help
|
|
39
|
-
usage: jenkinsctl build [-h] [-f FILE] [-v] [-s SUPPRESS_LOGS] [--param PARAM]
|
|
40
|
-
|
|
41
|
-
options:
|
|
42
|
-
-h, --help show this help message and exit
|
|
43
|
-
-f FILE, --file FILE Yaml configuration file
|
|
44
|
-
-v, --verbose
|
|
45
|
-
-s SUPPRESS_LOGS, --suppress-logs SUPPRESS_LOGS
|
|
46
|
-
--param PARAM
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Get Config of a Jenkin Build in YAML Format
|
|
50
|
-
```sh
|
|
51
|
-
$ jenkinsctl config --help
|
|
52
|
-
usage: jenkinsctl config [-h] job_name build_no
|
|
53
|
-
|
|
54
|
-
positional arguments:
|
|
55
|
-
job_name
|
|
56
|
-
build_no
|
|
57
|
-
|
|
58
|
-
options:
|
|
59
|
-
-h, --help show this help message and exit
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Examples 🎭
|
|
63
|
-
### Runing a Jenkins Job
|
|
64
|
-
Create a YAML configuration file, let's say `my_job.yaml`, with job parameters like this:
|
|
65
|
-
```yaml
|
|
66
|
-
job: my_job
|
|
67
|
-
params:
|
|
68
|
-
param1: some value
|
|
69
|
-
param2: 10
|
|
70
|
-
param3: true
|
|
71
|
-
```
|
|
72
|
-
Initiate the job build using the following command:
|
|
73
|
-
```sh
|
|
74
|
-
jenkinsctl build -f my_job.yaml
|
|
75
|
-
```
|
|
76
|
-
This command executes the job based on the specified YAML configuration.
|
|
77
|
-
|
|
78
|
-
### Overriding Specific Parameter from Configuration
|
|
79
|
-
```sh
|
|
80
|
-
jenkinsctl build -f my_job.yaml --param param2=11 --param param3=false
|
|
81
|
-
```
|
|
82
|
-
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 :
|
|
83
|
-
```yaml
|
|
84
|
-
job: my_job
|
|
85
|
-
params:
|
|
86
|
-
param1: some value
|
|
87
|
-
param2: 11
|
|
88
|
-
param3: false
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Generating Config from Existing Builds
|
|
92
|
-
Capture and reproduce configurations from previous Jenkins builds.
|
|
93
|
-
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:
|
|
94
|
-
```sh
|
|
95
|
-
jenkinsctl config my_job 2 > my_job.yaml
|
|
96
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|