<commit_before>stages:
  - build
  - linting
  - code_analysis
  - testing
  - release

variables:
  CONTAINER_TEST_IMAGE: docker.implisense.com/dalphi/dalphi:$CI_BUILD_REF_NAME
  CONTAINER_PRODUCTION_IMAGE: docker.implisense.com/dalphi/dalphi:latest
  POSTGRES_DB: dalphi
  POSTGRES_USER: dalphi
  POSTGRES_PASSWORD: <PASSWORD>

build:
  stage: build
  tags:
    - build
  image: docker:git
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN docker.implisense.com
    - docker build -t $CONTAINER_TEST_IMAGE --build-arg RAILS_ENV=test .
    - docker push $CONTAINER_TEST_IMAGE

linting:
  stage: linting
  tags:
    - build
  image: $CONTAINER_TEST_IMAGE
  script:
    - bin/linters

code_analysis:
  stage: code_analysis
  tags:
    - build
  image: $CONTAINER_TEST_IMAGE
  script:
    - bin/code-analyzers

testing:
  stage: testing
  tags:
    - build
  image: $CONTAINER_TEST_IMAGE
  environment:
    - DATABASE_HOST=database
    - DATABASE_NAME=dalphi
    - DATABASE_PASSWORD=<PASSWORD>
    - DATABASE_PORT=5432
    - DATABASE_USERNAME=dalphi
    - RAILS_ENV=production
    - RAILS_SERVE_STATIC_FILES=true
    - REDIS_HOST=redis
    - SECRET_KEY_BASE=<KEY>
    - HOST=dalphi
  services:
    - postgres
    - redis
  script:
    - bin/test

release:
  stage: release
  tags:<commit_msg>fix .gitlab-ci.yml syntax error<commit_after>stages:
  - build
  - linting
  - code_analysis
  - testing
  - release

variables:
  CONTAINER_TEST_IMAGE: "docker.implisense.com/dalphi/dalphi:$CI_BUILD_REF_NAME"
  CONTAINER_PRODUCTION_IMAGE: "docker.implisense.com/dalphi/dalphi:latest"
  POSTGRES_DB: "dalphi"
  POSTGRES_USER: "dalphi"
  POSTGRES_PASSWORD: "<PASSWORD>"

build:
  stage: build
  tags:
    - build
  image: docker:git
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN docker.implisense.com
    - docker build -t $CONTAINER_TEST_IMAGE --build-arg RAILS_ENV=test .
    - docker push $CONTAINER_TEST_IMAGE

linting:
  stage: linting
  tags:
    - build
  image: $CONTAINER_TEST_IMAGE
  script:
    - bin/linters

code_analysis:
  stage: code_analysis
  tags:
    - build
  image: $CONTAINER_TEST_IMAGE
  script:
    - bin/code-analyzers

testing:
  stage: testing
  tags:
    - build
  image: $CONTAINER_TEST_IMAGE
  variables:
    DATABASE_HOST: "database"
    DATABASE_NAME: "dalphi"
    DATABASE_PASSWORD: "<PASSWORD>"
    DATABASE_PORT: "5432"
    DATABASE_USERNAME: "dalphi"
    RAILS_ENV: "production"
    RAILS_SERVE_STATIC_FILES: "true"
    REDIS_HOST: "redis"
    SECRET_KEY_BASE: "<KEY>"
    HOST: "dalphi"
  services:
    - postgres
    - redis
  script:
    - bin/test

release:
  stage: release
  tags:
{'fraction_non_alphanumeric': 0.09320754716981132, 'fraction_numerical': 0.0030188679245283017, 'mean_word_length': 3.2012678288431062, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3164258', 'n_tokens_mistral': 1083, 'n_tokens_neox': 1024, 'n_words': 184}