jx是云原生CICD,devops的一个最佳实践之一,目前在快速的发展成熟中。最近调研了JX,这里为第2篇,使用已经安装好的jx来实践CICD,旨在让大家了解基于jx的DevOps是如何运转的,感兴趣的可以继续关注,下一篇介绍如何安装。
先上图:

一、windows 搭建开发环境(可选)
1. 安装kubectl
使用Chocolatey来安装,因此install Chocolatey:
安装Chocolatey
windows + X ,选择power shell 管理员模式,输入:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))或者cmd.exe(管理员):
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"使用Chocolatey安装kubectl
-     使用脚本安装 choco install kubernetes-cli
-     测试是否安装成功: kubectl version
-     创建配置文件,先转到%HOME% 目录: For example: cd C:\users\yourusername
-     创建配置文件目录: mkdir .kube
-     转到配置目录: cd .kube
-     配置kubectl使用远程集群: New-Item config -type file修改config文件,或者直接从集群拷贝配置文件过来 
-     测试 
C:\Users\jqpeng>kubectl get pods NAME                                                READY   STATUS      RESTARTS   AGE jenkins-bd94b5fb8-5t9kq                             1/1     Running     0          10d jenkins-x-chartmuseum-75d45b6d7f-2hk99              1/1     Running     0          10d jenkins-x-controllercommitstatus-675dbb9c86-kth6q   1/1     Running     71         10d jenkins-x-controllerrole-5458874c-4lnwh             1/1     Running     0          10d jenkins-x-controllerteam-7f965c8b9c-n4kfm           1/1     Running     0          10d jenkins-x-controllerworkflow-7675c458d-sjbfd        1/1     Running     0          10d 2.安装helm
