.rancher-pipeline.yml

一、注意点

.rancher-pipeline.yml_第1张图片

其实下文二的image是基于这个镜像作为基础镜像在这个镜像中执行打包,shellScript 当前路径是你代码块与上图settings.xml,图中的settings.xml可以替换下你当前镜像的settings.xml

示例

二、.rancher-pipeline.yml

${CICD_GIT_BRANCH}这些从官网可以看到对应的参数解释

stages:
- name: 扫描+编译
  steps:
  - runScriptConfig:
      image: zhang2035005702/maven-jdk:v1.8
      shellScript: |-
        mvn clean install -DskipTests=true -T 2.0C
- name: 网关镜像打包
  steps:
  - publishImageConfig:
      dockerfilePath: ./Dockerfile-GW # 这是dockerfile的路径
      buildContext: .
      tag: shop/gw:${CICD_GIT_BRANCH}-${CICD_GIT_COMMIT}
      #(可选项)推送镜像到远程镜像库
      pushRemote: true
      registry: xxxx.com
    env:
      PLUGIN_DEBUG: "true"
      PLUGIN_INSECURE: "true"
- name: 认证组件镜像打包
  steps:
  - publishImageConfig:
      dockerfilePath: ./Dockerfile-AUTH
      buildContext: .
      tag: shop/auth:${CICD_GIT_BRANCH}-${CICD_GIT_COMMIT}
      pushRemote: true
      registry: xxxx.com
    env:
      PLUGIN_DEBUG: "true"
      PLUGIN_INSECURE: "true"
- name: 应用发布
  steps:
  - applyYamlConfig:
      path: ./deployment.yaml
timeout: 60
notification: {}

你可能感兴趣的:(rancher)