All Projects → pivotal → hammer

pivotal / hammer

Licence: Apache-2.0 license
Wrapper CLI for interacting with OM, BOSH and others for PCF environments

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Labels

Projects that are alternatives of or similar to hammer

Quantifying-ESG-Alpha-using-Scholar-Big-Data-ICAIF-2020
Quantifying ESG Alpha using Scholar Big Data: An Automated Machine Learning Approach.
Stars: ✭ 42 (+200%)
Mutual labels:  esg
logue-osc
Custom oscillators for Korg logue-sdk compatible synths. Contains Oscillator API extensions and reusable header to create wavetable-based oscilator and example web page for user wave data injection.
Stars: ✭ 81 (+478.57%)
Mutual labels:  esg
spring-boot-performance-analysis
How to tune Spring Boot + HikariCP for the cloud - avoiding the common mistakes
Stars: ✭ 38 (+171.43%)
Mutual labels:  pcf
cf-rabbitmq-release
A BOSH Release of RabbitMQ
Stars: ✭ 29 (+107.14%)
Mutual labels:  pcf
PCFControls
PCF Controls available for Model Driven Apps in order to enhance the out of the box capabilities !
Stars: ✭ 27 (+92.86%)
Mutual labels:  pcf
antifreeze
Cloud Foundry CLI plugin to detect if an app doesn't match the manifest
Stars: ✭ 21 (+50%)
Mutual labels:  pcf
open-climate-investing
Application and data for analyzing and structuring portfolios for climate investing.
Stars: ✭ 20 (+42.86%)
Mutual labels:  esg

hammer - wrapper CLI for interacting with PCF environments

Test Status

Installation

The latest build of the hammer cli is available from the releases page. Download the tar for your platform, untar it, and move it to your $PATH.

Or using brew on macOS or Linux:

brew tap pivotal/hammer https://github.com/pivotal/hammer
brew install hammer

Alternatively you can build hammer from source if you have Go installed:

git clone [email protected]:pivotal/hammer.git && cd hammer && go install

You will also need to install, separately, any of the underlying cli tools that hammer will use in your workflow. hammer does not include cf, bosh, om, etc.

Config

In order to run the hammer tool against a given environment you need to have an environment config file in the following format:

{
  "name": "ENVIRONMENT-NAME",
  "ops_manager": {
    "url": "OPSMAN-URL",
    "client_id": "OPSMAN-CLIENT-ID",
    "client_secret": "OPSMAN-CLIENT-SECRET",
    "username": "OPSMAN-USERNAME",
    "password": "OPSMAN-PASSWORD"
  },
  "ops_manager_private_key": "OPSMAN-RSA-PRIVATE-KEY",
  "ops_manager_public_ip": "OPSMAN-PUBLIC-IP",
  "ops_manager_ssh_user": "OPSMAN-SSH-USER",
  "sys_domain": "PAS-SYSTEM-DOMAIN",
  "pks_api":  {
     "url": "PKS-API-URL"
  }
}

Or the equivalent in yaml:

name: ENVIRONMENT-NAME
ops_manager:
  client_id: OPSMAN-CLIENT-ID
  client_secret: OPSMAN-CLIENT-SECRET
  password: OPSMAN-PASSWORD
  url: OPSMAN-URL
  username: OPSMAN-USERNAME
ops_manager_private_key: OPSMAN-RSA-PRIVATE-KEY
ops_manager_public_ip: OPSMAN-PUBLIC-IP
ops_manager_ssh_user: OPSMAN-SSH-USER
pks_api:
  url: PKS-API-URL
sys_domain: PAS-SYSTEM-DOMAIN

This file can then be passed into the tool via hammer -t path-to-env-config <command>.

ops_manager_ssh_user is an optional field and if not set then hammer -t path-to-env-config ssh opsman will use ubuntu to ssh to the OpsManager VM, if users need to ssh via a different username they should set this as appropriate.

Only one set of ops_manager.client_id and ops_manager.client_secret or ops_manager.username and ops_manager.password need to be specified, if both sets are specified then in line with om the client details will be used.

NB: sys_domain and pks_api.url are only needed for using hammer cf-login and hammer pks-login respectively.

Multiple environments in a single config

The config file can contain a list of environments in previously defined structure, such as:

[{
  "name": "ENVIRONMENT-NAME-1",
  "ops_manager": {
    "url": "OPSMAN-URL",
    "client_id": "OPSMAN-CLIENT-ID",
    "client_secret": "OPSMAN-CLIENT-SECRET",
    "username": "OPSMAN-USERNAME",
    "password": "OPSMAN-PASSWORD"
  },
  "ops_manager_private_key": "OPSMAN-RSA-PRIVATE-KEY",
  "ops_manager_public_ip": "OPSMAN-PUBLIC-IP",
  "ops_manager_ssh_user": "OPSMAN-SSH-USER",
  "sys_domain": "PAS-SYSTEM-DOMAIN",
  "pks_api":  {
     "url": "PKS-API-URL"
  }
},
{
  "name": "ENVIRONMENT-NAME-2",
  "ops_manager": {
    "url": "OPSMAN-URL",
    "client_id": "OPSMAN-CLIENT-ID",
    "client_secret": "OPSMAN-CLIENT-SECRET",
    "username": "OPSMAN-USERNAME",
    "password": "OPSMAN-PASSWORD"
  },
  "ops_manager_private_key": "OPSMAN-RSA-PRIVATE-KEY",
  "ops_manager_public_ip": "OPSMAN-PUBLIC-IP",
  "ops_manager_ssh_user": "OPSMAN-SSH-USER",
  "sys_domain": "PAS-SYSTEM-DOMAIN",
  "pks_api":  {
    "url": "PKS-API-URL"
  }
}]

Or the equivalent in yaml:

- name: ENVIRONMENT-NAME-1
  ops_manager:
    client_id: OPSMAN-CLIENT-ID
    client_secret: OPSMAN-CLIENT-SECRET
    password: OPSMAN-PASSWORD
    url: OPSMAN-URL
    username: OPSMAN-USERNAME
  ops_manager_private_key: OPSMAN-RSA-PRIVATE-KEY
  ops_manager_public_ip: OPSMAN-PUBLIC-IP
  ops_manager_ssh_user: OPSMAN-SSH-USER
  pks_api:
    url: PKS-API-URL
  sys_domain: PAS-SYSTEM-DOMAIN
- name: ENVIRONMENT-NAME-2
  ops_manager:
    client_id: OPSMAN-CLIENT-ID
    client_secret: OPSMAN-CLIENT-SECRET
    password: OPSMAN-PASSWORD
    url: OPSMAN-URL
    username: OPSMAN-USERNAME
  ops_manager_private_key: OPSMAN-RSA-PRIVATE-KEY
  ops_manager_public_ip: OPSMAN-PUBLIC-IP
  ops_manager_ssh_user: OPSMAN-SSH-USER
  pks_api:
    url: PKS-API-URL
  sys_domain: PAS-SYSTEM-DOMAIN

An environment can then be specified via hammer -t path-to-env-config -e environment-name <command>. If an environment name is not specified then the first environment in the config will be used.

Development

Unit and integration tests can be run if you have Ginkgo installed:

ginkgo -r .

Linters can also be run using golangci-lint:

golangci-lint run

Or just run both with:

make test

Special thanks to @blgm for letting an internal tool he created serve as the basis for this tool.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].