# .gitlab-ci.yml

build:
  #image: ubuntu:18.04
  #image: xed-testing-container
  image:  amr-registry-pre.caas.intel.com/xed/xed-testing-container 
  stage: build
  script:
    - python3 ci-internal.py

# .gitlab-ci.yml

variables:
  PACKAGE_NAME: xed-common

build:
  #image: ubuntu:18.04
  #image: xed-testing-container
  image:  amr-registry-pre.caas.intel.com/xed/xed-testing-container 
  stage: build
  script:
    - python3 ci-internal.py

build-conan:
  image: amr-registry.caas.intel.com/syssim/teamcity-agent:2020.1.5-21ww05
  stage: build
  script:
    - virtualenv --python="$(which python3)" ~/.syssim-virtualenv
    - source ~/.syssim-virtualenv/bin/activate
    - pip install conan pylint astroid yapf
    - conan config install https://gitlab.devtools.intel.com/syssim/conan-config.git
    - |-
        if [[ $CI_COMMIT_REF_NAME == main && $CI_COMMIT_TAG == v* ]]; then
          PACKAGE_REF=$PACKAGE_NAME/${CI_COMMIT_TAG#v*}@xed/stable
        else
          PACKAGE_REF=$PACKAGE_NAME/$CI_COMMIT_SHA@xed/ci
        fi
        conan create . $PACKAGE_REF --build=missing --profile=gcc9-native
        if [[ $CI_COMMIT_REF_NAME == main ]]; then
          conan user -r syssim-public "$CONAN_USERNAME" -p "$CONAN_PASSWORD"
          conan upload $PACKAGE_REF -r syssim-public --force
          LATEST_REF=$PACKAGE_NAME/latest@xed/ci
          conan alias $LATEST_REF $PACKAGE_REF
          conan upload $LATEST_REF -r syssim-public --force
        fi

Add GitLab CI trigger for Conan package
Add GitLab CI trigger for Conan package

- Build Conan package as part of CI
- Upload to Artifactory for commits to "main":
  - use "PACKAGE/VERSION@xed/stable" reference when tagged with "vVERSION"
  - use "PACKAGE/SHA@xed/ci" reference for unversioned commits
- Update alias reference "PACKAGE/latest@xed/ci"
