安装 jx

如何在你的机器上安装jx二进制包

根据你的操作系统选择最适合的指令:

macOS

在 Mac 上你可以使用 brew

brew install jenkins-x/jx/jx

或者,如果您尚未安装 brew ,并且喜欢手动安装的话,请执行如下指令安装:

  1. Download the jx binary archive using curl and pipe (|) the compressed archive to the tar command:
curl -L "https://github.com/jenkins-x/jx/releases/download/$(curl --silent https://api.github.com/repos/jenkins-x/jx/releases/latest | jq -r '.tag_name')/jx-darwin-amd64.tar.gz" | tar xzv "jx"
or, if you don't have `jq` installed:
curl -L "https://github.com/jenkins-x/jx/releases/download/$(curl --silent "https://github.com/jenkins-x/jx/releases/latest" | sed 's#.*tag/\(.*\)\".*#\1#')/jx-darwin-amd64.tar.gz" | tar xzv "jx"
  1. Install the jx binary by moving it to a location which should be on your environments PATH, using the mv command:
sudo mv jx /usr/local/bin
  1. Run jx version to make sure you’re on the latest stable version
jx version

Linux

To install Jenkins X on Linux, download the .tar file, and unarchive it in a directory where you can run the jx command.

  1. Download the jx binary archive using curl and pipe (|) the compressed archive to the tar command:
curl -L "https://github.com/jenkins-x/jx/releases/download/$(curl --silent https://api.github.com/repos/jenkins-x/jx/releases/latest | jq -r '.tag_name')/jx-linux-amd64.tar.gz" | tar xzv "jx"
or, if you don't have `jq` installed:
curl -L "https://github.com/jenkins-x/jx/releases/download/$(curl --silent "https://github.com/jenkins-x/jx/releases/latest" | sed 's#.*tag/\(.*\)\".*#\1#')/jx-linux-amd64.tar.gz" | tar xzv "jx"
  1. Install the jx binary by moving it to a location which should be on your environments PATH, using the mv command:
sudo mv jx /usr/local/bin
  1. Run jx version to make sure you’re on the latest stable version
jx version

Windows

choco install jenkins-x

要升级 jx 二进制请运行:

choco upgrade jenkins-x
  • 如果你使用 scoop,那么这里有一个 可用的清单

    要安装 jx 二进制请运行:

scoop install jx

要升级 jx 二进制请运行:

scoop update jx

其他平台

下载二进制包 jx 然后加到环境变量 $PATH

或者,你可以尝试 自行构建。然而,如果你要自行构建的话,请注意移除所有旧版本的 jx 二进制文件,这样你的本地构建才会出现在环境变量 $PATH 的第一位 :)

获得帮助

查找可用的命令类型:

jx

或者,获取指定命令的帮助,例如: create 命令,可以输入:

jx help create

你也可以浏览 jx 命令参考文档