---
version: 2.0

#..........................
env:
  resource:
    type: docker
    image: szvecr02.his.huawei.com:80/ecr-build/cann_atb_ubuntu_x86:CANN_9.0.B110_01
    class: 16U32G
    mode: toolbox

#..........................
params:
  - name: product
    value: cloudbuild2.0

#..........................
steps:
  PRE_BUILD:
    - checkout:
        path: Libdevice_CI

  BUILD:
    - build_execute:
        command: |
          echo "set cann environments ..."
          source /usr/local/Ascend/ascend-toolkit/set_env.sh

          echo "start to build libdevice bitcode file ..."
          cd Libdevice_CI
          sh build.sh

        check: 
          mode: sync

  POST_BUILD:
    - artget:
        artifact_type: cmcbinary
        action: push
        version_name_space: libdevice 0.0.1
        agent: Libdevice_CI/dist/libdevice.10.bc
        username: ${cmcUsername}
        password: ${cmcPassword}