Skip to content

Commit

Permalink
Merge pull request #82 from zowe/readme_use-case
Browse files Browse the repository at this point in the history
Added Use case pipeline example with some description in README.md
  • Loading branch information
abnitski-ilya authored Oct 23, 2024
2 parents fd4f407 + 1c61d27 commit 05a0d18
Showing 1 changed file with 31 additions and 7 deletions.
38 changes: 31 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Thank you for considering IBA Group for your mainframe needs.

## Before use - Plugin configuration
After successfully installing the plugin, you need to configure it for further work - this will require a minimum of actions.
1. Move to Manage Jenkins -> Configure System / System -> scroll to the very bottom of the list of installed plugins and find the panel with the name - <b>z/OS Connection List</b>
1. Move to 'Manage Jenkins' -> 'Configure System / System' -> scroll to the very bottom of the list of installed plugins and find the panel with the name - <b>'z/OS Connection List'</b>
2. This setting allows you to add all necessary z/OS systems and configure access to them.
It is necessary to set the connection name (it is also the ID for declarative methods in the code). For the example: ```z/os-connection-name```
3. The URL address and port of the required mainframe to connect via z/OSMF. Example: ```https://<ip-addres>:<port number>```
Expand Down Expand Up @@ -70,7 +70,29 @@ stage ("stage-name") {

### allocateDS - Represents an action for allocating a dataset in a declarative style
```groovy
allocateDS dsn:"EXAMPLE.DATASET", dsOrg:"PS", primary:1, secondary:1, recFm:"FB"
zosmf ("z/os-connection-name") {
allocateDS(
// Mandatory Parameters below:
dsn: "EXAMPLE.DATASET",
dsOrg: "PS",
primary: 1,
secondary: 1,
recFm: "FB",
// Optional Parameters below:
volser:"YOURVOL",
unit:"SYSDA",
alcUnit:"TRK",
dirBlk:"5",
blkSize:"800",
lrecl:"80",
storClass:"STORAGECLASS",
mgntClass:"MGMTCLASS",
dataClass:"DATACLASS",
avgBlk:"10",
dsnType:"LIBRARY",
dsModel:"MODEL.DATASET.NAME"
)
}
```
**Mandatory Parameters:**
* ```dsn:"EXAMPLE.DATASET"``` - The name of the dataset to be allocated
Expand All @@ -96,7 +118,9 @@ allocateDS dsn:"EXAMPLE.DATASET", dsOrg:"PS", primary:1, secondary:1, recFm:"FB"

### deleteDataset - Represents an action for deleting datasets and members in a declarative style
```groovy
deleteDataset dsn:"EXAMPLE.DATASET"
zosmf ("z/os-connection-name") {
deleteDataset dsn: "EXAMPLE.DATASET", member:"MEMBER"
}
```
**Mandatory Parameters:**
* ```dsn:"EXAMPLE.DATASET"``` - Sequential or library dataset name for deletion
Expand Down Expand Up @@ -135,7 +159,7 @@ Pipeline can be used either directly inside the ```Pipeline``` code block in the
This pipeline example uses all currently available methods and functionality of the Zowe zDevOps plugin.
**Steps to Execute the Pipeline:**
1. Add a zosmf connection in settings (<b>Manage Jenkins -> Configure System / System -> z/OS Connection List</b>). Enter a connection name, zosmf url, username and password.
1. Add a zosmf connection in settings (<b>'Manage Jenkins' -> 'Configure System / System' -> z/OS Connection List</b>). Enter a connection name, zosmf url, username and password.
2. Create a new Jenkins item -> ```Pipeline``` and open its configuration.
3. In the ```Pipeline``` section, paste the code from the example below and replace all the necessary variables with your data
4. Done, enjoy the minimal ready-made pipeline template!
Expand Down Expand Up @@ -280,7 +304,7 @@ The plugin are packaged as self-contained <b>.hpi</b> files, which have all the
### <b>[Zowe zDevOps plugin installation .hpi file](https://github.com/IBA-mainframe-dev/Global-Repository-for-Mainframe-Developers/blob/master/Jenkins%20zOS%20DevOps%20plugin%20installable%20hpi/zos-devops.hpi)</b>

Assuming a <b>.hpi</b> file has been downloaded, a logged-in Jenkins administrator may upload the file from within the web UI:
1. Navigate to the <b>Manage Jenkins > Manage Plugins</b> page in the web UI.
1. Navigate to the <b>Manage Jenkins > Plugins</b> page in the web UI.
2. Click on the <b>Advanced</b> tab.
3. Choose the <b>.hpi</b> file from your system or enter a URL to the archive file under the <b>Deploy Plugin</b> section.
4. <b>Deploy</b> the plugin file.
Expand All @@ -291,8 +315,8 @@ Assuming a <b>.hpi</b> file has been downloaded, a logged-in Jenkins administrat
3. To generate the ```target``` dir with generated-sources - you have to run the Maven command: ```mvn localizer:generate```
4. Next, you need to generate an installation file: .hpi or .jpi file (both are installation files for the Jenkins plugin). This can be done by executing Maven command ```mvn install``` or by ```mvn hpi:hpi```.
5. After building the .hpi/.jpi file, it should appear in a <b><Plugin-project-name>/build/libs/<hpi_file_name>.hpi</b> directory
6. Next you need to login into the Jenkins, move to the <b>Manage Jenkins -> “Manage Plugins -> Advanced (tab) -> Deploy Plugin</b> (You can select a plugin file from your local system or provide a URL to install a plugin from outside the central plugin repository) <b>-> Specify the path to the generated .hpi/.jpi file</b> (or by dragging the file from Intellij IDEA project to the file upload field in the Jenkins).
7. Click <b>Deploy</b>, reboot Jenkins after installation. The Plugin is ready to go!
6. Next you need to login into the Jenkins, move to the <b>'Manage Jenkins' -> 'Plugins' -> 'Advanced settings (tab)' -> 'Deploy Plugin'</b> (You can select a plugin file from your local system or provide a URL to install a plugin from outside the central plugin repository) <b>-> Specify the path to the generated .hpi/.jpi file</b> (or by dragging the file from Intellij IDEA project to the file upload field in the Jenkins).
7. Click <b>'Deploy'</b>, reboot Jenkins after installation. The Plugin is ready to go!

## How to run Jenkins plugin in Debug mode in a local Jenkins sandbox

Expand Down

0 comments on commit 05a0d18

Please sign in to comment.