Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow capturing JFrog CLI output #113

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- [Setting the build name and build number](#setting-the-build-name-and-the-build-number)
- [Using multiple JFrog Platform instances](#using-multiple-jfrog-platform-instances)
- [Publishing and accessing the build-info](#publishing-and-accessing-the-build-info)
- [Capturing the output of JFrog CLI commands](#capturing-the-output-of-jfrog-cli-commands)
- [Using HTTP/s proxy](#using-https-proxy)
- [Jenkins Configuration as Code](#jenkins-configuration-as-code)
- [Examples](#examples)
Expand Down Expand Up @@ -180,6 +181,28 @@ stage('Publish build info') {
When the job publishes the build-info to Artifactory, you can access it by clicking on the build-info icon, next to the
job run.

### Capturing the output of JFrog CLI commands

The JFrog CLI commands output is returned as a string.
To capture the output of JFrog CLI commands, wrap the JFrog CLI command in a `script` block:

```groovy
script {
String version = jf '-v'
echo "JFrog CLI version output: $version"
}
```

<details>
<summary>Scripted Pipeline</summary>

```groovy
String version = jf '-v'
echo "JFrog CLI version output: $version"
```

</details>

![build-info.png](images/readme/build-info.png)

## Using HTTP/S proxy
Expand Down
Loading
Loading