<commit_before>stages:
  - build

variables:
  REGISTRY: hub.alterway.fr

before_script:
  - if [[ "$CI_BUILD_REF_NAME" != master ]]; then REGISTRY="$REGISTRY/$CI_BUILD_REF_NAME"; fi

build:
  stage: build
  script:
    - docker build --pull -t $REGISTRY/php:7.1-fpm 7.1-fpm/ >> /dev/null
    - docker push $REGISTRY/php:7.1-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:7.1-cli 7.1-cli/ > /dev/null
    - docker push $REGISTRY/php:7.1-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:7.1-apache 7.1-apache/ > /dev/null
    - docker push $REGISTRY/php:7.1-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:7.0-fpm 7.0-fpm/ >> /dev/null
    - docker push $REGISTRY/php:7.0-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:7.0-cli 7.0-cli/ > /dev/null
    - docker push $REGISTRY/php:7.0-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:7.0-apache 7.0-apache/ > /dev/null
    - docker push $REGISTRY/php:7.0-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:5.6-fpm 5.6-fpm/ >> /dev/null
    - docker push $REGISTRY/php:5.6-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:5.6-cli 5.6-cli/ > /dev/null
    - docker push $REGISTRY/php:5.6-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:5.6-apache 5.6-apache/ > /dev/null
    - docker push $REGISTRY/php:5.6-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:5.5-fpm 5.5-fpm/ > /dev/null
    - docker push $REGISTRY/php:5.5-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:5.5-cli 5.5-cli/ > /dev/null
    - docker push $REGISTRY/php:5.5-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:5.5-apache 5.5-apache/ > /dev/null
    - docker push $REGISTRY/php:5.5-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:5.4-fpm 5.4-fpm/ > /dev/null
    - docker push $REGISTRY/php:5.4-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:5.4-cli 5.4-cli/ > /dev/null
    - docker push $REGISTRY/php:5.4-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:5.4-apache 5.4-apache/ > /dev/null
    - docker push $REGISTRY/php:5.4-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:5.3-fpm 5.3-fpm/ > /dev/null
    - docker push $REGISTRY/php:5.3-fpm > /dev/null

    # tag library namespace
    - NAMESPACE=$REGISTRY/library
    - docker tag -f $REGISTRY/php:7.1-fpm $NAMESPACE/php:7.1-fpm > /dev/null
    - docker push $NAMESPACE/php:7.1-fpm > /dev/null
    - docker tag -f $REGISTRY/php:7.1-apache $NAMESPACE/php:7.1-apache > /dev/null
    - docker push $NAMESPACE/php:7.1-apache > /dev/null
    - docker tag -f $REGISTRY/php:7.1-cli $NAMESPACE/php:7.1-cli > /dev/null
    - docker push $NAMESPACE/php:7.1-cli > /dev/null
    - docker tag -f $REGISTRY/php:7.0-fpm $NAMESPACE/php:7.0-fpm > /dev/null
    - docker push $NAMESPACE/php:7.0-fpm > /dev/null
    - docker tag -f $REGISTRY/php:7.0-apache $NAMESPACE/php:7.0-apache > /dev/null
    - docker push $NAMESPACE/php:7.0-apache > /dev/null
    - docker tag -f $REGISTRY/php:7.0-cli $NAMESPACE/php:7.0-cli > /dev/null
    - docker push $NAMESPACE/php:7.0-cli > /dev/null
    - docker tag -f $REGISTRY/php:5.6-fpm $NAMESPACE/php:5.6-fpm > /dev/null
    - docker push $NAMESPACE/php:5.6-fpm > /dev/null
    - docker tag -f $REGISTRY/php:5.6-apache $NAMESPACE/php:5.6-apache > /dev/null
    - docker push $NAMESPACE/php:5.6-apache > /dev/null
    - docker tag -f $REGISTRY/php:5.6-cli $NAMESPACE/php:5.6-cli > /dev/null
    - docker push $NAMESPACE/php:5.6-cli > /dev/null
    - docker tag -f $REGISTRY/php:5.5-fpm $NAMESPACE/php:5.5-fpm > /dev/null
    - docker push $NAMESPACE/php:5.5-fpm > /dev/null
    - docker tag -f $REGISTRY/php:5.5-apache $NAMESPACE/php:5.5-apache > /dev/null
    - docker push $NAMESPACE/php:5.5-apache > /dev/null
    - docker tag -f $REGISTRY/php:5.5-cli $NAMESPACE/php:5.5-cli > /dev/null
    - docker push $NAMESPACE/php:5.5-cli > /dev/null
    - docker tag -f $REGISTRY/php:5.4-fpm $NAMESPACE/php:5.4-fpm > /dev/null
    - docker push $NAMESPACE/php:5.4-fpm > /dev/null
    - docker tag -f $REGISTRY/php:5.4-apache $NAMESPACE/php:5.4-apache > /dev/null
    - docker push $NAMESPACE/php:5.4-apache > /dev/null
    - docker tag -f $REGISTRY/php:5.4-cli $NAMESPACE/php:5.4-cli > /dev/null
    - docker push $NAMESPACE/php:5.4-cli > /dev/null
    - docker tag -f $REGISTRY/php:5.3-fpm $NAMESPACE/php:5.3-fpm > /dev/null
    - docker push $NAMESPACE/php:5.3-fpm > /dev/null

    # tags extra for old project.
    - docker tag $REGISTRY/php:5.6-fpm $REGISTRY/php:5.6-fpm-extra
    - docker push $REGISTRY/php:5.6-fpm-extra
    - docker tag $REGISTRY/php:5.5-fpm $REGISTRY/php:5.5-fpm-extra
    - docker push $REGISTRY/php:5.5-fpm-extra
    - docker tag $REGISTRY/php:5.4-fpm $REGISTRY/php:5.4-fpm-extra
    - docker push $REGISTRY/php:5.4-fpm-extra
    - docker tag REGISTRY/php:5.3-fpm $REGISTRY/php:5.3-fpm-extra
    - docker push $REGISTRY/php:5.3-fpm-extra

  only:
    - preprod
    - master<commit_msg>fix docker tag for ci (remove -f) #2<commit_after>stages:
  - build

variables:
  REGISTRY: hub.alterway.fr

before_script:
  - if [[ "$CI_BUILD_REF_NAME" != master ]]; then REGISTRY="$REGISTRY/$CI_BUILD_REF_NAME"; fi

build:
  stage: build
  script:
    - docker build --pull -t $REGISTRY/php:7.1-fpm 7.1-fpm/ >> /dev/null
    - docker push $REGISTRY/php:7.1-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:7.1-cli 7.1-cli/ > /dev/null
    - docker push $REGISTRY/php:7.1-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:7.1-apache 7.1-apache/ > /dev/null
    - docker push $REGISTRY/php:7.1-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:7.0-fpm 7.0-fpm/ >> /dev/null
    - docker push $REGISTRY/php:7.0-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:7.0-cli 7.0-cli/ > /dev/null
    - docker push $REGISTRY/php:7.0-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:7.0-apache 7.0-apache/ > /dev/null
    - docker push $REGISTRY/php:7.0-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:5.6-fpm 5.6-fpm/ >> /dev/null
    - docker push $REGISTRY/php:5.6-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:5.6-cli 5.6-cli/ > /dev/null
    - docker push $REGISTRY/php:5.6-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:5.6-apache 5.6-apache/ > /dev/null
    - docker push $REGISTRY/php:5.6-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:5.5-fpm 5.5-fpm/ > /dev/null
    - docker push $REGISTRY/php:5.5-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:5.5-cli 5.5-cli/ > /dev/null
    - docker push $REGISTRY/php:5.5-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:5.5-apache 5.5-apache/ > /dev/null
    - docker push $REGISTRY/php:5.5-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:5.4-fpm 5.4-fpm/ > /dev/null
    - docker push $REGISTRY/php:5.4-fpm > /dev/null
    - docker build --pull -t $REGISTRY/php:5.4-cli 5.4-cli/ > /dev/null
    - docker push $REGISTRY/php:5.4-cli > /dev/null
    - docker build --pull -t $REGISTRY/php:5.4-apache 5.4-apache/ > /dev/null
    - docker push $REGISTRY/php:5.4-apache > /dev/null
    - docker build --pull -t $REGISTRY/php:5.3-fpm 5.3-fpm/ > /dev/null
    - docker push $REGISTRY/php:5.3-fpm > /dev/null

    # tag library namespace
    - NAMESPACE=$REGISTRY/library
    - docker tag $REGISTRY/php:7.1-fpm $NAMESPACE/php:7.1-fpm > /dev/null
    - docker push $NAMESPACE/php:7.1-fpm > /dev/null
    - docker tag $REGISTRY/php:7.1-apache $NAMESPACE/php:7.1-apache > /dev/null
    - docker push $NAMESPACE/php:7.1-apache > /dev/null
    - docker tag $REGISTRY/php:7.1-cli $NAMESPACE/php:7.1-cli > /dev/null
    - docker push $NAMESPACE/php:7.1-cli > /dev/null
    - docker tag $REGISTRY/php:7.0-fpm $NAMESPACE/php:7.0-fpm > /dev/null
    - docker push $NAMESPACE/php:7.0-fpm > /dev/null
    - docker tag $REGISTRY/php:7.0-apache $NAMESPACE/php:7.0-apache > /dev/null
    - docker push $NAMESPACE/php:7.0-apache > /dev/null
    - docker tag $REGISTRY/php:7.0-cli $NAMESPACE/php:7.0-cli > /dev/null
    - docker push $NAMESPACE/php:7.0-cli > /dev/null
    - docker tag $REGISTRY/php:5.6-fpm $NAMESPACE/php:5.6-fpm > /dev/null
    - docker push $NAMESPACE/php:5.6-fpm > /dev/null
    - docker tag $REGISTRY/php:5.6-apache $NAMESPACE/php:5.6-apache > /dev/null
    - docker push $NAMESPACE/php:5.6-apache > /dev/null
    - docker tag $REGISTRY/php:5.6-cli $NAMESPACE/php:5.6-cli > /dev/null
    - docker push $NAMESPACE/php:5.6-cli > /dev/null
    - docker tag $REGISTRY/php:5.5-fpm $NAMESPACE/php:5.5-fpm > /dev/null
    - docker push $NAMESPACE/php:5.5-fpm > /dev/null
    - docker tag $REGISTRY/php:5.5-apache $NAMESPACE/php:5.5-apache > /dev/null
    - docker push $NAMESPACE/php:5.5-apache > /dev/null
    - docker tag $REGISTRY/php:5.5-cli $NAMESPACE/php:5.5-cli > /dev/null
    - docker push $NAMESPACE/php:5.5-cli > /dev/null
    - docker tag $REGISTRY/php:5.4-fpm $NAMESPACE/php:5.4-fpm > /dev/null
    - docker push $NAMESPACE/php:5.4-fpm > /dev/null
    - docker tag $REGISTRY/php:5.4-apache $NAMESPACE/php:5.4-apache > /dev/null
    - docker push $NAMESPACE/php:5.4-apache > /dev/null
    - docker tag $REGISTRY/php:5.4-cli $NAMESPACE/php:5.4-cli > /dev/null
    - docker push $NAMESPACE/php:5.4-cli > /dev/null
    - docker tag $REGISTRY/php:5.3-fpm $NAMESPACE/php:5.3-fpm > /dev/null
    - docker push $NAMESPACE/php:5.3-fpm > /dev/null

    # tags extra for old project.
    - docker tag $REGISTRY/php:5.6-fpm $REGISTRY/php:5.6-fpm-extra
    - docker push $REGISTRY/php:5.6-fpm-extra
    - docker tag $REGISTRY/php:5.5-fpm $REGISTRY/php:5.5-fpm-extra
    - docker push $REGISTRY/php:5.5-fpm-extra
    - docker tag $REGISTRY/php:5.4-fpm $REGISTRY/php:5.4-fpm-extra
    - docker push $REGISTRY/php:5.4-fpm-extra
    - docker tag REGISTRY/php:5.3-fpm $REGISTRY/php:5.3-fpm-extra
    - docker push $REGISTRY/php:5.3-fpm-extra

  only:
    - preprod
    - master
{'fraction_non_alphanumeric': 0.17774639362453343, 'fraction_numerical': 0.04368001614042167, 'mean_word_length': 2.4010291595197257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 137, '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': '1492213', 'n_tokens_mistral': 4557, 'n_tokens_neox': 4311, 'n_words': 774}