platform: 10.11.92.33
clone:
  git:
    image: registry.cn-qingdao.aliyuncs.com/wod-devops/git:1.4.0
    pull: true
    dns: 223.5.5.5
pipeline:
  read-cache:
    image: registry.cn-qingdao.aliyuncs.com/wod/devops-cache:1.0.0-alpha
    restore: true
    check: yarn.lock
    mount:
      - ./node_modules
      - ./yarn.lock
    volumes:
      - /data/cache:/cache
  build:
    image: registry.cn-qingdao.aliyuncs.com/wod/devops-node:12.18.0-stretch
    dns: 223.5.5.5
    volumes:
      - /data/cache/yarn:/usr/local/share/.cache/yarn
    commands:
      - yarn install
      - yarn run build
  store-cache:
    image: registry.cn-qingdao.aliyuncs.com/wod/devops-cache:1.0.0-alpha
    rebuild: true
    mount:
      - ./node_modules
      - ./yarn.lock
    volumes:
      - /data/cache:/cache
  docker:
    image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock    
    base: registry.cn-qingdao.aliyuncs.com/wod-devops/ui-base:2.0.0
    repo: apaas/apaas-ui
    version: "v3.0.0"
    channel: alpha
    registry: registry.cn-qingdao.aliyuncs.com
    secrets:
      - source: REGISTRY_USER_ALIYUN
        target: REGISTRY_USER
      - source: REGISTRY_PASSWORD_ALIYUN
        target: REGISTRY_PASSWORD
    when:
      branch: dev
  harbor:
    image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock    
    base: registry.cn-qingdao.aliyuncs.com/wod-devops/ui-base:2.0.0
    repo: apaas/apaas-ui
    version: "v3.0.0"
    registry: registry.cn-qingdao.aliyuncs.com
    secrets:
      - source: REGISTRY_USER_ALIYUN
        target: REGISTRY_USER
      - source: REGISTRY_PASSWORD_ALIYUN
        target: REGISTRY_PASSWORD
    when:
      branch: master 
  latest:
    image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock    
    base: registry.cn-qingdao.aliyuncs.com/wod-devops/ui-base:2.0.0
    repo: apaas/apaas-ui
    version: "v3.0"
    registry: registry.cn-qingdao.aliyuncs.com
    secrets:
      - source: REGISTRY_USER_ALIYUN
        target: REGISTRY_USER
      - source: REGISTRY_PASSWORD_ALIYUN
        target: REGISTRY_PASSWORD
    when:
      branch: master  
  deploy:
    image: registry.cn-qingdao.aliyuncs.com/wod-devops/kubernetes:1.0
    namespace: apaas-v3
    deployment: apaas-ui
    container: apaas-ui
    secrets:
      - source: REGISTRY_USER_ALIYUN
        target: REGISTRY_USER
      - source: REGISTRY_PASSWORD_ALIYUN
        target: REGISTRY_PASSWORD
branches: [master,dev]
