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

set -e

source bosh-cpi-src/ci/tasks/utils.sh
source /etc/profile.d/chruby-with-ruby-2.1.2.sh

check_param google_project
check_param google_region
check_param google_zone
check_param google_json_key_data
check_param google_network
check_param google_firewall_internal
check_param google_address_director
check_param base_os
check_param stemcell_name
check_param director_username
check_param director_password

deployment_dir="${PWD}/deployment"
dummy_manifest_filename="${deployment_dir}/${base_os}-dummy-manifest.yml"
google_json_key=${deployment_dir}/google_key.json

echo "Creating google json key..."
echo "${google_json_key_data}" > ${google_json_key}
mkdir -p $HOME/.config/gcloud/
cp ${google_json_key} $HOME/.config/gcloud/application_default_credentials.json

echo "Configuring google account..."
gcloud auth activate-service-account --key-file $HOME/.config/gcloud/application_default_credentials.json
gcloud config set project ${google_project}
gcloud config set compute/region ${google_region}
gcloud config set compute/zone ${google_zone}

echo "Looking for director IP..."
director_ip=$(gcloud compute addresses describe ${google_address_director} --format json | jq -r '.address')

echo "Using BOSH CLI version..."
bosh version

echo "Targeting BOSH director..."
bosh -n target ${director_ip}
bosh login ${director_username} ${director_password}

echo "Creating ${dummy_manifest_filename}..."
cat > ${dummy_manifest_filename} <<EOF
---
name: dummy
director_uuid: $(bosh status --uuid)

releases:
  - name: dummy
    version: latest

compilation:
  workers: 1
  network: private
  reuse_compilation_vms: true
  cloud_properties:
    machine_type: n1-standard-2
    root_disk_size_gb: 20
    root_disk_type: pd-standard

update:
  canaries: 1
  canary_watch_time: 3000-90000
  update_watch_time: 3000-90000
  max_in_flight: 1

resource_pools:
  - name: default
    stemcell:
      name: ${stemcell_name}
      version: latest
    network: private
    cloud_properties:
      machine_type: n1-standard-2
      root_disk_size_gb: 20
      root_disk_type: pd-standard

networks:
  - name: private
    type: dynamic
    cloud_properties:
      network_name: ${google_network}
      tags:
        - ${google_firewall_internal}

jobs:<commit_msg>Add ephemeral ip to dummy deployment<commit_after>#!/usr/bin/env bash

set -e

source bosh-cpi-src/ci/tasks/utils.sh
source /etc/profile.d/chruby-with-ruby-2.1.2.sh

check_param google_project
check_param google_region
check_param google_zone
check_param google_json_key_data
check_param google_network
check_param google_firewall_internal
check_param google_address_director
check_param base_os
check_param stemcell_name
check_param director_username
check_param director_password

deployment_dir="${PWD}/deployment"
dummy_manifest_filename="${deployment_dir}/${base_os}-dummy-manifest.yml"
google_json_key=${deployment_dir}/google_key.json

echo "Creating google json key..."
echo "${google_json_key_data}" > ${google_json_key}
mkdir -p $HOME/.config/gcloud/
cp ${google_json_key} $HOME/.config/gcloud/application_default_credentials.json

echo "Configuring google account..."
gcloud auth activate-service-account --key-file $HOME/.config/gcloud/application_default_credentials.json
gcloud config set project ${google_project}
gcloud config set compute/region ${google_region}
gcloud config set compute/zone ${google_zone}

echo "Looking for director IP..."
director_ip=$(gcloud compute addresses describe ${google_address_director} --format json | jq -r '.address')

echo "Using BOSH CLI version..."
bosh version

echo "Targeting BOSH director..."
bosh -n target ${director_ip}
bosh login ${director_username} ${director_password}

echo "Creating ${dummy_manifest_filename}..."
cat > ${dummy_manifest_filename} <<EOF
---
name: dummy
director_uuid: $(bosh status --uuid)

releases:
  - name: dummy
    version: latest

compilation:
  workers: 1
  network: private
  reuse_compilation_vms: true
  cloud_properties:
    machine_type: n1-standard-2
    root_disk_size_gb: 20
    root_disk_type: pd-standard

update:
  canaries: 1
  canary_watch_time: 3000-90000
  update_watch_time: 3000-90000
  max_in_flight: 1

resource_pools:
  - name: default
    stemcell:
      name: ${stemcell_name}
      version: latest
    network: private
    cloud_properties:
      machine_type: n1-standard-2
      root_disk_size_gb: 20
      root_disk_type: pd-standard

networks:
  - name: private
    type: dynamic
    cloud_properties:
      network_name: ${google_network}
      ephemeral_external_ip: true
      tags:
        - ${google_firewall_internal}

jobs:
{'fraction_non_alphanumeric': 0.09678810088381117, 'fraction_numerical': 0.01379607674067687, 'mean_word_length': 4.8, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3185356', 'n_tokens_mistral': 1575, 'n_tokens_neox': 1478, 'n_words': 352}