exports.migrate = function(input) {
  // To view JavaScript console logs in the Rails debug log, be sure to make them single value and to only pass them
  // strings.  JSON.stringify is an easy way to dump a structure.
  console.log('the properties passed to migrate are: ');
  console.log(JSON.stringify(input));
  input.variable_migrations.push({
    from: input.properties['.web_server.generated_secret_to_migrate_to_credhub_<%= previous_major_and_minor_version %>'],
    to_variable: 'generated-secret-migrated-to-credhub'
  });
  return input;
};

exports.migrate = function(input) {
  // To view JavaScript console logs in the Rails debug log, be sure to make them single value and to only pass them
  // strings.  JSON.stringify is an easy way to dump a structure.
  console.log('the properties passed to migrate are: ');
  console.log(JSON.stringify(input));
  //migrate a secret
  input.variable_migrations.push({
    from: input.properties['.web_server.generated_secret_to_migrate_to_credhub_<%= previous_major_and_minor_version %>'],
    to_variable: 'generated-secret-migrated-to-credhub'
  });
  //migrate an rsa key
  input.variable_migrations.push({
    from: input.properties['.web_server.generated_rsa_pkey_credentials_to_migrate_to_credhub_<%= previous_major_and_minor_version %>'],
    to_variable: 'generated-rsa-key-migrated-to-credhub'
  });
  return input;
};

Add a migration to migrate an rsa pkey credential
Add a migration to migrate an rsa pkey credential

[#143464505]

Signed-off-by: Tom Dunlap <329c7d75de881b58d3d971dc02fa4530c06ae3cb@pivotal.io>
