<commit_before>stages:
  - prepare
  - test

build build-env image:
  stage: prepare
  script:
    - cd ci/build-env
    - docker build -t ${CI_REGISTRY_IMAGE}/build-env .
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker push $CI_REGISTRY_IMAGE/build-env
  tags:
    - docker-host
  only:
    - master@lukas/python-phoenixdb

.build-phoenix-image: &build_phoenix_image
  stage: prepare
  script:
    - JOB_NAME=($CI_JOB_NAME)
    - cd ci/phoenix
    - docker build -t ${CI_REGISTRY_IMAGE}/phoenix:${JOB_NAME[2]} --build-arg HBASE_VERSION=$HBASE_VERSION --build-arg PHOENIX_VERSION=$PHOENIX_VERSION .
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker push $CI_REGISTRY_IMAGE/phoenix:${JOB_NAME[2]}
  tags:
    - docker-host

build phoenix 4.12 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.12.0-HBase-1.3
    HBASE_VERSION: 1.3.1

build phoenix 4.11 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.11.0-HBase-1.3
    HBASE_VERSION: 1.3.1

build phoenix 4.10 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.10.0-HBase-1.2
    HBASE_VERSION: 1.2.6

build phoenix 4.9 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.9.0-HBase-1.2
    HBASE_VERSION: 1.2.6

build phoenix 4.8 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.8.2-HBase-1.2
    HBASE_VERSION: 1.2.6

.test: &test
  image: $CI_REGISTRY_IMAGE/build-env
  variables:
    PHOENIXDB_TEST_DB_URL: http://phoenix:8765/
    PIP_CACHE_DIR: $CI_PROJECT_DIR/cache/
  script:
    - tox -e py27,py35
  cache:
    paths:
      - cache/
  tags:
    - docker

test phoenix 4.12:
  <<: *test
  services:
    - name: $CI_REGISTRY_IMAGE/phoenix:4.12
      alias: phoenix

test phoenix 4.11:
  <<: *test
  services:
    - name: $CI_REGISTRY_IMAGE/phoenix:4.11
      alias: phoenix

test phoenix 4.10:
  <<: *test
  services:
    - name: $CI_REGISTRY_IMAGE/phoenix:4.10<commit_msg>Test against Phoenix 4.13<commit_after>stages:
  - prepare
  - test

build build-env image:
  stage: prepare
  script:
    - cd ci/build-env
    - docker build -t ${CI_REGISTRY_IMAGE}/build-env .
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker push $CI_REGISTRY_IMAGE/build-env
  tags:
    - docker-host
  only:
    - master@lukas/python-phoenixdb

.build-phoenix-image: &build_phoenix_image
  stage: prepare
  script:
    - JOB_NAME=($CI_JOB_NAME)
    - cd ci/phoenix
    - docker build -t ${CI_REGISTRY_IMAGE}/phoenix:${JOB_NAME[2]} --build-arg HBASE_VERSION=$HBASE_VERSION --build-arg PHOENIX_VERSION=$PHOENIX_VERSION .
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
    - docker push $CI_REGISTRY_IMAGE/phoenix:${JOB_NAME[2]}
  tags:
    - docker-host

build phoenix 4.13 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.13.0-HBase-1.3
    HBASE_VERSION: 1.3.1

build phoenix 4.12 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.12.0-HBase-1.3
    HBASE_VERSION: 1.3.1

build phoenix 4.11 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.11.0-HBase-1.3
    HBASE_VERSION: 1.3.1

build phoenix 4.10 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.10.0-HBase-1.2
    HBASE_VERSION: 1.2.6

build phoenix 4.9 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.9.0-HBase-1.2
    HBASE_VERSION: 1.2.6

build phoenix 4.8 image:
  <<: *build_phoenix_image
  variables:
    PHOENIX_VERSION: 4.8.2-HBase-1.2
    HBASE_VERSION: 1.2.6

.test: &test
  image: $CI_REGISTRY_IMAGE/build-env
  variables:
    PHOENIXDB_TEST_DB_URL: http://phoenix:8765/
    PIP_CACHE_DIR: $CI_PROJECT_DIR/cache/
  script:
    - tox -e py27,py35
  cache:
    paths:
      - cache/
  tags:
    - docker

test phoenix 4.13:
  <<: *test
  services:
    - name: $CI_REGISTRY_IMAGE/phoenix:4.13
      alias: phoenix

test phoenix 4.12:
  <<: *test
  services:
    - name: $CI_REGISTRY_IMAGE/phoenix:4.12
      alias: phoenix

test phoenix 4.11:
  <<: *test
  services:
    - name: $CI_REGISTRY_IMAGE/phoenix:4.11
      alias: phoenix

test phoenix 4.10:
  <<: *test
  services:
    - name: $CI_REGISTRY_IMAGE/phoenix:4.10
{'fraction_non_alphanumeric': 0.12273262661955242, 'fraction_numerical': 0.04452296819787986, 'mean_word_length': 2.9645191409897294, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3984140', 'n_tokens_mistral': 1888, 'n_tokens_neox': 1827, 'n_words': 321}