SaveText.Ru

Без имени
  1. image: docker-sp.ptsecurity.ru:463/cert-dotnet:3.1
  2.  
  3. variables:
  4.   DOCKER_REGISTRY: docker-sp.ptsecurity.ru:463
  5.   DOCKER_USER: docker-sp
  6.   DOCKER_PASSWORD: $DOCKER_PASSWORD
  7.  
  8. stages:
  9.   - ci
  10.   - automerge
  11.    
  12. before_script:
  13.   - if [[ $CI_BUILD_REF_NAME =~ ^release(.*) ]]; then export IS_RELEASE=true; else export IS_RELEASE=false; fi
  14.   - if [[ $CI_BUILD_REF_NAME =~ develop ]] || [[ $CI_BUILD_REF_NAME =~ ^v([0-9]d*).([0-9]d*).([0-9]d*)-develop$ ]]; then export IS_DEVELOP=true; else export IS_DEVELOP=false; fi
  15.   - if [[ $IS_RELEASE = true ]]; then export BUILD_VERSION=$(<VERSION).$CI_PIPELINE_IID; else export BUILD_VERSION=$(<VERSION).$CI_PIPELINE_IID-$CI_BUILD_REF_NAME; fi
  16.   - export BUILD_VERSION=${BUILD_VERSION///-}
  17.   - "echo Branch: $CI_BUILD_REF_NAME"
  18.   - "echo Build version: $BUILD_VERSION"
  19.   - docker-compose --version
  20.   - docker --version
  21.   - dotnet --version
  22.      
  23. ci:
  24.   stage: ci
  25.   tags:
  26.     - FINCERT.CI
  27.   script:
  28.     - FAILURE=false
  29.     - bash ./deploy/dotnet-publish.sh || FAILURE=true
  30.     - echo "FAILURE = $FAILURE; IS_RELEASE = $IS_RELEASE; IS_DEVELOP = $IS_DEVELOP"
  31.     - if [[ $FAILURE = false ]]; then bash ./deploy/dotnet-test.sh || FAILURE=true; fi
  32.     - echo "FAILURE = $FAILURE; IS_RELEASE = $IS_RELEASE; IS_DEVELOP = $IS_DEVELOP"
  33.     - if [[ $FAILURE = false && $IS_RELEASE = true ]] || [[ $FAILURE = false && $IS_DEVELOP = true ]]; then bash ./deploy/artifacts-build.sh || FAILURE=true; else echo "Skipping artifacts-build"; fi
  34.     - echo "FAILURE = $FAILURE; IS_RELEASE = $IS_RELEASE; IS_DEVELOP = $IS_DEVELOP"
  35.     - if [[ $FAILURE = false && $IS_RELEASE = true ]] || [[ $FAILURE = false && $IS_DEVELOP = true ]]; then bash ./deploy/docker-build.sh || FAILURE=true; else echo "Skipping docker-build"; fi
  36.     - if [[ $IS_RELEASE = true ]] || [[ $IS_DEVELOP = true ]]; then python3 deploy/send-notification.py $FAILURE; fi
  37.     - if [[ $FAILURE = true ]]; then exit 1; fi
  38.   artifacts:
  39.     reports:
  40.       junit:
  41.         - ./TestsResults/*.xml
  42.   except:
  43.     - tags  
  44.  
  45. automerge:
  46.   stage: automerge
  47.   tags:
  48.     - FINCERT.CI
  49.   script:
  50.     - pip3 install python-gitlab
  51.     - python3 ci/automerge.py
  52.   only:
  53.     - /^release/vd+.d+(.d+)?$/
  54.     - /^automerge/release/vd+.d+(.d+)?-[a-z0-9]{8}$/
  55.   when: manual
  56.  
  57.  
  58.  
  59. build_docker_manual:
  60.   stage: ci
  61.   tags:
  62.     -  FINCERT.CI
  63.   script:
  64.     - bash ./deploy/dotnet-publish.sh
  65.     - bash ./deploy/docker-build.sh
  66.   except:
  67.   when: manual
  68.  
  69.  
  70. build_artifact_manual:
  71.   stage: ci
  72.   tags:
  73.     -  FINCERT.CI
  74.   script:
  75.     - bash ./deploy/dotnet-publish.sh
  76.     - bash ./deploy/artifacts-build.sh
  77.   when: manual
  78.  

Share with your friends:

Print