All Projects → jfrog → setup-jfrog-cli

jfrog / setup-jfrog-cli

Licence: Apache-2.0 License
Set up JFrog CLI in your GitHub Actions workflow

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to setup-jfrog-cli

k8s-actions
Enable GitHub developers to deploy to Kubernetes service using GitHub Actions
Stars: ✭ 104 (+65.08%)
Mutual labels:  actions
Actions OpenWrt-Amlogic
一键云编译适合Amlogic盒子的OpenWrt固件底包,并使用flippy的打包脚本生成指定内核版本的固件。默认为N1固件,包含绝大部分常用插件;云编译服务器性能有限,若超时失败,自行删减不必要的插件。
Stars: ✭ 57 (-9.52%)
Mutual labels:  actions
action-autotag
Automatically generate a new tag when the manifest file (package.json, Dockerfile, custom file, etc) version changes.
Stars: ✭ 45 (-28.57%)
Mutual labels:  actions
pscale-workflow-helper-scripts
Workflows and helper scripts around the PlanetScale DB workflow to automate database branch creation, association, update and merge directly out of your pull/merge request or favourite CI/CD.
Stars: ✭ 42 (-33.33%)
Mutual labels:  actions
jekyll-deploy-action
🪂 A Github Action to deploy the Jekyll site conveniently for GitHub Pages.
Stars: ✭ 162 (+157.14%)
Mutual labels:  actions
hugo-gh-pages
🚀 Build and Publish Your Hugo Site to GitHub Pages 🚀
Stars: ✭ 37 (-41.27%)
Mutual labels:  actions
OpenWrts
OPENWRT 固件(Raspberry Pi4B/3B+,NanoPi R4S,Orange Pi R1Plus,x86) 依源码更新自动编译
Stars: ✭ 100 (+58.73%)
Mutual labels:  actions
tip
GitHub Action to keep a 'tip' pre-release always up-to-date
Stars: ✭ 18 (-71.43%)
Mutual labels:  actions
openshift-actions-runners
GitHub Action self-hosted runner images for OpenShift.
Stars: ✭ 27 (-57.14%)
Mutual labels:  actions
action-deploy-aws-static-site
Batteries-included Github action that deploys a static site to AWS Cloudfront, taking care of DNS, SSL certs and S3 buckets
Stars: ✭ 70 (+11.11%)
Mutual labels:  actions
setup-msbuild
A GitHub Action to facilitate configuring MSBuild in the workflow PATH for building .NET Framework applications.
Stars: ✭ 170 (+169.84%)
Mutual labels:  actions
craft-text-detector
Packaged, Pytorch-based, easy to use, cross-platform version of the CRAFT text detector
Stars: ✭ 151 (+139.68%)
Mutual labels:  actions
k6-example-github-actions
No description or website provided.
Stars: ✭ 18 (-71.43%)
Mutual labels:  actions
actions
🚀 Homebrew's GitHub Actions
Stars: ✭ 60 (-4.76%)
Mutual labels:  actions
ghaction-import-gpg
GitHub Action to easily import a GPG key
Stars: ✭ 161 (+155.56%)
Mutual labels:  actions
conftest-action
A GitHub Action for using Conftest
Stars: ✭ 30 (-52.38%)
Mutual labels:  actions
version-check
An action that allows you to check whether your npm package version has been updated
Stars: ✭ 65 (+3.17%)
Mutual labels:  actions
denoflow
Configuration as Code, use YAML to write automated workflows that run on Deno, with any Deno modules, Typescript/Javascript codes
Stars: ✭ 143 (+126.98%)
Mutual labels:  actions
ghaction-upx
GitHub Action for UPX, the Ultimate Packer for eXecutables
Stars: ✭ 27 (-57.14%)
Mutual labels:  actions
bintray-secure-ota
Over-The-Air firmware upgrades for the Internet of Things devices with JFrog @bintray
Stars: ✭ 37 (-41.27%)
Mutual labels:  bintray

JFrog CLI

Setup JFrog CLI

Build status

This GitHub Action downloads, installs and configures JFrog CLI, so that it can be used as part of the workflow.

In addition, the Action includes the following features, when using JFrog CLI to work with Artifactory.

  • The connection details of the Artifactory servers used by JFrog CLI can be stored as secrets. Read more about it here.
  • There's no need to add the build name and build number options and arguments to commands which accept them. All build related operations will be automatically recorded with the Workflow Name as build name and Run Number as build number.

Usage

General

- uses: jfrog/setup-jfrog-cli@v2
- run: jfrog --version

Storing Artifactory servers details as secrets

General

The connection details of the Artifactory servers used by JFrog CLI can be stored as secrets.

Creating the configuration on your local machine

  1. Make sure JFrog CLI version 1.29.0 or above is installed on your local machine by running jfrog -v.
  2. Configure the details of the Artifactory server by running jfrog c add.
  3. Export the details of the Artifactory server you configured, using the server ID you chose. Do this by running jfrog c export <SERVER ID>.
  4. Copy the generated token to the clipboard and save it as a secret on GitHub.

Using the secret in the workflow

To use the saved Artifactory server configuration in the workflow, all you need to do it to expose the secret to the workflow. The secret should be exposed as an environment variable with the JF_ARTIFACTORY_ prefix. Here's how you do this:

- uses: jfrog/setup-jfrog-cli@v2
  env:
    JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_SECRET_1 }}
- run: |
    # Ping the server
    jfrog rt ping

As you can see in the example above, we created a secret named JF_ARTIFACTORY_SECRET_1 and we exposed it to the workflow as the JF_ARTIFACTORY_1 environment variable. That's it - the ping command will now ping the configured Artifactory server.

If you have multiple Artifactory servers configured as secrets, you can use all of the in the workflow as follows:

- uses: jfrog/setup-jfrog-cli@v2
  env:
    JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_SECRET_1 }}
    JF_ARTIFACTORY_2: ${{ secrets.JF_ARTIFACTORY_SECRET_2 }}
- run: |
    # Set the Artifactory server to use by providing the server ID (configured by the 'jfrog c add' command).
    jfrog c use local-1
    # Ping local-1
    jfrog rt ping
    # Now use the second sever configuration exposed to the Action.
    jfrog c use local-2
    # Ping local-2
    jfrog rt ping
Important: When exposing more than one Artifactory servers to the Action, you should always add the jfrog c use command to specify the server to use.

Setting the build name and build number when publishing build-info to Artifactory

The Action automatically sets the following environment variables: JFROG_CLI_BUILD_NAME and JFROG_CLI_BUILD_NUMBER with the workflow name and run number respectively. You therefore don't need to specify the build name and build number on any of the build related JFrog CLI commands.

In the following example, all downloaded files are registered as dependencies of the build and all uploaded files are registered as the build artifacts.

- run: |
    jfrog rt dl artifacts/
    jfrog rt u aether artifacts/
    jfrog rt bp

Setting JFrog CLI version

By default the JFrog CLI version set in action.yml is used. To set a specific version, add the version input as follows:

- uses: jfrog/setup-jfrog-cli@v2
  with:
    version: X.Y.Z

It is also possible to set the latest JFrog CLI version by adding the version input as follows:

- uses: jfrog/setup-jfrog-cli@v2
  with:
    version: latest
Important: Only JFrog CLI versions 1.29.0 or above are supported.

Example projects

To help you get started, you can use these sample projects on GitHub.

Developing the Action code

Build the code

If you'd like to help us develop and enhance this Action, this section is for you.

To build and run the Action tests, run

npm i && npm t

Code contributions

We welcome code contributions through pull requests.

Please help us enhance and improve this Action.

Pull requests guidelines

  • If the existing tests do not already cover your changes, please add tests.
  • Please run npm run format for formatting the code before submitting the pull request.

License

This Action is licensed under the Apache License 2.0.

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].