<commit_before>build:
  box: corekube/basics:0.0.3
  # The steps that will be executed in the build pipeline
  steps:
    # noop
    - script:
        name: noop (for now)
        code: |
          echo

  # Notify slack
  after-steps:
    - metral/slack-notifier@1.2.2:
        url: $SLACK_URL
        channel: $SLACK_CHANNEL
        username: $SLACK_USER

deploy:
  box: corekube/basics:0.0.3
  # The steps that will be executed in the DEPLOY pipeline

  # Get host SSH fingerprints
  dev:
    - script:
        name: retreive host fingerprints
        code: |
          FP=`TARGET_HOST=$KUBERNETES_MASTER_PUBLIC_IP; file=$(mktemp); ssh-keyscan $TARGET_HOST > $file 2> /dev/null; sed -i '/ssh-ed25519/d' $file; ssh-keygen -l -f $file | awk '{print $2}'`
          export FP1=$(echo $FP | awk -F " " '{print $1}')
          export FP2=$(echo $FP | awk -F " " '{print $2}')

    - add-ssh-key:
        keyname: KUBERNETES_SSH_KEY
    - add-to-known_hosts:
        hostname: $KUBERNETES_MASTER_PUBLIC_IP
        fingerprint: $FP1
    - add-to-known_hosts:
        hostname: $KUBERNETES_MASTER_PUBLIC_IP
        fingerprint: $FP2

    # Setup kubectl
    - script:
        name: setup kubectl
        code: |
          curl -s -o /tmp/setup-kubectl.sh https://gist.githubusercontent.com/metral/ce436c6d70b4324262b8dcbd81ce8f34/raw/57e2f1aa107a6f2d1721aa36b69847b53554db9c/setup-wercker-kubectl.sh
          chmod +x /tmp/setup-kubectl.sh
          /tmp/setup-kubectl.sh

    # rollout
    - script:
        name: rollout to dev
        code: |
          ./rollout.sh -e dev

# Stage deploy pipeline
stage:
  box: corekube/basics:0.0.3
  steps:
  - script:
      name: retreive host fingerprints
      code: |
        FP=`TARGET_HOST=$KUBERNETES_MASTER_PUBLIC_IP; file=$(mktemp); ssh-keyscan $TARGET_HOST > $file 2> /dev/null; sed -i '/ssh-ed25519/d' $file; ssh-keygen -l -f $file | awk '{print $2}'`
        export FP1=$(echo $FP | awk -F " " '{print $1}')
        export FP2=$(echo $FP | awk -F " " '{print $2}')

  - add-ssh-key:
      keyname: KUBERNETES_SSH_KEY
  - add-to-known_hosts:
      hostname: $KUBERNETES_MASTER_PUBLIC_IP
      fingerprint: $FP1
  - add-to-known_hosts:
      hostname: $KUBERNETES_MASTER_PUBLIC_IP
      fingerprint: $FP2

  # Setup kubectl
  - script:
      name: setup kubectl
      code: |
        curl -s -o /tmp/setup-kubectl.sh https://gist.githubusercontent.com/metral/ce436c6d70b4324262b8dcbd81ce8f34/raw/57e2f1aa107a6f2d1721aa36b69847b53554db9c/setup-wercker-kubectl.sh
        chmod +x /tmp/setup-kubectl.sh
        /tmp/setup-kubectl.sh

  # rollout
  - script:
      name: rollout to stage
      code: |
        ./rollout.sh -e stage

  # Notify slack of build status
  after-steps:
    - metral/slack-notifier@1.2.2:
        url: $SLACK_URL
        channel: $SLACK_CHANNEL
        username: $SLACK_USER

# Prod deploy pipeline
prod:
  box: corekube/basics:0.0.3
  steps:
  - script:
      name: retreive host fingerprints
      code: |
        FP=`TARGET_HOST=$KUBERNETES_MASTER_PUBLIC_IP; file=$(mktemp); ssh-keyscan $TARGET_HOST > $file 2> /dev/null; sed -i '/ssh-ed25519/d' $file; ssh-keygen -l -f $file | awk '{print $2}'`
        export FP1=$(echo $FP | awk -F " " '{print $1}')
        export FP2=$(echo $FP | awk -F " " '{print $2}')

  - add-ssh-key:
      keyname: KUBERNETES_SSH_KEY
  - add-to-known_hosts:
      hostname: $KUBERNETES_MASTER_PUBLIC_IP
      fingerprint: $FP1
  - add-to-known_hosts:
      hostname: $KUBERNETES_MASTER_PUBLIC_IP
      fingerprint: $FP2

  # Setup kubectl
  - script:
      name: setup kubectl
      code: |
        curl -s -o /tmp/setup-kubectl.sh https://gist.githubusercontent.com/metral/ce436c6d70b4324262b8dcbd81ce8f34/raw/57e2f1aa107a6f2d1721aa36b69847b53554db9c/setup-wercker-kubectl.sh
        chmod +x /tmp/setup-kubectl.sh
        /tmp/setup-kubectl.sh

  # rollout<commit_msg>feat: update corekube/basics to v0.0.4<commit_after>build:
  box: corekube/basics:0.0.4
  # The steps that will be executed in the build pipeline
  steps:
    # noop
    - script:
        name: noop (for now)
        code: |
          echo

  # Notify slack
  after-steps:
    - metral/slack-notifier@1.2.2:
        url: $SLACK_URL
        channel: $SLACK_CHANNEL
        username: $SLACK_USER

deploy:
  box: corekube/basics:0.0.4
  # The steps that will be executed in the DEPLOY pipeline

  # Get host SSH fingerprints
  dev:
    - script:
        name: retreive host fingerprints
        code: |
          FP=`TARGET_HOST=$KUBERNETES_MASTER_PUBLIC_IP; file=$(mktemp); ssh-keyscan $TARGET_HOST > $file 2> /dev/null; sed -i '/ssh-ed25519/d' $file; ssh-keygen -l -f $file | awk '{print $2}'`
          export FP1=$(echo $FP | awk -F " " '{print $1}')
          export FP2=$(echo $FP | awk -F " " '{print $2}')

    - add-ssh-key:
        keyname: KUBERNETES_SSH_KEY
    - add-to-known_hosts:
        hostname: $KUBERNETES_MASTER_PUBLIC_IP
        fingerprint: $FP1
    - add-to-known_hosts:
        hostname: $KUBERNETES_MASTER_PUBLIC_IP
        fingerprint: $FP2

    # Setup kubectl
    - script:
        name: setup kubectl
        code: |
          curl -s -o /tmp/setup-kubectl.sh https://gist.githubusercontent.com/metral/ce436c6d70b4324262b8dcbd81ce8f34/raw/57e2f1aa107a6f2d1721aa36b69847b53554db9c/setup-wercker-kubectl.sh
          chmod +x /tmp/setup-kubectl.sh
          /tmp/setup-kubectl.sh

    # rollout
    - script:
        name: rollout to dev
        code: |
          ./rollout.sh -e dev

# Stage deploy pipeline
stage:
  box: corekube/basics:0.0.4
  steps:
  - script:
      name: retreive host fingerprints
      code: |
        FP=`TARGET_HOST=$KUBERNETES_MASTER_PUBLIC_IP; file=$(mktemp); ssh-keyscan $TARGET_HOST > $file 2> /dev/null; sed -i '/ssh-ed25519/d' $file; ssh-keygen -l -f $file | awk '{print $2}'`
        export FP1=$(echo $FP | awk -F " " '{print $1}')
        export FP2=$(echo $FP | awk -F " " '{print $2}')

  - add-ssh-key:
      keyname: KUBERNETES_SSH_KEY
  - add-to-known_hosts:
      hostname: $KUBERNETES_MASTER_PUBLIC_IP
      fingerprint: $FP1
  - add-to-known_hosts:
      hostname: $KUBERNETES_MASTER_PUBLIC_IP
      fingerprint: $FP2

  # Setup kubectl
  - script:
      name: setup kubectl
      code: |
        curl -s -o /tmp/setup-kubectl.sh https://gist.githubusercontent.com/metral/ce436c6d70b4324262b8dcbd81ce8f34/raw/57e2f1aa107a6f2d1721aa36b69847b53554db9c/setup-wercker-kubectl.sh
        chmod +x /tmp/setup-kubectl.sh
        /tmp/setup-kubectl.sh

  # rollout
  - script:
      name: rollout to stage
      code: |
        ./rollout.sh -e stage

  # Notify slack of build status
  after-steps:
    - metral/slack-notifier@1.2.2:
        url: $SLACK_URL
        channel: $SLACK_CHANNEL
        username: $SLACK_USER

# Prod deploy pipeline
prod:
  box: corekube/basics:0.0.4
  steps:
  - script:
      name: retreive host fingerprints
      code: |
        FP=`TARGET_HOST=$KUBERNETES_MASTER_PUBLIC_IP; file=$(mktemp); ssh-keyscan $TARGET_HOST > $file 2> /dev/null; sed -i '/ssh-ed25519/d' $file; ssh-keygen -l -f $file | awk '{print $2}'`
        export FP1=$(echo $FP | awk -F " " '{print $1}')
        export FP2=$(echo $FP | awk -F " " '{print $2}')

  - add-ssh-key:
      keyname: KUBERNETES_SSH_KEY
  - add-to-known_hosts:
      hostname: $KUBERNETES_MASTER_PUBLIC_IP
      fingerprint: $FP1
  - add-to-known_hosts:
      hostname: $KUBERNETES_MASTER_PUBLIC_IP
      fingerprint: $FP2

  # Setup kubectl
  - script:
      name: setup kubectl
      code: |
        curl -s -o /tmp/setup-kubectl.sh https://gist.githubusercontent.com/metral/ce436c6d70b4324262b8dcbd81ce8f34/raw/57e2f1aa107a6f2d1721aa36b69847b53554db9c/setup-wercker-kubectl.sh
        chmod +x /tmp/setup-kubectl.sh
        /tmp/setup-kubectl.sh

  # rollout
{'fraction_non_alphanumeric': 0.12208628461043142, 'fraction_numerical': 0.049839021249195106, 'mean_word_length': 2.436283185840708, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 6, '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': '3247662', 'n_tokens_mistral': 3348, 'n_tokens_neox': 3077, 'n_words': 601}