<commit_before>deploy-staging-us-central1:
  # Only deploy to staging env from $APP-env staging branch, kicking off rollout
  only:
    refs:
      - staging
  stage: deploy-staging-us-central1
  image: gcr.io/cloud-builders/gke-deploy:stable
  tags:
  - cluster:staging-us-central1
  script:
    # Work around for https://github.com/kubernetes/kubernetes/issues/36072
    # Stated solution is to use "--force" or "kubectl create"; gke-deploy does not have this option so the following works
    # Get all services that have the "kubectl.kubernetes.io/last-applied-configuration" annotation and put into an environment variable
    - export SERVICENAMES=$(kubectl get svc -o jsonpath="{range .items[?(@.metadata.annotations.kubectl\.kubernetes\.io/last-applied-configuration)]}{.metadata.name}{':'}{end}")
    # for each service name, remove the annotation
    - echo $SERVICENAMES | tr -d '\n' | tr ':' '\0' | xargs -0 -I {} kubectl annotate svc {} kubectl.kubernetes.io/last-applied-configuration-
    - /gke-deploy run --filename stg.yaml

deploy-prod-us-east1:
  # Only deploy when running on master in $APP-env
  only:
    refs:
      - master
  stage: deploy-prod-us-east1
  image: gcr.io/cloud-builders/gke-deploy:stable
  tags:
  - cluster:prod-us-east1
  script:
  - /gke-deploy run --filename prod.yaml

deploy-prod-us-central1:
  # Only deploy when running on master in $APP-env
  only:
    refs:
      - master
  stage: deploy-prod-us-central1
  image: gcr.io/cloud-builders/gke-deploy:stable
  tags:
  - cluster:prod-us-central1
  script:
  - |
  - /gke-deploy run --filename prod.yaml

rollout-approval:
  # Only require manual approval on master in $APP-env
  only:
    refs:
      - master
  stage: rollout-approval
  script:
  - echo "Continue with production rollout"
  when: manual<commit_msg>Bug: b/151100213 - Adding a check for file existance before calling the gke-deploy and skipping if file does not exist<commit_after>deploy-staging-us-central1:
  # Only deploy to staging env from $APP-env staging branch, kicking off rollout
  only:
    refs:
      - staging
  stage: deploy-staging-us-central1
  image: gcr.io/cloud-builders/gke-deploy:stable
  tags:
  - cluster:staging-us-central1
  script:
    # Work around for https://github.com/kubernetes/kubernetes/issues/36072
    # Stated solution is to use "--force" or "kubectl create"; gke-deploy does not have this option so the following works
    # Get all services that have the "kubectl.kubernetes.io/last-applied-configuration" annotation and put into an environment variable
    - export SERVICENAMES=$(kubectl get svc -o jsonpath="{range .items[?(@.metadata.annotations.kubectl\.kubernetes\.io/last-applied-configuration)]}{.metadata.name}{':'}{end}")
    # for each service name, remove the annotation
    - echo $SERVICENAMES | tr -d '\n' | tr ':' '\0' | xargs -0 -I {} kubectl annotate svc {} kubectl.kubernetes.io/last-applied-configuration-
    - /gke-deploy run --filename stg.yaml

deploy-prod-us-east1:
  # Only deploy when running on master in $APP-env
  only:
    refs:
      - master
  stage: deploy-prod-us-east1
  image: gcr.io/cloud-builders/gke-deploy:stable
  tags:
  - cluster:prod-us-east1
  script:
  - if [ -f ./prod.yaml ]; then /gke-deploy run --filename prod.yaml; fi

deploy-prod-us-central1:
  # Only deploy when running on master in $APP-env
  only:
    refs:
      - master
  stage: deploy-prod-us-central1
  image: gcr.io/cloud-builders/gke-deploy:stable
  tags:
  - cluster:prod-us-central1
  script:
  - |
  - if [ -f ./prod.yaml ]; then /gke-deploy run --filename prod.yaml; fi

rollout-approval:
  # Only require manual approval on master in $APP-env
  only:
    refs:
      - master
  stage: rollout-approval
  script:
  - echo "Continue with production rollout"
  when: manual
{'fraction_non_alphanumeric': 0.11811231215396784, 'fraction_numerical': 0.010809385710519377, 'mean_word_length': 3.1646542261251374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2131612', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1249, 'n_words': 347}