<commit_before>---
stages:
  - name: prepare-env
    exec:
      - $NOTIFY --data-urlencode "status=2" --data-urlencode "current-stage=$STAGE"
      - git clone -b $FLEXIO_SCRIPTS_BRANCH $FLEXIO_SCRIPTS $WORKSPACE/flexio-ci-scripts && export PATH=$PATH:$WORKSPACE/flexio-ci-scripts/bin
      - docker pull $CI_TOOLS_IMAGE
      - mkdir -p $M2
      - mkdir -p $WORKSPACE/.composer
      - mkdir -p $WORKSPACE/gnupg
      - $DOCKER gpg --homedir /gnupg --list-keys
      - $DOCKER_CMD -v $WORKSPACE/gnupg:/gnupg -v $WORKSPACE/secrets/codesigning.asc:/codesigning.asc $CI_TOOLS_IMAGE gpg --homedir /gnupg --batch --import /codesigning.asc

  - name: build
    timeout: 16
    exec:
      - $NOTIFY --data-urlencode "status=2" --data-urlencode "current-stage=$STAGE"
      - $MVN clean install -e

  - name: deploy
    timeout: 15
    exec:
      - $NOTIFY --data-urlencode "status=2" --data-urlencode "current-stage=$STAGE"
      - $MVN_DEPLOY
    onlyWhen:
      - branch in (master, develop)

onSuccess:
  - name: metadata-management
    exec:
      - $NOTIFY --data-urlencode "status=2" --data-urlencode "current-stage=$STAGE"
      - $UPLOAD_PROJECT_METADATA
      - $TRIGGER_DOWNSTREAM
    onlyWhen:
      - branch in (master, develop)
  - name: notify-flexio
    exec:
      - $NOTIFY --data-urlencode "status=0" --data-urlencode "current-stage="


onError:
  - name: notify-flexio
    exec:
      - $NOTIFY --data-urlencode "status=1" --data-urlencode "current-stage="

cleanup:
  - name: maven-clean
    exec:
      - $MVN -q clean

  - name: m2-repository-clean
    exec:
      - rm -rf $M2/repository/org/codingmatters
      - rm -rf $M2/repository/io/flexio
env:
  - FLEXIO_SCRIPTS: <EMAIL>:Flexio-corp/flexio-ci-scripts.git
  - FLEXIO_SCRIPTS_BRANCH: master

  - PIPELINES_URL: https://pipelines.ci.flexio.io/pipelines
  - DEPENDENCIES_URL: https://dependencies.ci.flexio.io/poomci-dependency-api
  - CI_TOOLS_IMAGE: codingmatters/ci-tools:0.0.1-SNAPSHOT

  - M2: /tmp/m2
  - DOCKER_VOLUMES: -v $SRC:/src -v $M2:/m2 -v $WORKSPACE/secrets/settings.xml:/settings.xml -v $WORKSPACE/gnupg:/gnupg -v $WORKSPACE/flexio-ci-scripts:/flexio-ci-scripts -v $WORKSPACE/.composer:/.composer
  - DOCKER_ENV: --env REPOSITORY_ID="$REPOSITORY_ID" --env REPOSITORY="$REPOSITORY" --env CHECKOUT_SPEC="$CHECKOUT_SPEC" --env M2_LOCAL_REPO="/m2"
  - DOCKER_CMD: docker run --user $(id -u):$(id -g) --rm
  - DOCKER: $DOCKER_CMD $DOCKER_ENV $DOCKER_VOLUMES $CI_TOOLS_IMAGE

  - MVN_OPTS: -B -Dcodingmatters.docker.namespace=codingmatters -Ddocker.registry=registry.containers.ovh.net -Dphp.tests.are.forced=true
  - MVN: $DOCKER mvn -Dmaven.repo.local=/m2 --settings /settings.xml $MVN_OPTS
  - MVN_DEPLOY: $MVN deploy -DskipTests -Pattach-source-and-javadocs,sign-artifacts -Dgpg.passphrase=$GPG_PASS -Dgpg.homedir=/gnupg

  - UPLOAD_PROJECT_METADATA: $DOCKER /flexio-ci-scripts/bin/upload-project-metadata.sh $DEPENDENCIES_URL /src
  - TRIGGER_DOWNSTREAM: $DOCKER /usr/local/bin/trigger-downstream.sh $PIPELINES_URL $DEPENDENCIES_URL $REPOSITORY_ID "$REPOSITORY" "$CHECKOUT_SPEC"

  - NOTIFY: curl -G "https://my.flexio.io/channelApi/flexHttpInOut/59d3a0105d443519843d0496/5adf40aededdbb452368cfca" --data-urlencode "repository=$REPOSITORY" --data-urlencode "branch=$BRANCH" --data-urlencode "pipeline-id=$PIPELINE_ID"

secrets:
  - name: settings.xml
    content: $SRC/.poom-ci-pipeline/settings-oss.xml.enc
    as: file<commit_msg>reactivating downstream build<commit_after>---
stages:
  - name: prepare-env
    exec:
      - $NOTIFY --data-urlencode "status=2" --data-urlencode "current-stage=$STAGE"
      - git clone -b $FLEXIO_SCRIPTS_BRANCH $FLEXIO_SCRIPTS $WORKSPACE/flexio-ci-scripts && export PATH=$PATH:$WORKSPACE/flexio-ci-scripts/bin
      - docker pull $CI_TOOLS_IMAGE
      - mkdir -p $M2
      - mkdir -p $WORKSPACE/.composer
      - mkdir -p $WORKSPACE/gnupg
      - $DOCKER gpg --homedir /gnupg --list-keys
      - $DOCKER_CMD -v $WORKSPACE/gnupg:/gnupg -v $WORKSPACE/secrets/codesigning.asc:/codesigning.asc $CI_TOOLS_IMAGE gpg --homedir /gnupg --batch --import /codesigning.asc

  - name: build
    timeout: 16
    exec:
      - $NOTIFY --data-urlencode "status=2" --data-urlencode "current-stage=$STAGE"
      - $MVN clean install -e

  - name: deploy
    timeout: 15
    exec:
      - $NOTIFY --data-urlencode "status=2" --data-urlencode "current-stage=$STAGE"
      - $MVN_DEPLOY
    onlyWhen:
      - branch in (master, develop)

onSuccess:
  - name: metadata-management
    exec:
      - $NOTIFY --data-urlencode "status=2" --data-urlencode "current-stage=$STAGE"
      - $UPLOAD_PROJECT_METADATA
      - $TRIGGER_DOWNSTREAM
    onlyWhen:
      - branch in (master, develop)
  - name: notify-flexio
    exec:
      - $NOTIFY --data-urlencode "status=0" --data-urlencode "current-stage="


onError:
  - name: notify-flexio
    exec:
      - $NOTIFY --data-urlencode "status=1" --data-urlencode "current-stage="

cleanup:
  - name: maven-clean
    exec:
      - $MVN -q clean

  - name: m2-repository-clean
    exec:
      - rm -rf $M2/repository/org/codingmatters
      - rm -rf $M2/repository/io/flexio
env:
  - FLEXIO_SCRIPTS: <EMAIL>:Flexio-corp/flexio-ci-scripts.git
  - FLEXIO_SCRIPTS_BRANCH: master

  - PIPELINES_URL: https://pipelines.ci.flexio.io/pipelines
  - DEPENDENCIES_URL: https://dependencies.ci.flexio.io/poomci-dependency-api
  - CI_TOOLS_IMAGE: codingmatters/ci-tools:0.0.1-SNAPSHOT

  - M2: /tmp/m2
  - DOCKER_VOLUMES: -v $SRC:/src -v $M2:/m2 -v $WORKSPACE/secrets/settings.xml:/settings.xml -v $WORKSPACE/gnupg:/gnupg -v $WORKSPACE/flexio-ci-scripts:/flexio-ci-scripts -v $WORKSPACE/.composer:/.composer
  - DOCKER_ENV: --env REPOSITORY_ID="$REPOSITORY_ID" --env REPOSITORY="$REPOSITORY" --env CHECKOUT_SPEC="$CHECKOUT_SPEC" --env M2_LOCAL_REPO="/m2"
  - DOCKER_CMD: docker run --user $(id -u):$(id -g) --rm
  - DOCKER: $DOCKER_CMD $DOCKER_ENV $DOCKER_VOLUMES $CI_TOOLS_IMAGE

  - MVN_OPTS: -B -Dcodingmatters.docker.namespace=codingmatters -Ddocker.registry=registry.containers.ovh.net -Dphp.tests.are.forced=true
  - MVN: $DOCKER mvn -Dmaven.repo.local=/m2 --settings /settings.xml $MVN_OPTS
  - MVN_DEPLOY: $MVN deploy -DskipTests -Pattach-source-and-javadocs,sign-artifacts -Dgpg.passphrase=$<PASSWORD> -Dgpg.homedir=/gnupg

  - UPLOAD_PROJECT_METADATA: $DOCKER /flexio-ci-scripts/bin/upload-project-metadata.sh $DEPENDENCIES_URL /src
  - TRIGGER_DOWNSTREAM: docker run --rm $DOCKER_ENV $DOCKER_VOLUMES $CI_TOOLS_IMAGE /usr/local/bin/trigger-downstream.sh $PIPELINES_URL $DEPENDENCIES_URL $REPOSITORY_ID "$REPOSITORY" "$CHECKOUT_SPEC"

  - NOTIFY: curl -G "https://my.flexio.io/channelApi/flexHttpInOut/59d3a0105d443519843d0496/5adf40aededdbb452368cfca" --data-urlencode "repository=$REPOSITORY" --data-urlencode "branch=$BRANCH" --data-urlencode "pipeline-id=$PIPELINE_ID"

secrets:
  - name: settings.xml
    content: $SRC/.poom-ci-pipeline/settings-oss.xml.enc
    as: file
{'fraction_non_alphanumeric': 0.14492334393983222, 'fraction_numerical': 0.015331212033555105, 'mean_word_length': 3.2475429975429977, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '4188153', 'n_tokens_mistral': 2876, 'n_tokens_neox': 2751, 'n_words': 452}