<commit_before>#!/usr/bin/env bash

BASE_DIR="$PWD"

mkdir $BASE_DIR/verify-cpi

echo 'Creating CPI release...'
bosh-go create-release --dir packages-src-out --tarball=$BASE_DIR/verify-cpi/cpi-release.tgz

cd $BASE_DIR/validator-src-in

mkdir stemcell
tar -cvzf stemcell.tgz stemcell
rmdir stemcell
cat > validator.yml <<EOF
---
openstack:
  auth_url: http://localhost/v3 # Keystone V3 URL
  username: novalue
  password: <PASSWORD>
  domain: novalue
  project: novalue
  default_key_name: cf-validator
  default_security_groups: [default]
  boot_from_volume: false
  config_drive: ~

validator:
  use_external_ip: false
  network_id: novalue
  floating_ip: novalue
  static_ip: novalue
  private_key_path: cf-validator.rsa_id
  public_image_id: novalue
  ntp: [0.pool.ntp.org, 1.pool.ntp.org]
  mtu_size: 1500
  releases:
  - name: bosh-openstack-cpi
    url: https://bosh.io/d/github.com/cloudfoundry-incubator/bosh-openstack-cpi-release?v=33
    sha1: 86b8eedcb0a6be3e821a5d0042916180706262be

cloud_config:
  vm_types: []
EOF

echo 'Installing validator dependencies...'
bundle install

useradd -m vali

echo 'Running validator...'
sudo -H -u vali ./validate --tag cpi_only --stemcell stemcell.tgz \
    --config validator.yml \
    --cpi $BASE_DIR/verify-cpi/cpi-release.tgz \
    --verbose<commit_msg>Change verify-cpi job in auto-update pipeline to use vendor/package<commit_after>#!/usr/bin/env bash

BASE_DIR="$PWD"

mkdir $BASE_DIR/verify-cpi

echo 'Creating CPI release...'
bosh-go create-release --dir packages-src-out --tarball=$BASE_DIR/verify-cpi/cpi-release.tgz

cd $BASE_DIR/validator-src-in

mkdir stemcell
tar -cvzf stemcell.tgz stemcell
rmdir stemcell
cat > validator.yml <<EOF
---
openstack:
  auth_url: http://localhost/v3 # Keystone V3 URL
  username: novalue
  password: <PASSWORD>
  domain: novalue
  project: novalue
  default_key_name: cf-validator
  default_security_groups: [default]
  boot_from_volume: false
  config_drive: ~

validator:
  use_external_ip: false
  network_id: novalue
  floating_ip: novalue
  static_ip: novalue
  private_key_path: cf-validator.rsa_id
  public_image_id: novalue
  ntp: [0.pool.ntp.org, 1.pool.ntp.org]
  mtu_size: 1500
  releases:
  - name: bosh-openstack-cpi
    url: https://bosh.io/d/github.com/cloudfoundry-incubator/bosh-openstack-cpi-release?v=33
    sha1: 86b8eedcb0a6be3e821a5d0042916180706262be

cloud_config:
  vm_types: []
EOF

echo 'Installing validator dependencies...'
BUNDLE_CACHE_PATH="vendor/package" bundle install --local --deployment --path .bundle

useradd -m vali

echo 'Running validator...'
sudo -H -u vali ./validate --tag cpi_only --stemcell stemcell.tgz \
    --config validator.yml \
    --cpi $BASE_DIR/verify-cpi/cpi-release.tgz \
    --verbose
{'fraction_non_alphanumeric': 0.1153705732018985, 'fraction_numerical': 0.02701715954728003, 'mean_word_length': 3.8841354723707666, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '7477101', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1035, 'n_words': 216}